]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Declare pthread_atfork in unistd.h for UNIX98 (bug 20044).
authorJoseph Myers <joseph@codesourcery.com>
Tue, 10 May 2016 14:57:58 +0000 (14:57 +0000)
committerJoseph Myers <joseph@codesourcery.com>
Tue, 10 May 2016 14:57:58 +0000 (14:57 +0000)
For UNIX98 (only), unistd.h should declare pthread_atfork, but that
declaration is missing.  This patch adds it.

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

[BZ #20044]
* posix/unistd.h [__USE_UNIX98 && !__USE_XOPEN2K]
(pthread_atfork): New prototype.
* conform/Makefile (test-xfail-UNIX98/unistd.h/conform): Remove
variable.

ChangeLog
conform/Makefile
posix/unistd.h

index 55319d88488ffdaed1bb43c5aae7d207f98f27dd..93db66fd61444650fd94a983167de885d8cf9e4b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2016-05-10  Joseph Myers  <joseph@codesourcery.com>
 
+       [BZ #20044]
+       * posix/unistd.h [__USE_UNIX98 && !__USE_XOPEN2K]
+       (pthread_atfork): New prototype.
+       * conform/Makefile (test-xfail-UNIX98/unistd.h/conform): Remove
+       variable.
+
        [BZ #20043]
        * posix/unistd.h [__USE_XOPEN && !__USE_XOPEN2K] (cuserid): New
        prototype.
index 32714e74ba2e47819f88d5b7088ee67e124e1e59..c4412ef36fe587e946be700848e2dd0435694825 100644 (file)
@@ -195,7 +195,6 @@ test-xfail-UNIX98/signal.h/conform = yes
 test-xfail-UNIX98/stdlib.h/conform = yes
 test-xfail-UNIX98/sys/wait.h/conform = yes
 test-xfail-UNIX98/ucontext.h/conform = yes
-test-xfail-UNIX98/unistd.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 4722f7fc5c3cf994fed3cfa06fba5620b93ce833..7486ecf4a97f9c7880de3b0208edf817ba2220b2 100644 (file)
@@ -1150,6 +1150,15 @@ extern char *cuserid (char *__s);
 #endif
 
 
+/* Unix98 requires this function to be declared here.  In other
+   standards it is in <pthread.h>.  */
+#if defined __USE_UNIX98 && !defined __USE_XOPEN2K
+extern int pthread_atfork (void (*__prepare) (void),
+                          void (*__parent) (void),
+                          void (*__child) (void)) __THROW;
+#endif
+
+
 /* Define some macros helping to catch buffer overflows.  */
 #if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function
 # include <bits/unistd.h>