Skip to content

Commit

Permalink
Add getpwnam_r, getpwuid_r to emscripten (rust-lang#3906)
Browse files Browse the repository at this point in the history
(backport <rust-lang#3906>)
(cherry picked from commit d5b17d5)
  • Loading branch information
ChanTsune authored and tgross35 committed Oct 15, 2024
1 parent 5951de5 commit a37cdde
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
2 changes: 2 additions & 0 deletions libc-test/semver/emscripten.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
getentropy
posix_fallocate64
getpwnam_r
getpwuid_r
15 changes: 15 additions & 0 deletions src/unix/linux_like/emscripten/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1776,6 +1776,21 @@ 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;
}

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

0 comments on commit a37cdde

Please sign in to comment.