diff --git a/libc-test/semver/linux-gnu.txt b/libc-test/semver/linux-gnu.txt index 07f6365826275..0e8e38ebe2df4 100644 --- a/libc-test/semver/linux-gnu.txt +++ b/libc-test/semver/linux-gnu.txt @@ -582,12 +582,12 @@ dlinfo dlmopen endutxent explicit_bzero +fgetgrent_r fgetspent_r futimes getauxval getentropy getgrent_r -fgetgrent_r getloadavg getpt getpwent_r diff --git a/libc-test/semver/linux-musl.txt b/libc-test/semver/linux-musl.txt index 09c461350f9a5..fc55519f64249 100644 --- a/libc-test/semver/linux-musl.txt +++ b/libc-test/semver/linux-musl.txt @@ -32,13 +32,22 @@ aio_return aio_suspend aio_write aiocb +asctime_r +basename clock_adjtime copy_file_range ctermid +dirname +eaccess +endutxent +euidaccess explicit_bzero futimes getauxval getloadavg +getutxent +getutxid +getutxline lio_listio ntptimeval open_wmemstream @@ -47,13 +56,10 @@ prlimit prlimit64 process_vm_readv process_vm_writev +pututxline pwritev64 reallocarray -timex -euidaccess -eaccess -asctime_r +setutxent strftime strptime -dirname -basename +timex diff --git a/src/unix/linux_like/linux/arch/generic/mod.rs b/src/unix/linux_like/linux/arch/generic/mod.rs index 7bc94c6f05bea..a89086d33e408 100644 --- a/src/unix/linux_like/linux/arch/generic/mod.rs +++ b/src/unix/linux_like/linux/arch/generic/mod.rs @@ -275,7 +275,6 @@ cfg_if! { pub const RLIMIT_NICE: ::c_int = 13; pub const RLIMIT_RTPRIO: ::c_int = 14; pub const RLIMIT_RTTIME: ::c_int = 15; - pub const RLIM_NLIMITS: ::c_int = 15; pub const RLIMIT_NLIMITS: ::c_int = RLIM_NLIMITS; } } @@ -287,6 +286,12 @@ cfg_if! { else if #[cfg(target_env = "uclibc")] { pub const RLIM_NLIMITS: ::__rlimit_resource_t = 15; } + else if #[cfg(target_env = "musl")] { + pub const RLIM_NLIMITS: ::c_int = 16; + } + else if #[cfg(target_env = "ohos")] { + pub const RLIM_NLIMITS: ::c_int = 15; + } } pub const RLIM_INFINITY: ::rlim_t = !0; diff --git a/src/unix/linux_like/linux/musl/b64/x86_64/mod.rs b/src/unix/linux_like/linux/musl/b64/x86_64/mod.rs index 9decf91bcc63a..28f0b0c45e621 100644 --- a/src/unix/linux_like/linux/musl/b64/x86_64/mod.rs +++ b/src/unix/linux_like/linux/musl/b64/x86_64/mod.rs @@ -671,7 +671,7 @@ pub const MAP_32BIT: ::c_int = 0x0040; pub const O_APPEND: ::c_int = 1024; pub const O_DIRECT: ::c_int = 0x4000; pub const O_DIRECTORY: ::c_int = 0x10000; -pub const O_LARGEFILE: ::c_int = 0; +pub const O_LARGEFILE: ::c_int = 0x8000; pub const O_NOFOLLOW: ::c_int = 0x20000; pub const O_CREAT: ::c_int = 64; pub const O_EXCL: ::c_int = 128; diff --git a/src/unix/linux_like/linux/musl/mod.rs b/src/unix/linux_like/linux/musl/mod.rs index 4c605338972e3..4256ed6cc14ab 100644 --- a/src/unix/linux_like/linux/musl/mod.rs +++ b/src/unix/linux_like/linux/musl/mod.rs @@ -309,7 +309,7 @@ s_no_extra_traits! { pub ut_exit: __exit_status, #[cfg(target_env = "musl")] - pub ut_session: ::c_long, + pub ut_session: ::c_int, #[cfg(target_env = "ohos")] #[cfg(target_endian = "little")] @@ -779,6 +779,13 @@ extern "C" { pub fn dirname(path: *mut ::c_char) -> *mut ::c_char; pub fn basename(path: *mut ::c_char) -> *mut ::c_char; + + pub fn getutxent() -> *mut utmpx; + pub fn getutxid(ut: *const utmpx) -> *mut utmpx; + pub fn getutxline(ut: *const utmpx) -> *mut utmpx; + pub fn pututxline(ut: *const utmpx) -> *mut utmpx; + pub fn setutxent(); + pub fn endutxent(); } // Alias to 64 to mimic glibc's LFS64 support