From 870f096739f8e826b127ee9515422d253d91302c 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 | 6 ++++++ src/unix/linux_like/linux/musl/mod.rs | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/libc-test/semver/linux-musl.txt b/libc-test/semver/linux-musl.txt index b307f90353ef0..62b188dac8288 100644 --- a/libc-test/semver/linux-musl.txt +++ b/libc-test/semver/linux-musl.txt @@ -78,11 +78,15 @@ copy_file_range ctermid dirname eaccess +endutxent euidaccess explicit_bzero futimes getauxval getloadavg +getutxent +getutxid +getutxline lio_listio ntptimeval open_wmemstream @@ -94,8 +98,10 @@ prlimit prlimit64 process_vm_readv process_vm_writev +pututxline pwritev2 pwritev64 reallocarray +setutxent 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