diff options
Diffstat (limited to 'src/unix/redox/mod.rs')
-rw-r--r-- | src/unix/redox/mod.rs | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/src/unix/redox/mod.rs b/src/unix/redox/mod.rs index dec47c610b..d946f46524 100644 --- a/src/unix/redox/mod.rs +++ b/src/unix/redox/mod.rs @@ -47,6 +47,7 @@ pub type speed_t = u32; pub type suseconds_t = ::c_int; pub type tcflag_t = u32; pub type time_t = ::c_longlong; +pub type id_t = ::c_uint; #[cfg_attr(feature = "extra_traits", derive(Debug))] pub enum timezone {} @@ -527,6 +528,10 @@ pub const POLLOUT: ::c_short = 0x004; pub const POLLERR: ::c_short = 0x008; pub const POLLHUP: ::c_short = 0x010; pub const POLLNVAL: ::c_short = 0x020; +pub const POLLRDNORM: ::c_short = 0x040; +pub const POLLRDBAND: ::c_short = 0x080; +pub const POLLWRNORM: ::c_short = 0x100; +pub const POLLWRBAND: ::c_short = 0x200; // pthread.h pub const PTHREAD_MUTEX_NORMAL: ::c_int = 0; @@ -995,6 +1000,28 @@ extern "C" { pub fn pipe2(fds: *mut ::c_int, flags: ::c_int) -> ::c_int; pub fn getdtablesize() -> ::c_int; + // grp.h + pub fn getgrgid_r( + gid: ::gid_t, + grp: *mut ::group, + buf: *mut ::c_char, + buflen: ::size_t, + result: *mut *mut ::group, + ) -> ::c_int; + pub fn getgrnam_r( + name: *const ::c_char, + grp: *mut ::group, + buf: *mut ::c_char, + buflen: ::size_t, + result: *mut *mut ::group, + ) -> ::c_int; + pub fn getgrouplist( + user: *const ::c_char, + group: ::gid_t, + groups: *mut ::gid_t, + ngroups: *mut ::c_int, + ) -> ::c_int; + // malloc.h pub fn memalign(align: ::size_t, size: ::size_t) -> *mut ::c_void; @@ -1027,6 +1054,16 @@ extern "C" { ) -> ::c_int; // pwd.h + pub fn getpwent() -> *mut passwd; + pub fn setpwent(); + pub fn endpwent(); + pub fn getpwnam_r( + name: *const ::c_char, + pwd: *mut passwd, + buf: *mut ::c_char, + buflen: ::size_t, + result: *mut *mut passwd, + ) -> ::c_int; pub fn getpwuid_r( uid: ::uid_t, pwd: *mut passwd, @@ -1104,6 +1141,15 @@ extern "C" { // strings.h pub fn explicit_bzero(p: *mut ::c_void, len: ::size_t); + + pub fn getpriority(which: ::c_int, who: ::id_t) -> ::c_int; + pub fn setpriority(which: ::c_int, who: ::id_t, prio: ::c_int) -> ::c_int; + + pub fn getsubopt( + optionp: *mut *mut c_char, + tokens: *const *mut c_char, + valuep: *mut *mut c_char, + ) -> ::c_int; } cfg_if! { |