Skip to contentSkip to conversation

updwtmp.3: Add #define GNU_SOURCE for updwtmpx

PATCH In review Sam James 2 participants 2 messages Jun 24, 2022 – Jul 3, 2022 Man-pages: manual pages for Linux -- Sections 2, 3, 4, 5, and 7

lore
Share & tools
lore

Sam James

author
#0 lore raw

PATCH 1/1 updwtmp.3: Add #define GNU_SOURCE for updwtmpx

---
 man3/updwtmp.3 | 1 +
 1 file changed, 1 insertion(+)
man3/updwtmp.3 +1 -0
index bd84b91cd..175bec772 100644
@@ -66,6 +66,7 @@ glibc provides (since version 2.1):
 .PP
 .in +4n
 .EX
+.BR "#define _GNU_SOURCE          " "/* See feature_test_macros(7) */"
 .B #include <utmpx.h>
 .BI "void updwtmpx (const char *" wtmpx_file ", const struct utmpx *" utx );
 .EE
Signature · 1 line
2.36.1
#1 lore raw

Hi Sam!

Quoted 2 lines · Sam James

Thanks for the patch! I applied it.

And yes, glibc uses internally __USE_GNU for when a user is expected to define _GNU_SOURCE.

Cheers,

Alex

See also:

alx@asus5775:/usr/include$ grepc __USE_GNU
./features.h:392:
# define __USE_GNU	1

./regex.h:33:

# define __USE_GNU 1

./x86_64-linux-gnu/ruby-3.0.0/rb_mjit_min_header-3.0.4.h:19554:
#define __USE_GNU 1

alx@asus5775:/usr/include$ grep -rnC1 define.__USE_GNU features.h regex.h
features.h-391-#ifdef	_GNU_SOURCE
features.h:392:# define __USE_GNU	1
features.h-393-#endif
--
regex.h-32-#ifdef _GNU_SOURCE
regex.h:33:# define __USE_GNU 1
regex.h-34-#endif
Quoted 16 lines
---
  man3/updwtmp.3 | 1 +
  1 file changed, 1 insertion(+)
man3/updwtmp.3 +1 -0
index bd84b91cd..175bec772 100644
@@ -66,6 +66,7 @@ glibc provides (since version 2.1):
  .PP
  .in +4n
  .EX
+.BR "#define _GNU_SOURCE          " "/* See feature_test_macros(7) */"
  .B #include <utmpx.h>
  .BI "void updwtmpx (const char *" wtmpx_file ", const struct utmpx *" utx );
  .EE
Signature · 2 lines
Alejandro Colomar
<http://www.alejandro-colomar.es/>