I think utmpxh's updwtmpx might need _GNU_SOURCE to be defined to be usable? Noticed when investigating a warning when building gdm 42.0: ``` ../gdm-42.0/daemon/gdm-session-record.c:200:9: error: implicit declaration of function ‘updwtmpx’; did you mean ‘updwtmp’? [-Werror=implicit-function-declaration] updwtmpx (GDM_NEW_SESSION_RECORDS_FILE, &session_record); ``` ... but: ``` #if defined(HAVE_UTMPX_H) #include <utmpx.h> #endif #if defined(HAVE_UTMP_H) #include <utmp.h> #endif ``` And config.h, set by Meson, contains HAVE_UTMPX_H, HAVE_UTMP_H, HAVE_UPDWTMP, HAVE_UPDWTMPX. From looking at glibc-2.35's /usr/include/utmpx.h, I think it might need _GNU_SOURCE? It's guarded by __USE_GNU within glibc headers: ``` [..] #ifdef __USE_GNU /* Change name of the utmpx file to be examined. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int utmpxname (const char *__file); [...] /* Append entry UTMP to the wtmpx-like file WTMPX_FILE. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern void updwtmpx (const char *__wtmpx_file, const struct utmpx *__utmpx); [...] ``` Aside: a friend points out that NetBSD needs NETBSD_SOURCE defined for it too: https://github.com/NetBSD/src/blob/6c9d506c6146a69f3807ce59b4c063792ef32829/include/utmpx.h#L143.
FWIW, Gnulib indeed (as the man page hints) that it is a glibc extension: https://www.gnu.org/software/gnulib/manual/gnulib.html#updwtmpx.
Sent patch to ML: https://marc.info/?l=linux-man&m=165603977710424&w=2. Suppose the commit message should be more detailed but I'll wait for someone to tell me if this is even right first :)
Hi Sam, Sorry for the delay; I read your posts, but didn't have much time to reply. Yes, normally I'd ask for a more detailed commit message, but since it is very obvious to me that it's correct from this bugzilla report (and also from the glibc code), and there's a link to this issue in the commit, I think it's OK as is the patch. Thanks! Alex