Skip to content

Commit 848c119

Browse files
committed
solarish systems couple of fn extensions.
1 parent e81e068 commit 848c119

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

src/unix/solarish/illumos.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ pub const F_OFD_SETLKW: ::c_int = 52;
3333
pub const F_FLOCK: ::c_int = 55;
3434
pub const F_FLOCKW: ::c_int = 56;
3535

36+
pub const MR_HDR_AOUT: ::c_uint = 0x3;
37+
3638
extern "C" {
3739
pub fn eventfd(init: ::c_uint, flags: ::c_int) -> ::c_int;
3840

@@ -49,4 +51,5 @@ extern "C" {
4951
pub fn preadv(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off_t) -> ::ssize_t;
5052
pub fn pwritev(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off_t)
5153
-> ::ssize_t;
54+
pub fn getpagesizes2(pagesize: *mut ::size_t, nelem: ::c_int) -> ::c_int;
5255
}

src/unix/solarish/mod.rs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,15 @@ s! {
425425
pub maxerror: i32,
426426
pub esterror: i32,
427427
}
428+
429+
pub struct mmapobj_result_t {
430+
pub mr_addr: ::caddr_t,
431+
pub mr_msize: ::size_t,
432+
pub mr_fize: ::size_t,
433+
pub mr_offset: ::size_t,
434+
pub mr_prot: ::c_uint,
435+
pub mr_flags: ::c_uint,
436+
}
428437
}
429438

430439
s_no_extra_traits! {
@@ -1240,6 +1249,11 @@ pub const MS_SYNC: ::c_int = 0x0004;
12401249
pub const MS_ASYNC: ::c_int = 0x0001;
12411250
pub const MS_INVALIDATE: ::c_int = 0x0002;
12421251

1252+
pub const MMOBJ_PADDING: ::c_uint = 0x10000;
1253+
pub const MMOBJ_INTERPRET: ::c_uint = 0x20000;
1254+
pub const MR_PADDING: ::c_uint = 0x1;
1255+
pub const MR_HDR_ELF: ::c_uint = 0x2;
1256+
12431257
pub const EPERM: ::c_int = 1;
12441258
pub const ENOENT: ::c_int = 2;
12451259
pub const ESRCH: ::c_int = 3;
@@ -2338,6 +2352,10 @@ safe_f! {
23382352
pub {const} fn WCOREDUMP(status: ::c_int) -> bool {
23392353
(status & 0x80) != 0
23402354
}
2355+
2356+
pub {const} fn MR_GET_TYPE(flags: ::c_uint) -> ::c_uint {
2357+
flags & 0x0000ffff
2358+
}
23412359
}
23422360

23432361
extern "C" {
@@ -2800,6 +2818,15 @@ extern "C" {
28002818
sfvcnt: ::c_int,
28012819
xferred: *mut ::size_t,
28022820
) -> ::ssize_t;
2821+
pub fn getpagesize() -> ::c_int;
2822+
pub fn getpagesizes(pagesize: *mut ::size_t, nelem: ::c_int) -> ::c_int;
2823+
pub fn mmapobj(
2824+
fd: ::c_int,
2825+
flags: ::c_uint,
2826+
storage: *mut mmapobj_result_t,
2827+
elements: *mut ::c_uint,
2828+
arg: *mut ::c_void,
2829+
) -> ::c_int;
28032830
}
28042831

28052832
mod compat;

0 commit comments

Comments
 (0)