]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Fix stdio.h namespace for pre-threads POSIX (bug 20014).
authorJoseph Myers <joseph@codesourcery.com>
Thu, 28 Apr 2016 22:01:04 +0000 (22:01 +0000)
committerJoseph Myers <joseph@codesourcery.com>
Thu, 28 Apr 2016 22:01:04 +0000 (22:01 +0000)
stdio.h declares flockfile, ftrylockfile, funlockfile, getc_unlocked,
getchar_unlocked, putc_unlocked and putchar_unlocked if __USE_POSIX,
with comments "These are defined in POSIX.1:1996.".  But __USE_POSIX
is actually POSIX.1:1990, and these functions should not be declared
for 1990 / 1992 / 1993 POSIX, XPG3 or XPG4.  This patch fixes stdio.h
to use __USE_POSIX199506 instead for those conditionals, as that is
the correct conditional for the version of POSIX that introduced
threads, and with threads those functions.

Tested for x86_64 and x86 (testsuite, and that installed shared
libraries are unchanged by the patch).

[BZ #20014]
* libio/stdio.h (getc_unlocked): Declare if [__USE_POSIX199506],
not [__USE_POSIX].
(getchar_unlocked): Likewise.
(putc_unlocked): Likewise.
(putchar_unlocked): Likewise.
(flockfile): Likewise.
(ftrylockfile): Likewise.
(funlockfile): Likewise.
* conform/Makefile (test-xfail-XPG3/stdio.h/conform): Remove
variable.
(test-xfail-XPG4/stdio.h/conform): Likewise.

ChangeLog
conform/Makefile
libio/stdio.h

index 39bb84a2b3cb7db12c6181b15e6d33820360c78a..260bf998d8a951e321bb775051608f4233425a4e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,18 @@
 2016-04-28  Joseph Myers  <joseph@codesourcery.com>
 
+       [BZ #20014]
+       * libio/stdio.h (getc_unlocked): Declare if [__USE_POSIX199506],
+       not [__USE_POSIX].
+       (getchar_unlocked): Likewise.
+       (putc_unlocked): Likewise.
+       (putchar_unlocked): Likewise.
+       (flockfile): Likewise.
+       (ftrylockfile): Likewise.
+       (funlockfile): Likewise.
+       * conform/Makefile (test-xfail-XPG3/stdio.h/conform): Remove
+       variable.
+       (test-xfail-XPG4/stdio.h/conform): Likewise.
+
        * conform/data/langinfo.h-data [XPG3 || XPG4 || UNIX98] (YESSTR):
        Expect constant.
        [XPG3 || XPG4 || UNIX98] (NOSTR): Likewise.
index 06c4ff36f4745d5f2d3a91b6074df1399ff059d9..f2aa1771b6116e3aa64083562b8787c84374482b 100644 (file)
@@ -169,7 +169,6 @@ test-xfail-XPG3/limits.h/conform = yes
 test-xfail-XPG3/pwd.h/conform = yes
 test-xfail-XPG3/search.h/conform = yes
 test-xfail-XPG3/signal.h/conform = yes
-test-xfail-XPG3/stdio.h/conform = yes
 test-xfail-XPG3/stdlib.h/conform = yes
 test-xfail-XPG3/string.h/conform = yes
 test-xfail-XPG3/sys/stat.h/conform = yes
@@ -183,7 +182,6 @@ test-xfail-XPG4/fcntl.h/conform = yes
 test-xfail-XPG4/netdb.h/conform = yes
 test-xfail-XPG4/netinet/in.h/conform = yes
 test-xfail-XPG4/signal.h/conform = yes
-test-xfail-XPG4/stdio.h/conform = yes
 test-xfail-XPG4/stdlib.h/conform = yes
 test-xfail-XPG4/sys/stat.h/conform = yes
 test-xfail-XPG4/sys/time.h/conform = yes
index 712b9949e1ebcb3e00cbedbddb81d2643595b452..4511c3cc6975370801ea99a600306e701dfe9fc8 100644 (file)
@@ -544,7 +544,7 @@ __END_NAMESPACE_STD
    optimization for it.  */
 #define getc(_fp) _IO_getc (_fp)
 
-#ifdef __USE_POSIX
+#ifdef __USE_POSIX199506
 /* These are defined in POSIX.1:1996.
 
    These functions are possible cancellation points and therefore not
@@ -596,7 +596,7 @@ __END_NAMESPACE_STD
 extern int fputc_unlocked (int __c, FILE *__stream);
 #endif /* Use MISC.  */
 
-#ifdef __USE_POSIX
+#ifdef __USE_POSIX199506
 /* These are defined in POSIX.1:1996.
 
    These functions are possible cancellation points and therefore not
@@ -907,7 +907,7 @@ extern int obstack_vprintf (struct obstack *__restrict __obstack,
 #endif /* Use GNU.  */
 
 
-#ifdef __USE_POSIX
+#ifdef __USE_POSIX199506
 /* These are defined in POSIX.1:1996.  */
 
 /* Acquire ownership of STREAM.  */