Skip to content

Commit

Permalink
utmpx api for linux musl.
Browse files Browse the repository at this point in the history
  • Loading branch information
devnexen committed Dec 19, 2023
1 parent f05d6a3 commit e3caaf6
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 7 deletions.
2 changes: 1 addition & 1 deletion libc-test/semver/linux-gnu.txt
Original file line number Diff line number Diff line change
Expand Up @@ -617,12 +617,12 @@ dlinfo
dlmopen
endutxent
explicit_bzero
fgetgrent_r
fgetspent_r
futimes
getauxval
getentropy
getgrent_r
fgetgrent_r
getloadavg
getpt
getpwent_r
Expand Down
18 changes: 12 additions & 6 deletions libc-test/semver/linux-musl.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,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
Expand All @@ -71,14 +80,11 @@ prlimit
prlimit64
process_vm_readv
process_vm_writev
pututxline
pwritev64
reallocarray
timex
euidaccess
eaccess
asctime_r
setutxent
strftime
strftime_l
strptime
dirname
basename
timex
7 changes: 7 additions & 0 deletions src/unix/linux_like/linux/musl/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -900,6 +900,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 <foo> to <foo>64 to mimic glibc's LFS64 support
Expand Down

0 comments on commit e3caaf6

Please sign in to comment.