diff --git a/libc-test/semver/linux-musl.txt b/libc-test/semver/linux-musl.txt index d8e4918facb16..e2fdcbf006c64 100644 --- a/libc-test/semver/linux-musl.txt +++ b/libc-test/semver/linux-musl.txt @@ -1,3 +1,4 @@ +ACCOUNTING AF_IB AF_MPLS AF_XDP @@ -37,6 +38,9 @@ RWF_HIPRI RWF_NOWAIT RWF_SYNC USER_PROCESS +UT_HOSTSIZE +UT_LINESIZE +UT_NAMESIZE _CS_V6_ENV _CS_V7_ENV adjtimex @@ -82,3 +86,4 @@ reallocarray setutxent tcp_info timex +utmpxname diff --git a/src/unix/linux_like/linux/musl/mod.rs b/src/unix/linux_like/linux/musl/mod.rs index f2e60ec16d650..ad17a2fea5aa6 100644 --- a/src/unix/linux_like/linux/musl/mod.rs +++ b/src/unix/linux_like/linux/musl/mod.rs @@ -656,7 +656,7 @@ pub const INIT_PROCESS: c_short = 5; pub const LOGIN_PROCESS: c_short = 6; pub const USER_PROCESS: c_short = 7; pub const DEAD_PROCESS: c_short = 8; -// musl does not define ACCOUNTING +pub const ACCOUNTING: c_short = 9; pub const SFD_CLOEXEC: c_int = 0x080000; @@ -888,6 +888,10 @@ pub const _CS_V7_ENV: c_int = 1149; pub const CLONE_NEWTIME: c_int = 0x80; +pub const UT_HOSTSIZE: usize = 256; +pub const UT_LINESIZE: usize = 32; +pub const UT_NAMESIZE: usize = 32; + cfg_if! { if #[cfg(target_arch = "s390x")] { pub const POSIX_FADV_DONTNEED: c_int = 6; @@ -987,12 +991,41 @@ extern "C" { fd: c_int, ) -> c_int; + #[deprecated( + since = "0.2.172", + note = "musl provides `utmp` as stubs and an alternative should be preferred; see https://wiki.musl-libc.org/faq.html" + )] pub fn getutxent() -> *mut utmpx; + #[deprecated( + since = "0.2.172", + note = "musl provides `utmp` as stubs and an alternative should be preferred; see https://wiki.musl-libc.org/faq.html" + )] pub fn getutxid(ut: *const utmpx) -> *mut utmpx; + #[deprecated( + since = "0.2.172", + note = "musl provides `utmp` as stubs and an alternative should be preferred; see https://wiki.musl-libc.org/faq.html" + )] pub fn getutxline(ut: *const utmpx) -> *mut utmpx; + #[deprecated( + since = "0.2.172", + note = "musl provides `utmp` as stubs and an alternative should be preferred; see https://wiki.musl-libc.org/faq.html" + )] pub fn pututxline(ut: *const utmpx) -> *mut utmpx; + #[deprecated( + since = "0.2.172", + note = "musl provides `utmp` as stubs and an alternative should be preferred; see https://wiki.musl-libc.org/faq.html" + )] pub fn setutxent(); + #[deprecated( + since = "0.2.172", + note = "musl provides `utmp` as stubs and an alternative should be preferred; see https://wiki.musl-libc.org/faq.html" + )] pub fn endutxent(); + #[deprecated( + since = "0.2.172", + note = "musl provides `utmp` as stubs and an alternative should be preferred; see https://wiki.musl-libc.org/faq.html" + )] + pub fn utmpxname(file: *const c_char) -> c_int; } // Alias to 64 to mimic glibc's LFS64 support