Skip to contentSkip to conversation

getnameinfo.3: Fix _POSIX_C_SOURCE value for getaddrinfo()

PATCH In review Sebastian Kirmayer 3 participants 6 messages Nov 22, 2020 – Nov 23, 2020 Man-pages: manual pages for Linux -- Sections 2, 3, 4, 5, and 7

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 getnameinfo.3: Fix _POSIX_C_SOURCE value for getaddrinfo()

The minimum value of _POSIX_C_SOURCE for getnameinfo() was mistyped as 201112L (not a real POSIX version), it should be 200112L. This is the same typo that was fixed for getaddrinfo.3 in commit 94db8ae1824ada8561c3dbbbed88a8a9175c4886

According to the current documentation, this file should not compile, but it does:

    #define _POSIX_C_SOURCE 200112L
    #include <netdb.h>
    int (*mygetnameinfo)() = getnameinfo;

(If _POSIX_C_SOURCE is changed to 200111L, the program does no longer compile.)

man3/getnameinfo.3:

@@ -27,7 +27,7 @@ Feature Test Macro Requirements for glibc (see
.RE
.PP
.BR getnameinfo ():
- Since glibc 2.22: _POSIX_C_SOURCE >= 201112L
+ Since glibc 2.22: _POSIX_C_SOURCE >= 200112L
Glibc 2.21 and earlier: _POSIX_C_SOURCE
.ad b
.SH DESCRIPTION

#1 lore raw

Hi Sebastian,

Quoted 16 lines · Sebastian Kirmayer

The minimum value of _POSIX_C_SOURCE for getnameinfo() was mistyped as 201112L (not a real POSIX version), it should be 200112L. This is the same typo that was fixed for getaddrinfo.3 in commit 94db8ae1824ada8561c3dbbbed88a8a9175c4886

According to the current documentation, this file should not compile, but it does:

    #define _POSIX_C_SOURCE 200112L
    #include <netdb.h>
    int (*mygetnameinfo)() = getnameinfo;

(If _POSIX_C_SOURCE is changed to 200111L, the program does no longer compile.)

man3/getnameinfo.3:

Review Feature Test Macro Requirements for glibc (see · line 33

Quoted 8 lines
(quoted diff) +1 -1
@@ -27,7 +27,7 @@ Feature Test Macro Requirements for glibc (see
 .RE
 .PP
 .BR getnameinfo ():
-    Since glibc 2.22: _POSIX_C_SOURCE >= 201112L
+    Since glibc 2.22: _POSIX_C_SOURCE >= 200112L
     Glibc 2.21 and earlier: _POSIX_C_SOURCE
 .ad b
 .SH DESCRIPTION

Thanks for taking the time to report, but I think you must be looking at a rather old version of the manual pages. It looks like that typo was fixed about three years ago in the Git tree!

Thanks,

Michael

Signature · 3 lines
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/
#2 lore raw

Hi Michael,

Quoted 32 lines · Michael Kerrisk (man-pages)

Hi Sebastian,

Quoted 16 lines · Sebastian Kirmayer

The minimum value of _POSIX_C_SOURCE for getnameinfo() was mistyped as 201112L (not a real POSIX version), it should be 200112L. This is the same typo that was fixed for getaddrinfo.3 in commit 94db8ae1824ada8561c3dbbbed88a8a9175c4886

According to the current documentation, this file should not compile, but it does:

    #define _POSIX_C_SOURCE 200112L
    #include <netdb.h>
    int (*mygetnameinfo)() = getnameinfo;

(If _POSIX_C_SOURCE is changed to 200111L, the program does no longer compile.)

man3/getnameinfo.3:

Review Feature Test Macro Requirements for glibc (see · line 33

Quoted 8 lines
(quoted diff) +1 -1
@@ -27,7 +27,7 @@ Feature Test Macro Requirements for glibc (see
 .RE
 .PP
 .BR getnameinfo ():
-    Since glibc 2.22: _POSIX_C_SOURCE >= 201112L
+    Since glibc 2.22: _POSIX_C_SOURCE >= 200112L
     Glibc 2.21 and earlier: _POSIX_C_SOURCE
 .ad b
 .SH DESCRIPTION

Thanks for taking the time to report, but I think you must be looking at a rather old version of the manual pages. It looks like that typo was fixed about three years ago in the Git tree!

Quoted 3 lines

Thanks,

Michael

Oops, I accidently wrote getaddrinfo() in the subject. I meant to write getnameinfo(), and I'm actually referencing the commit from three years ago fixing it for getaddrinfo().

Sebastian

#3 lore raw

Hi Sebastian,

Quoted 36 lines · Sebastian Kirmayer

Hi Michael,

Quoted 32 lines · Michael Kerrisk (man-pages)

Hi Sebastian,

Quoted 16 lines · Sebastian Kirmayer

The minimum value of _POSIX_C_SOURCE for getnameinfo() was mistyped as 201112L (not a real POSIX version), it should be 200112L. This is the same typo that was fixed for getaddrinfo.3 in commit 94db8ae1824ada8561c3dbbbed88a8a9175c4886

According to the current documentation, this file should not compile, but it does:

    #define _POSIX_C_SOURCE 200112L
    #include <netdb.h>
    int (*mygetnameinfo)() = getnameinfo;

(If _POSIX_C_SOURCE is changed to 200111L, the program does no longer compile.)

man3/getnameinfo.3:

Review Feature Test Macro Requirements for glibc (see · line 33

Quoted 8 lines
(quoted diff) +1 -1
@@ -27,7 +27,7 @@ Feature Test Macro Requirements for glibc (see
 .RE
 .PP
 .BR getnameinfo ():
-    Since glibc 2.22: _POSIX_C_SOURCE >= 201112L
+    Since glibc 2.22: _POSIX_C_SOURCE >= 200112L
     Glibc 2.21 and earlier: _POSIX_C_SOURCE
 .ad b
 .SH DESCRIPTION

Thanks for taking the time to report, but I think you must be looking at a rather old version of the manual pages. It looks like that typo was fixed about three years ago in the Git tree!

Quoted 7 lines
Quoted 3 lines

Thanks,

Michael

Oops, I accidently wrote getaddrinfo() in the subject. I meant to write getnameinfo(), and I'm actually referencing the commit from three years ago fixing it for getaddrinfo().

Ahh -- sorry, I should have looked more closely at your mail then. Fixed now. Thanks for the report!

Cheers,

Michael

--
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

#4 lore raw

Hi Michael,

Quoted 47 lines · Michael Kerrisk (man-pages)

Hi Sebastian,

Quoted 36 lines · Sebastian Kirmayer

Hi Michael,

Quoted 32 lines · Michael Kerrisk (man-pages)

Hi Sebastian,

Quoted 16 lines · Sebastian Kirmayer

The minimum value of _POSIX_C_SOURCE for getnameinfo() was mistyped as 201112L (not a real POSIX version), it should be 200112L. This is the same typo that was fixed for getaddrinfo.3 in commit 94db8ae1824ada8561c3dbbbed88a8a9175c4886

According to the current documentation, this file should not compile, but it does:

    #define _POSIX_C_SOURCE 200112L
    #include <netdb.h>
    int (*mygetnameinfo)() = getnameinfo;

(If _POSIX_C_SOURCE is changed to 200111L, the program does no longer compile.)

man3/getnameinfo.3:

Review Feature Test Macro Requirements for glibc (see · line 33

Quoted 8 lines
(quoted diff) +1 -1
@@ -27,7 +27,7 @@ Feature Test Macro Requirements for glibc (see
 .RE
 .PP
 .BR getnameinfo ():
-    Since glibc 2.22: _POSIX_C_SOURCE >= 201112L
+    Since glibc 2.22: _POSIX_C_SOURCE >= 200112L
     Glibc 2.21 and earlier: _POSIX_C_SOURCE
 .ad b
 .SH DESCRIPTION

Thanks for taking the time to report, but I think you must be looking at a rather old version of the manual pages. It looks like that typo was fixed about three years ago in the Git tree!

Quoted 7 lines
Quoted 3 lines

Thanks,

Michael

Oops, I accidently wrote getaddrinfo() in the subject. I meant to write getnameinfo(), and I'm actually referencing the commit from three years ago fixing it for getaddrinfo().

Quoted 6 lines

Ahh -- sorry, I should have looked more closely at your mail then. Fixed now. Thanks for the report!

Cheers,

Michael

I just saw your commit, and it seems that you made another typo while fixing the previous typo: It should be 200112L, not 20112L.

Sebastian

#5 lore raw

Hi Sebastian

Quoted 2 lines

I just saw your commit, and it seems that you made another typo while fixing the previous typo: It should be 200112L, not 20112L.

D'oh! Thanks. FIxed.

Cheers,

Michael

Signature · 3 lines
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/