From 05091c397b488a6e0bb1ca8d5bfd93cc277865df Mon Sep 17 00:00:00 2001 From: David Carlier Date: Fri, 21 Apr 2023 20:25:58 +0100 Subject: [PATCH] utmpx api for linux musl. close #3190 (backport ) (cherry picked from commit e3caaf6b0ea08ae294e25a861022c256a7535ec4) --- libc-test/semver/linux-musl.txt | 14 ++++++++++++++ src/unix/linux_like/linux/musl/mod.rs | 7 +++++++ 2 files changed, 21 insertions(+) diff --git a/libc-test/semver/linux-musl.txt b/libc-test/semver/linux-musl.txt index b307f90353ef0..e295a4fc63381 100644 --- a/libc-test/semver/linux-musl.txt +++ b/libc-test/semver/linux-musl.txt @@ -72,17 +72,26 @@ aio_suspend aio_write aiocb asctime_r +asctime_r +basename basename clock_adjtime copy_file_range ctermid dirname +dirname eaccess +eaccess +endutxent +euidaccess euidaccess explicit_bzero futimes getauxval getloadavg +getutxent +getutxid +getutxline lio_listio ntptimeval open_wmemstream @@ -94,8 +103,13 @@ prlimit prlimit64 process_vm_readv process_vm_writev +pututxline pwritev2 pwritev64 reallocarray +setutxent +strftime +strftime_l +strptime tcp_info timex diff --git a/src/unix/linux_like/linux/musl/mod.rs b/src/unix/linux_like/linux/musl/mod.rs index 978423b0f2a0d..bfdbb0f0bad59 100644 --- a/src/unix/linux_like/linux/musl/mod.rs +++ b/src/unix/linux_like/linux/musl/mod.rs @@ -993,6 +993,13 @@ extern "C" { actions: *mut ::posix_spawn_file_actions_t, fd: ::c_int, ) -> ::c_int; + + 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