Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

utmp function family missing on musl #3190

Closed
Ecordonnier opened this issue Apr 6, 2023 · 5 comments · Fixed by #3213
Closed

utmp function family missing on musl #3190

Ecordonnier opened this issue Apr 6, 2023 · 5 comments · Fixed by #3213
Labels
C-API-request Category: API request

Comments

@Ecordonnier
Copy link

Ecordonnier commented Apr 6, 2023

Hello,
functions like getutxent, setutxent, endutxent, struct utmpx, etc. are missing from the musl implementation ( src/unix/linux_like/linux/musl/mod.rs ), even though those functions are implemented in musl (see https://git.musl-libc.org/cgit/musl/tree/include/utmpx.h ).

As reference, see this commit which added the function for solaris, as well as the man page: https://linux.die.net/man/3/endutxent

@joshtriplett
Copy link
Member

Why is this trying to change O_LARGEFILE?

@Ecordonnier
Copy link
Author

@joshtriplett did you mean to ask this in the pull-request?

@joshtriplett
Copy link
Member

@Ecordonnier Yes, thank you.

devnexen added a commit to devnexen/libc that referenced this issue Jun 7, 2023
devnexen added a commit to devnexen/libc that referenced this issue Jul 22, 2023
devnexen added a commit to devnexen/libc that referenced this issue Jul 22, 2023
bors added a commit that referenced this issue Jan 8, 2024
utmpx api for linux musl + musl few build fixes.

close #3190
@bors bors closed this as completed in e3caaf6 Jan 8, 2024
Andy-Python-Programmer pushed a commit to Andy-Python-Programmer/libc that referenced this issue Mar 24, 2024
@andrewliebenow
Copy link
Contributor

These changes have been merged in, but have not been included in any subsequent releases:

diff --git a/src/unix/linux_like/linux/musl/mod.rs b/src/unix/linux_like/linux/musl/mod.rs
index a4c1f708afd50..d8b2767669309 100644
--- a/src/unix/linux_like/linux/musl/mod.rs
+++ b/src/unix/linux_like/linux/musl/mod.rs
@@ -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

e3caaf6#r1431346483

Is this waiting on version 0.3 (#3213 (comment))?

@Ecordonnier
Copy link
Author

Ecordonnier commented Sep 9, 2024

Yes it is waiting on 0.3 (which was renamed to 1.0, see #3248 )

tgross35 pushed a commit to tgross35/rust-libc that referenced this issue Nov 17, 2024
close rust-lang#3190

(backport <rust-lang#3213>)
(cherry picked from commit e3caaf6)
tgross35 pushed a commit to tgross35/rust-libc that referenced this issue Nov 17, 2024
close rust-lang#3190

(backport <rust-lang#3213>)
(cherry picked from commit e3caaf6)
tgross35 pushed a commit to tgross35/rust-libc that referenced this issue Nov 17, 2024
close rust-lang#3190

(backport <rust-lang#3213>)
(cherry picked from commit e3caaf6)
tgross35 pushed a commit to tgross35/rust-libc that referenced this issue Nov 17, 2024
close rust-lang#3190

(backport <rust-lang#3213>)
(cherry picked from commit e3caaf6)
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
C-API-request Category: API request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants