diff options
author | Joseph Myers <joseph@codesourcery.com> | 2016-04-28 22:01:04 +0000 |
---|---|---|
committer | Joseph Myers <joseph@codesourcery.com> | 2016-04-28 22:01:04 +0000 |
commit | a7657f3012765b9c2d80c7387d487fc5156d3bc2 (patch) | |
tree | 7539c948fc051687164f87bd62388afa12316b8a /libio/stdio.h | |
parent | conformtest: Add langinfo.h expectations for YESSTR, NOSTR. (diff) | |
download | glibc-a7657f3012765b9c2d80c7387d487fc5156d3bc2.tar.gz glibc-a7657f3012765b9c2d80c7387d487fc5156d3bc2.tar.bz2 glibc-a7657f3012765b9c2d80c7387d487fc5156d3bc2.zip |
Fix stdio.h namespace for pre-threads POSIX (bug 20014).
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.
Diffstat (limited to 'libio/stdio.h')
-rw-r--r-- | libio/stdio.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libio/stdio.h b/libio/stdio.h index 712b9949e1..4511c3cc69 100644 --- a/libio/stdio.h +++ b/libio/stdio.h @@ -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. */ |