Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add getpwnam_r, getpwuid_r, getgrgid_r and getgrnam_r to emscripten #1

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions libc-test/semver/emscripten.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
getentropy
posix_fallocate64
getpwnam_r
getpwuid_r
getgrgid_r
getgrnam_r
29 changes: 29 additions & 0 deletions src/unix/linux_like/emscripten/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1774,6 +1774,35 @@ extern "C" {
) -> ::c_int;

pub fn getentropy(buf: *mut ::c_void, buflen: ::size_t) -> ::c_int;

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,
buf: *mut ::c_char,
buflen: ::size_t,
result: *mut *mut passwd,
) -> ::c_int;
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;
}

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