+2018-02-17 Bruno Haible <bruno@clisp.org>
+
+ thread: Fix compilation error on IRIX.
+ * lib/glthread/thread.h: Include <unistd.h>. Include <signal.h> when
+ needed; include it outside the C++ extern "C" {} block.
+ * doc/posix-headers/pthread.texi: Mention the problem with
+ pthread_atfork on IRIX.
+
2018-02-04 Bruno Haible <bruno@clisp.org>
nl_langinfo: Override the system's nl_langinfo() when needed.
not offer threads, so much as lightweight stubs that make conditional
compilation easier for fallbacks to single-threaded programs.
Minix 3.1.8, mingw 2.x, MSVC 14, BeOS.
+@item
+This header file lacks the declaration of @code{pthread_atfork} on some
+platforms:
+IRIX 6.5.
@end itemize
# include <pthread.h>
+/* On IRIX, pthread_atfork is declared in <unistd.h>, not in <pthread.h>. */
+# if defined __sgi
+# include <unistd.h>
+# endif
+
+# if USE_POSIX_THREADS_WEAK
+/* Compilers other than GCC need to see the declaration of pthread_sigmask
+ before the "#pragma weak pthread_sigmask" below. */
+# include <signal.h>
+# endif
+
# ifdef __cplusplus
extern "C" {
# endif
# pragma weak pthread_create
-# ifdef __clang__
- /* Without this, clang complains that pthread_sigmask is never declared. */
-# include <signal.h>
-# endif
# ifndef pthread_sigmask /* Do not declare rpl_pthread_sigmask weak. */
# pragma weak pthread_sigmask
# endif