diff --git a/ferrocene/library/libc/libc-test/semver/redox.txt b/ferrocene/library/libc/libc-test/semver/redox.txt index 6e73d0ac25f7..5f85e1aa7f3d 100644 --- a/ferrocene/library/libc/libc-test/semver/redox.txt +++ b/ferrocene/library/libc/libc-test/semver/redox.txt @@ -180,6 +180,7 @@ bsearch chroot clearerr difftime +endgrent endpwent endservent epoll_create @@ -191,7 +192,10 @@ explicit_bzero fchdir fmemopen getdtablesize +getgrent +getgrgid getgrgid_r +getgrnam getgrnam_r getgrouplist getline @@ -212,6 +216,7 @@ pipe2 pthread_condattr_setclock qsort reallocarray +setgrent setpwent setrlimit setservent diff --git a/ferrocene/library/libc/src/unix/bsd/netbsdlike/netbsd/mod.rs b/ferrocene/library/libc/src/unix/bsd/netbsdlike/netbsd/mod.rs index feb6eec4b39e..c612689a53f0 100644 --- a/ferrocene/library/libc/src/unix/bsd/netbsdlike/netbsd/mod.rs +++ b/ferrocene/library/libc/src/unix/bsd/netbsdlike/netbsd/mod.rs @@ -60,6 +60,39 @@ impl siginfo_t { self.si_addr } + pub unsafe fn si_code(&self) -> ::c_int { + self.si_code + } + + pub unsafe fn si_errno(&self) -> ::c_int { + self.si_errno + } + + pub unsafe fn si_pid(&self) -> ::pid_t { + #[repr(C)] + struct siginfo_timer { + _si_signo: ::c_int, + _si_errno: ::c_int, + _si_code: ::c_int, + __pad1: ::c_int, + _pid: ::pid_t, + } + (*(self as *const siginfo_t as *const siginfo_timer))._pid + } + + pub unsafe fn si_uid(&self) -> ::uid_t { + #[repr(C)] + struct siginfo_timer { + _si_signo: ::c_int, + _si_errno: ::c_int, + _si_code: ::c_int, + __pad1: ::c_int, + _pid: ::pid_t, + _uid: ::uid_t, + } + (*(self as *const siginfo_t as *const siginfo_timer))._uid + } + pub unsafe fn si_value(&self) -> ::sigval { #[repr(C)] struct siginfo_timer { diff --git a/ferrocene/library/libc/src/unix/bsd/netbsdlike/openbsd/mod.rs b/ferrocene/library/libc/src/unix/bsd/netbsdlike/openbsd/mod.rs index 24b1c64bb16c..ea90ba780f3c 100644 --- a/ferrocene/library/libc/src/unix/bsd/netbsdlike/openbsd/mod.rs +++ b/ferrocene/library/libc/src/unix/bsd/netbsdlike/openbsd/mod.rs @@ -548,12 +548,46 @@ impl siginfo_t { self.si_addr } - pub unsafe fn si_value(&self) -> ::sigval { + pub unsafe fn si_code(&self) -> ::c_int { + self.si_code + } + + pub unsafe fn si_errno(&self) -> ::c_int { + self.si_errno + } + + pub unsafe fn si_pid(&self) -> ::pid_t { + #[repr(C)] + struct siginfo_timer { + _si_signo: ::c_int, + _si_code: ::c_int, + _si_errno: ::c_int, + _pad: [::c_int; SI_PAD], + _pid: ::pid_t, + } + (*(self as *const siginfo_t as *const siginfo_timer))._pid + } + + pub unsafe fn si_uid(&self) -> ::uid_t { #[repr(C)] struct siginfo_timer { _si_signo: ::c_int, + _si_code: ::c_int, _si_errno: ::c_int, + _pad: [::c_int; SI_PAD], + _pid: ::pid_t, + _uid: ::uid_t, + } + (*(self as *const siginfo_t as *const siginfo_timer))._uid + } + + pub unsafe fn si_value(&self) -> ::sigval { + #[repr(C)] + struct siginfo_timer { + _si_signo: ::c_int, _si_code: ::c_int, + _si_errno: ::c_int, + _pad: [::c_int; SI_PAD], _pid: ::pid_t, _uid: ::uid_t, value: ::sigval, @@ -1652,6 +1686,9 @@ pub const NTFS_MFLAG_ALLNAMES: ::c_int = 0x2; pub const TMPFS_ARGS_VERSION: ::c_int = 1; +const SI_MAXSZ: ::size_t = 128; +const SI_PAD: ::size_t = (SI_MAXSZ / ::mem::size_of::<::c_int>()) - 3; + pub const MAP_STACK: ::c_int = 0x4000; pub const MAP_CONCEAL: ::c_int = 0x8000; diff --git a/ferrocene/library/libc/src/unix/redox/mod.rs b/ferrocene/library/libc/src/unix/redox/mod.rs index 900337b4f7e2..cd219a777288 100644 --- a/ferrocene/library/libc/src/unix/redox/mod.rs +++ b/ferrocene/library/libc/src/unix/redox/mod.rs @@ -1080,6 +1080,10 @@ extern "C" { pub fn getdtablesize() -> ::c_int; // grp.h + pub fn getgrent() -> *mut ::group; + pub fn setgrent(); + pub fn endgrent(); + pub fn getgrgid(gid: ::gid_t) -> *mut ::group; pub fn getgrgid_r( gid: ::gid_t, grp: *mut ::group, @@ -1087,6 +1091,7 @@ extern "C" { buflen: ::size_t, result: *mut *mut ::group, ) -> ::c_int; + pub fn getgrnam(name: *const ::c_char) -> *mut ::group; pub fn getgrnam_r( name: *const ::c_char, grp: *mut ::group,