]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Fix fcntl.h timespec namespace (bug 20023).
authorJoseph Myers <joseph@codesourcery.com>
Mon, 2 May 2016 23:20:33 +0000 (23:20 +0000)
committerJoseph Myers <joseph@codesourcery.com>
Mon, 2 May 2016 23:20:33 +0000 (23:20 +0000)
fcntl.h defines struct timespec if __USE_XOPEN || __USE_XOPEN2K8.  But
(a) the subsequent bits/stat.h include only needs it if __USE_XOPEN2K8
and (b) older standards did not allow struct timespec here.  (It's
allowed for newer standards by virtue of the permission to include
symbols from sys/stat.h.  But sys/stat.h is only required to provide
struct timespec from the 2008 edition of POSIX onwards, and permitted
by the 2004 TC to the 2001 edition in anticipation of the addition of
nanosecond timestamp support to struct stat in the 2008 edition.)

This patch limits the timespec definition to the __USE_XOPEN2K8 case,
that being the only case where it is actually needed for the
<bits/stat.h> include.

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

[BZ #20023]
* io/fcntl.h [__USE_XOPEN && !__USE_XOPEN2K8]: Do not include
<time.h>.
* conform/Makefile (test-xfail-UNIX98/fcntl.h/conform): Remove
variable.
(test-xfail-XOPEN2K/fcntl.h/conform): Likewise.

ChangeLog
conform/Makefile
io/fcntl.h

index 26284bdc43826fb4e4d6d90b10c8f5bdc820426a..a551f7086af48e775154e603c9875e8681e2442f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2016-05-02  Joseph Myers  <joseph@codesourcery.com>
+
+       [BZ #20023]
+       * io/fcntl.h [__USE_XOPEN && !__USE_XOPEN2K8]: Do not include
+       <time.h>.
+       * conform/Makefile (test-xfail-UNIX98/fcntl.h/conform): Remove
+       variable.
+       (test-xfail-XOPEN2K/fcntl.h/conform): Likewise.
+
 2016-05-02  Adhemerval Zanella  <adhemerval.zanella@linaro.org>
 
        * sysdeps/unix/sysv/linux/powerpc/powerpc32/clone.S (__clone): Fix
index f2aa1771b6116e3aa64083562b8787c84374482b..55cada5e13c7b5898487f5d6cb7b79be15902263 100644 (file)
@@ -193,7 +193,6 @@ test-xfail-XPG4/unistd.h/conform = yes
 test-xfail-XPG4/utmpx.h/conform = yes
 test-xfail-POSIX/sys/wait.h/conform = yes
 test-xfail-UNIX98/arpa/inet.h/conform = yes
-test-xfail-UNIX98/fcntl.h/conform = yes
 test-xfail-UNIX98/netdb.h/conform = yes
 test-xfail-UNIX98/netinet/in.h/conform = yes
 test-xfail-UNIX98/signal.h/conform = yes
@@ -203,7 +202,6 @@ test-xfail-UNIX98/sys/wait.h/conform = yes
 test-xfail-UNIX98/ucontext.h/conform = yes
 test-xfail-UNIX98/unistd.h/conform = yes
 test-xfail-UNIX98/utmpx.h/conform = yes
-test-xfail-XOPEN2K/fcntl.h/conform = yes
 test-xfail-XOPEN2K/semaphore.h/conform = yes
 test-xfail-XOPEN2K/signal.h/conform = yes
 test-xfail-XOPEN2K/sys/wait.h/conform = yes
index 1a92a8d7382902c6fa2d4af00d843a1f6412c9b2..cb706b4f0f7f75e3bc244a97833c5959448a47fa 100644 (file)
@@ -71,9 +71,11 @@ typedef __pid_t pid_t;
 #endif
 
 /* For XPG all symbols from <sys/stat.h> should also be available.  */
-#if defined __USE_XOPEN || defined __USE_XOPEN2K8
+#ifdef __USE_XOPEN2K8
 # define __need_timespec
 # include <time.h>
+#endif
+#if defined __USE_XOPEN || defined __USE_XOPEN2K8
 # include <bits/stat.h>
 
 # define S_IFMT                __S_IFMT