Skip to content

Commit fff5dbe

Browse files
committed
Auto merge of #3228 - redox-os:redox-pw, r=JohnTitor
redox: add grp.h and pwd.h functions for the users crate
2 parents 66e988b + f4ed4a7 commit fff5dbe

File tree

2 files changed

+41
-2
lines changed

2 files changed

+41
-2
lines changed

libc-test/semver/redox.txt

+9-2
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,8 @@ SO_PEERCRED
137137
SO_PEERSEC
138138
SO_PRIORITY
139139
SO_PROTOCOL
140-
SO_REUSEPORT
141140
SO_RCVBUFFORCE
141+
SO_REUSEPORT
142142
SO_SNDBUFFORCE
143143
TCFLSH
144144
TCGETS
@@ -180,6 +180,7 @@ bsearch
180180
chroot
181181
clearerr
182182
difftime
183+
endpwent
183184
endservent
184185
epoll_create
185186
epoll_create1
@@ -189,12 +190,17 @@ epoll_wait
189190
explicit_bzero
190191
fchdir
191192
fmemopen
193+
getdtablesize
194+
getgrgid_r
195+
getgrnam_r
196+
getgrouplist
192197
getline
198+
getpwent
199+
getpwnam_r
193200
getrlimit
194201
getrusage
195202
getservbyport
196203
getservent
197-
getdtablesize
198204
killpg
199205
lockf
200206
madvise
@@ -206,6 +212,7 @@ pipe2
206212
pthread_condattr_setclock
207213
qsort
208214
reallocarray
215+
setpwent
209216
setrlimit
210217
setservent
211218
strcasecmp

src/unix/redox/mod.rs

+32
Original file line numberDiff line numberDiff line change
@@ -996,6 +996,28 @@ extern "C" {
996996
pub fn pipe2(fds: *mut ::c_int, flags: ::c_int) -> ::c_int;
997997
pub fn getdtablesize() -> ::c_int;
998998

999+
// grp.h
1000+
pub fn getgrgid_r(
1001+
gid: ::gid_t,
1002+
grp: *mut ::group,
1003+
buf: *mut ::c_char,
1004+
buflen: ::size_t,
1005+
result: *mut *mut ::group,
1006+
) -> ::c_int;
1007+
pub fn getgrnam_r(
1008+
name: *const ::c_char,
1009+
grp: *mut ::group,
1010+
buf: *mut ::c_char,
1011+
buflen: ::size_t,
1012+
result: *mut *mut ::group,
1013+
) -> ::c_int;
1014+
pub fn getgrouplist(
1015+
user: *const ::c_char,
1016+
group: ::gid_t,
1017+
groups: *mut ::gid_t,
1018+
ngroups: *mut ::c_int,
1019+
) -> ::c_int;
1020+
9991021
// malloc.h
10001022
pub fn memalign(align: ::size_t, size: ::size_t) -> *mut ::c_void;
10011023

@@ -1028,6 +1050,16 @@ extern "C" {
10281050
) -> ::c_int;
10291051

10301052
// pwd.h
1053+
pub fn getpwent() -> *mut passwd;
1054+
pub fn setpwent();
1055+
pub fn endpwent();
1056+
pub fn getpwnam_r(
1057+
name: *const ::c_char,
1058+
pwd: *mut passwd,
1059+
buf: *mut ::c_char,
1060+
buflen: ::size_t,
1061+
result: *mut *mut passwd,
1062+
) -> ::c_int;
10311063
pub fn getpwuid_r(
10321064
uid: ::uid_t,
10331065
pwd: *mut passwd,

0 commit comments

Comments
 (0)