From 085e07db22e5bb6c898cd686c0ae3e7cd4ab17f2 Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Fri, 28 Apr 2017 16:52:16 +0000 Subject: [PATCH] conformtest: Allow time.h inclusion from semaphore.h for XOPEN2K. POSIX.1:2001 added sem_timedwait, but said nothing about defining struct timespec in semaphore.h. The 2008 edition added a corresponding permission to include from . Since this is the normal POSIX approach in such cases, it seems appropriate to consider this a bug fix, and so this patch makes the conform/ tests allow that inclusion for POSIX.1:2001 as well. Tested for x86_64. * conform/data/semaphore.h-data [XOPEN2K] (time.h): Allow header inclusion. * conform/Makefile (test-xfail-XOPEN2K/semaphore.h/conform): Remove. --- ChangeLog | 7 +++++++ conform/Makefile | 1 - conform/data/semaphore.h-data | 4 +++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9ba5a94ba1..5bb80d7e68 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2017-04-28 Joseph Myers + + * conform/data/semaphore.h-data [XOPEN2K] (time.h): Allow header + inclusion. + * conform/Makefile (test-xfail-XOPEN2K/semaphore.h/conform): + Remove. + 2017-04-27 Joseph Myers * conform/GlibcConform.pm (XPG4): Rename standard to XPG42. diff --git a/conform/Makefile b/conform/Makefile index 1f38b306ae..2039ae8df7 100644 --- a/conform/Makefile +++ b/conform/Makefile @@ -176,7 +176,6 @@ test-xfail-UNIX98/netinet/in.h/conform = yes test-xfail-UNIX98/signal.h/conform = yes test-xfail-UNIX98/sys/wait.h/conform = yes test-xfail-UNIX98/ucontext.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 test-xfail-XOPEN2K/ucontext.h/conform = yes diff --git a/conform/data/semaphore.h-data b/conform/data/semaphore.h-data index 7c26cd3fd6..066c2f721b 100644 --- a/conform/data/semaphore.h-data +++ b/conform/data/semaphore.h-data @@ -20,7 +20,9 @@ allow-header fcntl.h # if !defined POSIX2008 && !defined XOPEN2K8 allow-header sys/types.h # endif -# if !defined POSIX && !defined UNIX98 && !defined XOPEN2K +// Consider addition of this permission in POSIX.1:2008 as a bug fix, +// so allow for POSIX.1:2001 as well since that includes sem_timedwait. +# if !defined POSIX && !defined UNIX98 allow-header time.h # endif