Skip to content

Commit d5b17d5

Browse files
authored
Add getpwnam_r, getpwuid_r to emscripten (rust-lang#3906)
1 parent 7cab757 commit d5b17d5

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

libc-test/semver/emscripten.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
getentropy
22
posix_fallocate64
3+
getpwnam_r
4+
getpwuid_r

src/unix/linux_like/emscripten/mod.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1774,6 +1774,21 @@ extern "C" {
17741774
) -> ::c_int;
17751775

17761776
pub fn getentropy(buf: *mut ::c_void, buflen: ::size_t) -> ::c_int;
1777+
1778+
pub fn getpwnam_r(
1779+
name: *const ::c_char,
1780+
pwd: *mut passwd,
1781+
buf: *mut ::c_char,
1782+
buflen: ::size_t,
1783+
result: *mut *mut passwd,
1784+
) -> ::c_int;
1785+
pub fn getpwuid_r(
1786+
uid: ::uid_t,
1787+
pwd: *mut passwd,
1788+
buf: *mut ::c_char,
1789+
buflen: ::size_t,
1790+
result: *mut *mut passwd,
1791+
) -> ::c_int;
17771792
}
17781793

17791794
// Alias <foo> to <foo>64 to mimic glibc's LFS64 support

0 commit comments

Comments
 (0)