-
Notifications
You must be signed in to change notification settings - Fork 340
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Switch from obsolete utmp interface to utmpx #213
base: master
Are you sure you want to change the base?
Conversation
Android NDK 25b has utmp.h but not utmpx.h. Switching API would break building these on android. |
yeah, while i'm always skeptical of "obsolete", and even more skeptical of anything being removed, a more persuasive version of this would have been "Switch from legacy utmp interface to POSIX utmpx". and since these are all no-ops on Android anyway, I can actually fix this for you in a header-file-only backwards-compatible way. amusingly, portability.h is already using https://android-review.googlesource.com/c/platform/bionic/+/2521475 (if you want to make this change, you'll still need a newer NDK, of course. but toybox binaries built by it will run on any existing version of Android.) |
Now <utmpx.h> isn't any more useful on Android than <utmp.h> is, but it is POSIX, and -- importantly -- we can implement it with just a header file, so code can use it on every existing API level. macOS does indeed only have the <utmpx.h> functions (although it does still have the <utmp.h> header!), so potentially portable code might want <utmpx.h> on Android. (glibc/musl both have both headers.) Bug: landley/toybox#213 Test: treehugger Change-Id: Iaa88167708182009a63e2e1a15f11186b251ed02
Now <utmpx.h> isn't any more useful on Android than <utmp.h> is, but it is POSIX, and -- importantly -- we can implement it with just a header file, so code can use it on every existing API level. macOS does indeed only have the <utmpx.h> functions (although it does still have the <utmp.h> header!), so potentially portable code might want <utmpx.h> on Android. (glibc/musl both have both headers.) Bug: landley/toybox#213 Test: treehugger Change-Id: Iaa88167708182009a63e2e1a15f11186b251ed02
Now <utmpx.h> isn't any more useful on Android than <utmp.h> is, but it is POSIX, and -- importantly -- we can implement it with just a header file, so code can use it on every existing API level. macOS does indeed only have the <utmpx.h> functions (although it does still have the <utmp.h> header!), so potentially portable code might want <utmpx.h> on Android. (glibc/musl both have both headers.) Bug: landley/toybox#213 Test: treehugger Change-Id: Iaa88167708182009a63e2e1a15f11186b251ed02
On linux, utmp isn't obsolete, and utmpx is the same as it, but on pretty much any other system utmp is obsolete and utmpx should be used instead.