Skip to content

Commit 2575794

Browse files
committed
Merge pull request #138 from nbaksalyar/illumos
Add Illumos support
2 parents a59ccee + bff3892 commit 2575794

File tree

4 files changed

+782
-7
lines changed

4 files changed

+782
-7
lines changed

src/unix/bsd/mod.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,8 @@ pub const FLUSHO: ::tcflag_t = 0x00800000;
280280
pub const PENDIN: ::tcflag_t = 0x20000000;
281281
pub const NOFLSH: ::tcflag_t = 0x80000000;
282282

283+
pub const WNOHANG: ::c_int = 1;
284+
283285
f! {
284286
pub fn FD_CLR(fd: ::c_int, set: *mut fd_set) -> () {
285287
let fd = fd as usize;
@@ -324,6 +326,12 @@ extern {
324326
pub fn kqueue() -> ::c_int;
325327
pub fn unmount(target: *const ::c_char, arg: ::c_int) -> ::c_int;
326328
pub fn syscall(num: ::c_int, ...) -> ::c_int;
329+
#[cfg_attr(target_os = "netbsd", link_name = "__getpwuid_r50")]
330+
pub fn getpwuid_r(uid: ::uid_t,
331+
pwd: *mut passwd,
332+
buf: *mut ::c_char,
333+
buflen: ::size_t,
334+
result: *mut *mut passwd) -> ::c_int;
327335
}
328336

329337
cfg_if! {

src/unix/mod.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ s! {
9999
}
100100
}
101101

102-
pub const WNOHANG: ::c_int = 1;
103102
pub const SIG_DFL: sighandler_t = 0 as sighandler_t;
104103
pub const SIG_IGN: sighandler_t = 1 as sighandler_t;
105104
pub const SIG_ERR: sighandler_t = !0 as sighandler_t;
@@ -621,12 +620,6 @@ extern {
621620
addrlen: *mut socklen_t) -> ::ssize_t;
622621
pub fn mkfifo(path: *const c_char, mode: mode_t) -> ::c_int;
623622

624-
#[cfg_attr(target_os = "netbsd", link_name = "__getpwuid_r50")]
625-
pub fn getpwuid_r(uid: ::uid_t,
626-
pwd: *mut passwd,
627-
buf: *mut ::c_char,
628-
buflen: ::size_t,
629-
result: *mut *mut passwd) -> ::c_int;
630623
#[cfg_attr(target_os = "netbsd", link_name = "__sigemptyset14")]
631624
pub fn sigemptyset(set: *mut sigset_t) -> ::c_int;
632625
#[cfg_attr(target_os = "netbsd", link_name = "__sigaddset14")]
@@ -697,6 +690,9 @@ cfg_if! {
697690
target_os = "bitrig"))] {
698691
mod bsd;
699692
pub use self::bsd::*;
693+
} else if #[cfg(target_os = "sunos")] {
694+
mod sunos;
695+
pub use self::sunos::*;
700696
} else {
701697
// ...
702698
}

src/unix/notbsd/mod.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -523,6 +523,8 @@ pub const CLONE_DETACHED: ::c_int = 0x400000;
523523
pub const CLONE_UNTRACED: ::c_int = 0x800000;
524524
pub const CLONE_CHILD_SETTID: ::c_int = 0x01000000;
525525

526+
pub const WNOHANG: ::c_int = 1;
527+
526528
f! {
527529
pub fn FD_CLR(fd: ::c_int, set: *mut fd_set) -> () {
528530
let fd = fd as usize;
@@ -564,6 +566,11 @@ f! {
564566
}
565567

566568
extern {
569+
pub fn getpwuid_r(uid: ::uid_t,
570+
pwd: *mut passwd,
571+
buf: *mut ::c_char,
572+
buflen: ::size_t,
573+
result: *mut *mut passwd) -> ::c_int;
567574
pub fn fdatasync(fd: ::c_int) -> ::c_int;
568575
pub fn mincore(addr: *mut ::c_void, len: ::size_t,
569576
vec: *mut ::c_uchar) -> ::c_int;

0 commit comments

Comments
 (0)