summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Soller <jackpot51@gmail.com>2023-04-26 11:31:34 -0600
committerJeremy Soller <jackpot51@gmail.com>2023-04-26 11:37:35 -0600
commitf4ed4a786550fd075ce65bc79164fe78bb01d1ec (patch)
tree4d0db7b4c246b6ab5813a580d2ccb7c6026a08b2
parent0485ee3ec37da6789b396b9f6081933c34d9f2a4 (diff)
downloadrust-libc-f4ed4a786550fd075ce65bc79164fe78bb01d1ec.tar.gz
redox: add grp.h and pwd.h functions for the users crate
-rw-r--r--libc-test/semver/redox.txt11
-rw-r--r--src/unix/redox/mod.rs32
2 files changed, 41 insertions, 2 deletions
diff --git a/libc-test/semver/redox.txt b/libc-test/semver/redox.txt
index 4b6e126ea6..cd07660cc4 100644
--- a/libc-test/semver/redox.txt
+++ b/libc-test/semver/redox.txt
@@ -137,8 +137,8 @@ SO_PEERCRED
SO_PEERSEC
SO_PRIORITY
SO_PROTOCOL
-SO_REUSEPORT
SO_RCVBUFFORCE
+SO_REUSEPORT
SO_SNDBUFFORCE
TCFLSH
TCGETS
@@ -180,6 +180,7 @@ bsearch
chroot
clearerr
difftime
+endpwent
endservent
epoll_create
epoll_create1
@@ -189,12 +190,17 @@ epoll_wait
explicit_bzero
fchdir
fmemopen
+getdtablesize
+getgrgid_r
+getgrnam_r
+getgrouplist
getline
+getpwent
+getpwnam_r
getrlimit
getrusage
getservbyport
getservent
-getdtablesize
killpg
lockf
madvise
@@ -206,6 +212,7 @@ pipe2
pthread_condattr_setclock
qsort
reallocarray
+setpwent
setrlimit
setservent
strcasecmp
diff --git a/src/unix/redox/mod.rs b/src/unix/redox/mod.rs
index ccd3d779fa..09abf54ed5 100644
--- a/src/unix/redox/mod.rs
+++ b/src/unix/redox/mod.rs
@@ -996,6 +996,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;
@@ -1028,6 +1050,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,