* Declare pthread_atfork in unistd.h for UNIX98 (bug 20044)
@ 2016-05-05 15:31 Joseph Myers
2016-05-06 16:30 ` Mike Frysinger
0 siblings, 1 reply; 2+ messages in thread
From: Joseph Myers @ 2016-05-05 15:31 UTC (permalink / raw)
To: libc-alpha
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).
[The conform/Makefile XFAIL removal depends on
<https://sourceware.org/ml/libc-alpha/2016-05/msg00054.html> (pending
review) also being applied.]
2016-05-05 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.
diff --git a/conform/Makefile b/conform/Makefile
index d5273c1..a8f3af8 100644
--- a/conform/Makefile
+++ b/conform/Makefile
@@ -197,7 +197,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
diff --git a/posix/unistd.h b/posix/unistd.h
index 4722f7f..7486ecf 100644
--- a/posix/unistd.h
+++ b/posix/unistd.h
@@ -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>
--
Joseph S. Myers
joseph@codesourcery.com
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Declare pthread_atfork in unistd.h for UNIX98 (bug 20044)
2016-05-05 15:31 Declare pthread_atfork in unistd.h for UNIX98 (bug 20044) Joseph Myers
@ 2016-05-06 16:30 ` Mike Frysinger
0 siblings, 0 replies; 2+ messages in thread
From: Mike Frysinger @ 2016-05-06 16:30 UTC (permalink / raw)
To: Joseph Myers; +Cc: libc-alpha
[-- Attachment #1: Type: text/plain, Size: 169 bytes --]
On 05 May 2016 15:30, Joseph Myers wrote:
> For UNIX98 (only), unistd.h should declare pthread_atfork, but that
> declaration is missing. This patch adds it.
OK
-mike
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-05-06 16:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-05 15:31 Declare pthread_atfork in unistd.h for UNIX98 (bug 20044) Joseph Myers
2016-05-06 16:30 ` Mike Frysinger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).