Skip to content

Commit

Permalink
Auto merge of #3228 - redox-os:redox-pw, r=JohnTitor
Browse files Browse the repository at this point in the history
redox: add grp.h and pwd.h functions for the users crate
  • Loading branch information
bors committed May 1, 2023
2 parents 66e988b + f4ed4a7 commit fff5dbe
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 2 deletions.
11 changes: 9 additions & 2 deletions libc-test/semver/redox.txt
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ SO_PEERCRED
SO_PEERSEC
SO_PRIORITY
SO_PROTOCOL
SO_REUSEPORT
SO_RCVBUFFORCE
SO_REUSEPORT
SO_SNDBUFFORCE
TCFLSH
TCGETS
Expand Down Expand Up @@ -180,6 +180,7 @@ bsearch
chroot
clearerr
difftime
endpwent
endservent
epoll_create
epoll_create1
Expand All @@ -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
Expand All @@ -206,6 +212,7 @@ pipe2
pthread_condattr_setclock
qsort
reallocarray
setpwent
setrlimit
setservent
strcasecmp
Expand Down
32 changes: 32 additions & 0 deletions src/unix/redox/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit fff5dbe

Please sign in to comment.