From dcc50e0d1e46855fb8f3434bd453928a229bf1f0 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 21 Jan 2024 17:50:52 +0100 Subject: [PATCH] readutmp, boot-time: Port to Android NDK r26. Reported by Po Lu in . * lib/readutmp.h: Update comments. (UTMP_NAME_FUNCTION): Define as a no-op for Android with HAVE_UTMPX_H. --- ChangeLog | 8 ++++++++ lib/readutmp.h | 24 ++++++++++++++---------- 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1d1975d94d..4b36e727ac 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2024-01-21 Bruno Haible + + readutmp, boot-time: Port to Android NDK r26. + Reported by Po Lu in + . + * lib/readutmp.h: Update comments. + (UTMP_NAME_FUNCTION): Define as a no-op for Android with HAVE_UTMPX_H. + 2024-01-21 Bruno Haible asyncsafe-spin: Fix link error on various platforms. diff --git a/lib/readutmp.h b/lib/readutmp.h index b62eb3beaa..dcfd44dbbc 100644 --- a/lib/readutmp.h +++ b/lib/readutmp.h @@ -114,21 +114,21 @@ enum { UT_HOST_SIZE = -1 }; Field Type Platforms ---------- ------ --------- - ⎡ ut_user char[] glibc, musl, macOS, FreeBSD, AIX, HP-UX, IRIX, Solaris, Cygwin + ⎡ ut_user char[] glibc, musl, macOS, FreeBSD, AIX, HP-UX, IRIX, Solaris, Cygwin, Android ⎣ ut_name char[] NetBSD, Minix - ut_id char[] glibc, musl, macOS, FreeBSD, NetBSD, Minix, AIX, HP-UX, IRIX, Solaris, Cygwin - ut_line char[] glibc, musl, macOS, FreeBSD, NetBSD, Minix, AIX, HP-UX, IRIX, Solaris, Cygwin - ut_pid pid_t glibc, musl, macOS, FreeBSD, NetBSD, Minix, AIX, HP-UX, IRIX, Solaris, Cygwin - ut_type short glibc, musl, macOS, FreeBSD, NetBSD, Minix, AIX, HP-UX, IRIX, Solaris, Cygwin - ⎡ ut_tv struct glibc, musl, macOS, FreeBSD, NetBSD, Minix, AIX, HP-UX, IRIX, Solaris, Cygwin + ut_id char[] glibc, musl, macOS, FreeBSD, NetBSD, Minix, AIX, HP-UX, IRIX, Solaris, Cygwin, Android + ut_line char[] glibc, musl, macOS, FreeBSD, NetBSD, Minix, AIX, HP-UX, IRIX, Solaris, Cygwin, Android + ut_pid pid_t glibc, musl, macOS, FreeBSD, NetBSD, Minix, AIX, HP-UX, IRIX, Solaris, Cygwin, Android + ut_type short glibc, musl, macOS, FreeBSD, NetBSD, Minix, AIX, HP-UX, IRIX, Solaris, Cygwin, Android + ⎡ ut_tv struct glibc, musl, macOS, FreeBSD, NetBSD, Minix, AIX, HP-UX, IRIX, Solaris, Cygwin, Android ⎢ { tv_sec; tv_usec; } ⎣ ut_time time_t Cygwin - ut_host char[] glibc, musl, macOS, FreeBSD, NetBSD, Minix, AIX, HP-UX, IRIX, Solaris, Cygwin - ut_exit struct glibc, musl, NetBSD, Minix, HP-UX, IRIX, Solaris + ut_host char[] glibc, musl, macOS, FreeBSD, NetBSD, Minix, AIX, HP-UX, IRIX, Solaris, Cygwin, Android + ut_exit struct glibc, musl, NetBSD, Minix, HP-UX, IRIX, Solaris, Android { e_termination; e_exit; } - ut_session [long] int glibc, musl, NetBSD, Minix, IRIX, Solaris + ut_session [long] int glibc, musl, NetBSD, Minix, IRIX, Solaris, Android ⎡ ut_addr [long] int HP-UX, Cygwin - ⎢ ut_addr_v6 [u]int[4] glibc, musl + ⎢ ut_addr_v6 [u]int[4] glibc, musl, Android ⎣ ut_ss struct sockaddr_storage NetBSD, Minix */ @@ -177,6 +177,10 @@ struct utmpx32 # define UTMP_NAME_FUNCTION utmpxname # elif defined UTXDB_ACTIVE /* FreeBSD */ # define UTMP_NAME_FUNCTION(x) setutxdb (UTXDB_ACTIVE, x) +# elif defined __ANDROID__ /* Android */ +/* As of Android NDK r26, the getutxent, setutxent functions are no-ops. + Therefore we can ignore the file name. */ +# define UTMP_NAME_FUNCTION(x) ((void) (x)) # endif #elif HAVE_UTMP_H -- 2.39.5