Mercurial > gnulib
changeset 39244:aa3cd60dc529
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.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Sat, 17 Feb 2018 09:55:43 +0100 |
parents | 6828f5d6f32d |
children | f6cb783d3822 |
files | ChangeLog doc/posix-headers/pthread.texi lib/glthread/thread.h |
diffstat | 3 files changed, 23 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog Sun Feb 04 11:00:38 2018 +0100 +++ b/ChangeLog Sat Feb 17 09:55:43 2018 +0100 @@ -1,3 +1,11 @@ +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.
--- a/doc/posix-headers/pthread.texi Sun Feb 04 11:00:38 2018 +0100 +++ b/doc/posix-headers/pthread.texi Sat Feb 17 09:55:43 2018 +0100 @@ -21,4 +21,8 @@ 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
--- a/lib/glthread/thread.h Sun Feb 04 11:00:38 2018 +0100 +++ b/lib/glthread/thread.h Sat Feb 17 09:55:43 2018 +0100 @@ -90,6 +90,17 @@ # 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 @@ -124,10 +135,6 @@ # 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