From: bugzilla-daemon@kernel.org
To: linux-man@vger.kernel.org
Subject: [Bug 216168] New: updwtmp(3) doesn't mention need for _GNU_SOURCE for updwtmpx
Date: Fri, 24 Jun 2022 02:42:55 +0000 [thread overview]
Message-ID: <bug-216168-11311@https.bugzilla.kernel.org/> (raw)
https://bugzilla.kernel.org/show_bug.cgi?id=216168
Bug ID: 216168
Summary: updwtmp(3) doesn't mention need for _GNU_SOURCE for
updwtmpx
Product: Documentation
Version: unspecified
Hardware: All
OS: Linux
Status: NEW
Severity: normal
Priority: P1
Component: man-pages
Assignee: documentation_man-pages@kernel-bugs.osdl.org
Reporter: sam@gentoo.org
Regression: No
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.
--
You may reply to this email to add a comment.
You are receiving this mail because:
You are watching the assignee of the bug.
next reply other threads:[~2022-06-24 2:43 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-24 2:42 bugzilla-daemon [this message]
2022-06-24 2:45 ` [Bug 216168] updwtmp(3) doesn't mention need for _GNU_SOURCE for updwtmpx bugzilla-daemon
2022-06-24 5:09 ` bugzilla-daemon
2022-07-03 18:27 ` bugzilla-daemon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=bug-216168-11311@https.bugzilla.kernel.org/ \
--to=bugzilla-daemon@kernel.org \
--cc=linux-man@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox