diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2011-07-05 23:44:24 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2011-07-06 00:44:20 -0700 |
commit | cf74a3953bedd79cd53057aa00f1c90019c10102 (patch) | |
tree | 8b9dde6addbefd249f81d67eb78582456ba39e45 /lib/signal.in.h | |
parent | 623de7351499ed8225783a69e441520a15a65a52 (diff) | |
download | gnulib-cf74a3953bedd79cd53057aa00f1c90019c10102.tar.gz |
pthread_sigmask: new module
* MODULES.html.sh (Support for systems lacking POSIX:2008): Add it.
* doc/posix-functions/pthread_sigmask.texi: Document new module.
* lib/signal.in.h (pthread_sigmask): Arrange for replacement.
This is done only as a macro; I don't know how well that'll
work for C++. Move <sys/types.h> include before the include_next,
to avoid mishap on Solaris.
* m4/signal_h.m4 (gl_SIGNAL_H, gl_SIGNAL_H_DEFAULTS): Check for it.
* modules/signal (Makefile.am): Substitute the check's results.
* modules/pthread_sigmask, m4/pthread_sigmask.m4: New files.
Diffstat (limited to 'lib/signal.in.h')
-rw-r--r-- | lib/signal.in.h | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/lib/signal.in.h b/lib/signal.in.h index bcf793523a..01987a7aff 100644 --- a/lib/signal.in.h +++ b/lib/signal.in.h @@ -30,6 +30,12 @@ #ifndef _@GUARD_PREFIX@_SIGNAL_H +/* Define pid_t, uid_t. + Also, mingw defines sigset_t not in <signal.h>, but in <sys/types.h>. + On Solaris 10, <signal.h> includes <sys/types.h>, which eventually includes + us; so include <sys/types.h> now, before the second inclusion guard. */ +#include <sys/types.h> + /* The include_next requires a split double-inclusion guard. */ #@INCLUDE_NEXT@ @NEXT_SIGNAL_H@ @@ -42,10 +48,6 @@ /* The definition of _GL_WARN_ON_USE is copied here. */ -/* Define pid_t, uid_t. - Also, mingw defines sigset_t not in <signal.h>, but in <sys/types.h>. */ -#include <sys/types.h> - /* On AIX, sig_atomic_t already includes volatile. C99 requires that 'volatile sig_atomic_t' ignore the extra modifier, but C89 did not. Hence, redefine this to a non-volatile type as needed. */ @@ -100,6 +102,20 @@ typedef void (*sighandler_t) (int); #endif +#if @GNULIB_PTHREAD_SIGMASK@ +# if @REPLACE_PTHREAD_SIGMASK@ +# undef pthread_sigmask +# define pthread_sigmask sigprocmask +# endif +#elif defined GNULIB_POSIXCHECK +# undef pthread_sigmask +# if HAVE_RAW_DECL_PTHREAD_SIGMASK +_GL_WARN_ON_USE (pthread_sigmask, "pthread_sigmask is not portable - " + "use gnulib module pthread_sigmask for portability"); +# endif +#endif + + #if @GNULIB_SIGPROCMASK@ # if !@HAVE_POSIX_SIGNALBLOCKING@ |