Merge pull request #1653 from ArniDagur/shadow_reenterant

Add reenterant shadow.h functions
This commit is contained in:
Yuki Okushi 2020-03-17 01:46:31 +09:00 committed by GitHub
commit 598939dd5e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 31 additions and 1 deletions

View File

@ -1087,6 +1087,26 @@ cfg_if! {
pub const PTHREAD_MUTEX_ADAPTIVE_NP: ::c_int = 3;
extern "C" {
pub fn fgetspent_r(
fp: *mut ::FILE,
spbuf: *mut ::spwd,
buf: *mut ::c_char,
buflen: ::size_t,
spbufp: *mut *mut ::spwd,
) -> ::c_int;
pub fn sgetspent_r(
s: *const ::c_char,
spbuf: *mut ::spwd,
buf: *mut ::c_char,
buflen: ::size_t,
spbufp: *mut *mut ::spwd,
) -> ::c_int;
pub fn getspent_r(
spbuf: *mut ::spwd,
buf: *mut ::c_char,
buflen: ::size_t,
spbufp: *mut *mut ::spwd,
) -> ::c_int;
pub fn qsort_r(
base: *mut ::c_void,
num: ::size_t,

View File

@ -2587,7 +2587,17 @@ extern "C" {
pub fn endspent();
pub fn getspent() -> *mut spwd;
pub fn getspnam(__name: *const ::c_char) -> *mut spwd;
pub fn getspnam(name: *const ::c_char) -> *mut spwd;
// Only `getspnam_r` is implemented for musl, out of all of the reenterant
// functions from `shadow.h`.
// https://git.musl-libc.org/cgit/musl/tree/include/shadow.h
pub fn getspnam_r(
name: *const ::c_char,
spbuf: *mut spwd,
buf: *mut ::c_char,
buflen: ::size_t,
spbufp: *mut *mut spwd,
) -> ::c_int;
pub fn shm_open(
name: *const c_char,