Mercurial > hg > octave-lojdl > gnulib-hg
annotate lib/signal.in.h @ 15369:ff0056fd6295
pthread_sigmask: Ensure declaration in <signal.h> also on Solaris 2.6.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Fri, 08 Jul 2011 03:38:33 +0200 |
parents | 6f48a9a9a38e |
children | 54bbcd9bb255 |
rev | line source |
---|---|
9259
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1 /* A GNU-like <signal.h>. |
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
2 |
14079
97fc9a21a8fb
maint: update almost all copyright ranges to include 2011
Jim Meyering <meyering@redhat.com>
parents:
14007
diff
changeset
|
3 Copyright (C) 2006-2011 Free Software Foundation, Inc. |
9259
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4 |
9309
bbbbbf4cd1c5
Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents:
9259
diff
changeset
|
5 This program is free software: you can redistribute it and/or modify |
9259
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6 it under the terms of the GNU General Public License as published by |
9309
bbbbbf4cd1c5
Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents:
9259
diff
changeset
|
7 the Free Software Foundation; either version 3 of the License, or |
bbbbbf4cd1c5
Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents:
9259
diff
changeset
|
8 (at your option) any later version. |
9259
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
9 |
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
10 This program is distributed in the hope that it will be useful, |
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
11 but WITHOUT ANY WARRANTY; without even the implied warranty of |
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
13 GNU General Public License for more details. |
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
14 |
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
15 You should have received a copy of the GNU General Public License |
9309
bbbbbf4cd1c5
Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents:
9259
diff
changeset
|
16 along with this program. If not, see <http://www.gnu.org/licenses/>. */ |
9259
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
17 |
10655
8668b19a7032
Avoid gcc warnings because of #pragma GCC system_header on older gcc.
Bruno Haible <bruno@clisp.org>
parents:
10483
diff
changeset
|
18 #if __GNUC__ >= 3 |
10375
f96e845fc36d
Avoid some "gcc -pedantic" warnings.
Bruno Haible <bruno@clisp.org>
parents:
10321
diff
changeset
|
19 @PRAGMA_SYSTEM_HEADER@ |
10655
8668b19a7032
Avoid gcc warnings because of #pragma GCC system_header on older gcc.
Bruno Haible <bruno@clisp.org>
parents:
10483
diff
changeset
|
20 #endif |
13761
a19ace3ba849
Avoid line length limitation from HP NonStop system header files.
Bruno Haible <bruno@clisp.org>
parents:
13022
diff
changeset
|
21 @PRAGMA_COLUMNS@ |
10375
f96e845fc36d
Avoid some "gcc -pedantic" warnings.
Bruno Haible <bruno@clisp.org>
parents:
10321
diff
changeset
|
22 |
15365
8e2f1d4b9199
pthread_sigmask: Make declaration C++ safe.
Bruno Haible <bruno@clisp.org>
parents:
15364
diff
changeset
|
23 #if defined __need_sig_atomic_t || defined __need_sigset_t || defined _GL_ALREADY_INCLUDING_SIGNAL_H || (defined _SIGNAL_H && !defined __SIZEOF_PTHREAD_MUTEX_T) |
8e2f1d4b9199
pthread_sigmask: Make declaration C++ safe.
Bruno Haible <bruno@clisp.org>
parents:
15364
diff
changeset
|
24 /* Special invocation convention: |
8e2f1d4b9199
pthread_sigmask: Make declaration C++ safe.
Bruno Haible <bruno@clisp.org>
parents:
15364
diff
changeset
|
25 - Inside glibc header files. |
8e2f1d4b9199
pthread_sigmask: Make declaration C++ safe.
Bruno Haible <bruno@clisp.org>
parents:
15364
diff
changeset
|
26 - On glibc systems we have a sequence of nested includes |
8e2f1d4b9199
pthread_sigmask: Make declaration C++ safe.
Bruno Haible <bruno@clisp.org>
parents:
15364
diff
changeset
|
27 <signal.h> -> <ucontext.h> -> <signal.h>. |
8e2f1d4b9199
pthread_sigmask: Make declaration C++ safe.
Bruno Haible <bruno@clisp.org>
parents:
15364
diff
changeset
|
28 In this situation, the functions are not yet declared, therefore we cannot |
8e2f1d4b9199
pthread_sigmask: Make declaration C++ safe.
Bruno Haible <bruno@clisp.org>
parents:
15364
diff
changeset
|
29 provide the C++ aliases. |
8e2f1d4b9199
pthread_sigmask: Make declaration C++ safe.
Bruno Haible <bruno@clisp.org>
parents:
15364
diff
changeset
|
30 - On glibc systems with GCC 4.3 we have a sequence of nested includes |
8e2f1d4b9199
pthread_sigmask: Make declaration C++ safe.
Bruno Haible <bruno@clisp.org>
parents:
15364
diff
changeset
|
31 <csignal> -> </usr/include/signal.h> -> <sys/ucontext.h> -> <signal.h>. |
8e2f1d4b9199
pthread_sigmask: Make declaration C++ safe.
Bruno Haible <bruno@clisp.org>
parents:
15364
diff
changeset
|
32 In this situation, some of the functions are not yet declared, therefore |
8e2f1d4b9199
pthread_sigmask: Make declaration C++ safe.
Bruno Haible <bruno@clisp.org>
parents:
15364
diff
changeset
|
33 we cannot provide the C++ aliases. */ |
9259
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
34 |
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
35 # @INCLUDE_NEXT@ @NEXT_SIGNAL_H@ |
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
36 |
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
37 #else |
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
38 /* Normal invocation convention. */ |
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
39 |
14840
5f709022a256
Allow multiple gnulib generated include files to be combined.
Bruno Haible <bruno@clisp.org>
parents:
14686
diff
changeset
|
40 #ifndef _@GUARD_PREFIX@_SIGNAL_H |
9259
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
41 |
15365
8e2f1d4b9199
pthread_sigmask: Make declaration C++ safe.
Bruno Haible <bruno@clisp.org>
parents:
15364
diff
changeset
|
42 #define _GL_ALREADY_INCLUDING_SIGNAL_H |
8e2f1d4b9199
pthread_sigmask: Make declaration C++ safe.
Bruno Haible <bruno@clisp.org>
parents:
15364
diff
changeset
|
43 |
15343
107f8443e77a
pthread_sigmask: new module
Paul Eggert <eggert@cs.ucla.edu>
parents:
14840
diff
changeset
|
44 /* Define pid_t, uid_t. |
107f8443e77a
pthread_sigmask: new module
Paul Eggert <eggert@cs.ucla.edu>
parents:
14840
diff
changeset
|
45 Also, mingw defines sigset_t not in <signal.h>, but in <sys/types.h>. |
107f8443e77a
pthread_sigmask: new module
Paul Eggert <eggert@cs.ucla.edu>
parents:
14840
diff
changeset
|
46 On Solaris 10, <signal.h> includes <sys/types.h>, which eventually includes |
107f8443e77a
pthread_sigmask: new module
Paul Eggert <eggert@cs.ucla.edu>
parents:
14840
diff
changeset
|
47 us; so include <sys/types.h> now, before the second inclusion guard. */ |
107f8443e77a
pthread_sigmask: new module
Paul Eggert <eggert@cs.ucla.edu>
parents:
14840
diff
changeset
|
48 #include <sys/types.h> |
107f8443e77a
pthread_sigmask: new module
Paul Eggert <eggert@cs.ucla.edu>
parents:
14840
diff
changeset
|
49 |
9259
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
50 /* The include_next requires a split double-inclusion guard. */ |
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
51 #@INCLUDE_NEXT@ @NEXT_SIGNAL_H@ |
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
52 |
15365
8e2f1d4b9199
pthread_sigmask: Make declaration C++ safe.
Bruno Haible <bruno@clisp.org>
parents:
15364
diff
changeset
|
53 #undef _GL_ALREADY_INCLUDING_SIGNAL_H |
8e2f1d4b9199
pthread_sigmask: Make declaration C++ safe.
Bruno Haible <bruno@clisp.org>
parents:
15364
diff
changeset
|
54 |
14840
5f709022a256
Allow multiple gnulib generated include files to be combined.
Bruno Haible <bruno@clisp.org>
parents:
14686
diff
changeset
|
55 #ifndef _@GUARD_PREFIX@_SIGNAL_H |
5f709022a256
Allow multiple gnulib generated include files to be combined.
Bruno Haible <bruno@clisp.org>
parents:
14686
diff
changeset
|
56 #define _@GUARD_PREFIX@_SIGNAL_H |
9259
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
57 |
15369
ff0056fd6295
pthread_sigmask: Ensure declaration in <signal.h> also on Solaris 2.6.
Bruno Haible <bruno@clisp.org>
parents:
15368
diff
changeset
|
58 /* MacOS X 10.3, FreeBSD 6.4, OpenBSD 3.8, OSF/1 4.0, Solaris 2.6 declare |
ff0056fd6295
pthread_sigmask: Ensure declaration in <signal.h> also on Solaris 2.6.
Bruno Haible <bruno@clisp.org>
parents:
15368
diff
changeset
|
59 pthread_sigmask in <pthread.h>, not in <signal.h>. |
15368
6f48a9a9a38e
pthread_sigmask: Ensure declaration in <signal.h>.
Bruno Haible <bruno@clisp.org>
parents:
15365
diff
changeset
|
60 But avoid namespace pollution on glibc systems.*/ |
6f48a9a9a38e
pthread_sigmask: Ensure declaration in <signal.h>.
Bruno Haible <bruno@clisp.org>
parents:
15365
diff
changeset
|
61 #if (@GNULIB_PTHREAD_SIGMASK@ || defined GNULIB_POSIXCHECK) \ |
15369
ff0056fd6295
pthread_sigmask: Ensure declaration in <signal.h> also on Solaris 2.6.
Bruno Haible <bruno@clisp.org>
parents:
15368
diff
changeset
|
62 && ((defined __APPLE__ && defined __MACH__) || defined __FreeBSD__ || defined __OpenBSD__ || defined __osf__ || defined __sun) \ |
15368
6f48a9a9a38e
pthread_sigmask: Ensure declaration in <signal.h>.
Bruno Haible <bruno@clisp.org>
parents:
15365
diff
changeset
|
63 && ! defined __GLIBC__ |
6f48a9a9a38e
pthread_sigmask: Ensure declaration in <signal.h>.
Bruno Haible <bruno@clisp.org>
parents:
15365
diff
changeset
|
64 # include <pthread.h> |
6f48a9a9a38e
pthread_sigmask: Ensure declaration in <signal.h>.
Bruno Haible <bruno@clisp.org>
parents:
15365
diff
changeset
|
65 #endif |
6f48a9a9a38e
pthread_sigmask: Ensure declaration in <signal.h>.
Bruno Haible <bruno@clisp.org>
parents:
15365
diff
changeset
|
66 |
12938
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
67 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
68 |
12766
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
69 /* The definition of _GL_ARG_NONNULL is copied here. */ |
9259
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
70 |
12766
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
71 /* The definition of _GL_WARN_ON_USE is copied here. */ |
12422
f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
11424
diff
changeset
|
72 |
11424
2b94c0e7849d
signal.h: always support 'volatile sig_atomic_t'
Eric Blake <ebb9@byu.net>
parents:
10706
diff
changeset
|
73 /* On AIX, sig_atomic_t already includes volatile. C99 requires that |
2b94c0e7849d
signal.h: always support 'volatile sig_atomic_t'
Eric Blake <ebb9@byu.net>
parents:
10706
diff
changeset
|
74 'volatile sig_atomic_t' ignore the extra modifier, but C89 did not. |
2b94c0e7849d
signal.h: always support 'volatile sig_atomic_t'
Eric Blake <ebb9@byu.net>
parents:
10706
diff
changeset
|
75 Hence, redefine this to a non-volatile type as needed. */ |
2b94c0e7849d
signal.h: always support 'volatile sig_atomic_t'
Eric Blake <ebb9@byu.net>
parents:
10706
diff
changeset
|
76 #if ! @HAVE_TYPE_VOLATILE_SIG_ATOMIC_T@ |
14274
da5595160b9f
Allow multiple gnulib generated replacements to coexist.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
77 # if !GNULIB_defined_sig_atomic_t |
11424
2b94c0e7849d
signal.h: always support 'volatile sig_atomic_t'
Eric Blake <ebb9@byu.net>
parents:
10706
diff
changeset
|
78 typedef int rpl_sig_atomic_t; |
14274
da5595160b9f
Allow multiple gnulib generated replacements to coexist.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
79 # undef sig_atomic_t |
da5595160b9f
Allow multiple gnulib generated replacements to coexist.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
80 # define sig_atomic_t rpl_sig_atomic_t |
da5595160b9f
Allow multiple gnulib generated replacements to coexist.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
81 # define GNULIB_defined_sig_atomic_t 1 |
da5595160b9f
Allow multiple gnulib generated replacements to coexist.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
82 # endif |
11424
2b94c0e7849d
signal.h: always support 'volatile sig_atomic_t'
Eric Blake <ebb9@byu.net>
parents:
10706
diff
changeset
|
83 #endif |
2b94c0e7849d
signal.h: always support 'volatile sig_atomic_t'
Eric Blake <ebb9@byu.net>
parents:
10706
diff
changeset
|
84 |
12535
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
85 /* A set or mask of signals. */ |
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
86 #if !@HAVE_SIGSET_T@ |
14274
da5595160b9f
Allow multiple gnulib generated replacements to coexist.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
87 # if !GNULIB_defined_sigset_t |
12535
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
88 typedef unsigned int sigset_t; |
14274
da5595160b9f
Allow multiple gnulib generated replacements to coexist.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
89 # define GNULIB_defined_sigset_t 1 |
da5595160b9f
Allow multiple gnulib generated replacements to coexist.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
90 # endif |
12535
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
91 #endif |
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
92 |
14686
e753ffb0501f
signal: Define sighandler_t.
Bruno Haible <bruno@clisp.org>
parents:
14274
diff
changeset
|
93 /* Define sighandler_t, the type of signal handlers. A GNU extension. */ |
e753ffb0501f
signal: Define sighandler_t.
Bruno Haible <bruno@clisp.org>
parents:
14274
diff
changeset
|
94 #if !@HAVE_SIGHANDLER_T@ |
e753ffb0501f
signal: Define sighandler_t.
Bruno Haible <bruno@clisp.org>
parents:
14274
diff
changeset
|
95 # ifdef __cplusplus |
e753ffb0501f
signal: Define sighandler_t.
Bruno Haible <bruno@clisp.org>
parents:
14274
diff
changeset
|
96 extern "C" { |
e753ffb0501f
signal: Define sighandler_t.
Bruno Haible <bruno@clisp.org>
parents:
14274
diff
changeset
|
97 # endif |
e753ffb0501f
signal: Define sighandler_t.
Bruno Haible <bruno@clisp.org>
parents:
14274
diff
changeset
|
98 # if !GNULIB_defined_sighandler_t |
e753ffb0501f
signal: Define sighandler_t.
Bruno Haible <bruno@clisp.org>
parents:
14274
diff
changeset
|
99 typedef void (*sighandler_t) (int); |
e753ffb0501f
signal: Define sighandler_t.
Bruno Haible <bruno@clisp.org>
parents:
14274
diff
changeset
|
100 # define GNULIB_defined_sighandler_t 1 |
e753ffb0501f
signal: Define sighandler_t.
Bruno Haible <bruno@clisp.org>
parents:
14274
diff
changeset
|
101 # endif |
e753ffb0501f
signal: Define sighandler_t.
Bruno Haible <bruno@clisp.org>
parents:
14274
diff
changeset
|
102 # ifdef __cplusplus |
e753ffb0501f
signal: Define sighandler_t.
Bruno Haible <bruno@clisp.org>
parents:
14274
diff
changeset
|
103 } |
e753ffb0501f
signal: Define sighandler_t.
Bruno Haible <bruno@clisp.org>
parents:
14274
diff
changeset
|
104 # endif |
e753ffb0501f
signal: Define sighandler_t.
Bruno Haible <bruno@clisp.org>
parents:
14274
diff
changeset
|
105 #endif |
e753ffb0501f
signal: Define sighandler_t.
Bruno Haible <bruno@clisp.org>
parents:
14274
diff
changeset
|
106 |
9259
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
107 |
10483
5a24031ebf7d
Support signal handling with SIGPIPE on native Windows platforms.
Bruno Haible <bruno@clisp.org>
parents:
10375
diff
changeset
|
108 #if @GNULIB_SIGNAL_H_SIGPIPE@ |
5a24031ebf7d
Support signal handling with SIGPIPE on native Windows platforms.
Bruno Haible <bruno@clisp.org>
parents:
10375
diff
changeset
|
109 # ifndef SIGPIPE |
5a24031ebf7d
Support signal handling with SIGPIPE on native Windows platforms.
Bruno Haible <bruno@clisp.org>
parents:
10375
diff
changeset
|
110 /* Define SIGPIPE to a value that does not overlap with other signals. */ |
5a24031ebf7d
Support signal handling with SIGPIPE on native Windows platforms.
Bruno Haible <bruno@clisp.org>
parents:
10375
diff
changeset
|
111 # define SIGPIPE 13 |
5a24031ebf7d
Support signal handling with SIGPIPE on native Windows platforms.
Bruno Haible <bruno@clisp.org>
parents:
10375
diff
changeset
|
112 # define GNULIB_defined_SIGPIPE 1 |
5a24031ebf7d
Support signal handling with SIGPIPE on native Windows platforms.
Bruno Haible <bruno@clisp.org>
parents:
10375
diff
changeset
|
113 /* To actually use SIGPIPE, you also need the gnulib modules 'sigprocmask', |
5a24031ebf7d
Support signal handling with SIGPIPE on native Windows platforms.
Bruno Haible <bruno@clisp.org>
parents:
10375
diff
changeset
|
114 'write', 'stdio'. */ |
5a24031ebf7d
Support signal handling with SIGPIPE on native Windows platforms.
Bruno Haible <bruno@clisp.org>
parents:
10375
diff
changeset
|
115 # endif |
5a24031ebf7d
Support signal handling with SIGPIPE on native Windows platforms.
Bruno Haible <bruno@clisp.org>
parents:
10375
diff
changeset
|
116 #endif |
5a24031ebf7d
Support signal handling with SIGPIPE on native Windows platforms.
Bruno Haible <bruno@clisp.org>
parents:
10375
diff
changeset
|
117 |
5a24031ebf7d
Support signal handling with SIGPIPE on native Windows platforms.
Bruno Haible <bruno@clisp.org>
parents:
10375
diff
changeset
|
118 |
14007 | 119 /* Maximum signal number + 1. */ |
120 #ifndef NSIG | |
121 # if defined __TANDEM | |
122 # define NSIG 32 | |
123 # endif | |
124 #endif | |
125 | |
126 | |
15343
107f8443e77a
pthread_sigmask: new module
Paul Eggert <eggert@cs.ucla.edu>
parents:
14840
diff
changeset
|
127 #if @GNULIB_PTHREAD_SIGMASK@ |
15365
8e2f1d4b9199
pthread_sigmask: Make declaration C++ safe.
Bruno Haible <bruno@clisp.org>
parents:
15364
diff
changeset
|
128 # if !@HAVE_PTHREAD_SIGMASK@ |
15364
f81fb597c41a
pthread_sigmask: Fix return value.
Bruno Haible <bruno@clisp.org>
parents:
15343
diff
changeset
|
129 _GL_FUNCDECL_SYS (pthread_sigmask, int, |
f81fb597c41a
pthread_sigmask: Fix return value.
Bruno Haible <bruno@clisp.org>
parents:
15343
diff
changeset
|
130 (int how, const sigset_t *new_mask, sigset_t *old_mask)); |
15343
107f8443e77a
pthread_sigmask: new module
Paul Eggert <eggert@cs.ucla.edu>
parents:
14840
diff
changeset
|
131 # endif |
15365
8e2f1d4b9199
pthread_sigmask: Make declaration C++ safe.
Bruno Haible <bruno@clisp.org>
parents:
15364
diff
changeset
|
132 _GL_CXXALIAS_SYS (pthread_sigmask, int, |
8e2f1d4b9199
pthread_sigmask: Make declaration C++ safe.
Bruno Haible <bruno@clisp.org>
parents:
15364
diff
changeset
|
133 (int how, const sigset_t *new_mask, sigset_t *old_mask)); |
8e2f1d4b9199
pthread_sigmask: Make declaration C++ safe.
Bruno Haible <bruno@clisp.org>
parents:
15364
diff
changeset
|
134 _GL_CXXALIASWARN (pthread_sigmask); |
15343
107f8443e77a
pthread_sigmask: new module
Paul Eggert <eggert@cs.ucla.edu>
parents:
14840
diff
changeset
|
135 #elif defined GNULIB_POSIXCHECK |
107f8443e77a
pthread_sigmask: new module
Paul Eggert <eggert@cs.ucla.edu>
parents:
14840
diff
changeset
|
136 # undef pthread_sigmask |
107f8443e77a
pthread_sigmask: new module
Paul Eggert <eggert@cs.ucla.edu>
parents:
14840
diff
changeset
|
137 # if HAVE_RAW_DECL_PTHREAD_SIGMASK |
107f8443e77a
pthread_sigmask: new module
Paul Eggert <eggert@cs.ucla.edu>
parents:
14840
diff
changeset
|
138 _GL_WARN_ON_USE (pthread_sigmask, "pthread_sigmask is not portable - " |
107f8443e77a
pthread_sigmask: new module
Paul Eggert <eggert@cs.ucla.edu>
parents:
14840
diff
changeset
|
139 "use gnulib module pthread_sigmask for portability"); |
107f8443e77a
pthread_sigmask: new module
Paul Eggert <eggert@cs.ucla.edu>
parents:
14840
diff
changeset
|
140 # endif |
107f8443e77a
pthread_sigmask: new module
Paul Eggert <eggert@cs.ucla.edu>
parents:
14840
diff
changeset
|
141 #endif |
107f8443e77a
pthread_sigmask: new module
Paul Eggert <eggert@cs.ucla.edu>
parents:
14840
diff
changeset
|
142 |
107f8443e77a
pthread_sigmask: new module
Paul Eggert <eggert@cs.ucla.edu>
parents:
14840
diff
changeset
|
143 |
12535
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
144 #if @GNULIB_SIGPROCMASK@ |
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
145 # if !@HAVE_POSIX_SIGNALBLOCKING@ |
9259
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
146 |
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
147 /* Maximum signal number + 1. */ |
12535
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
148 # ifndef NSIG |
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
149 # define NSIG 32 |
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
150 # endif |
9259
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
151 |
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
152 /* This code supports only 32 signals. */ |
14274
da5595160b9f
Allow multiple gnulib generated replacements to coexist.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
153 # if !GNULIB_defined_verify_NSIG_constraint |
13787
f4b0b520e409
prefer (X ? 1 : -1) when converting from boolean (1,0) to int (1,-1)
Paul Eggert <eggert@cs.ucla.edu>
parents:
13761
diff
changeset
|
154 typedef int verify_NSIG_constraint[NSIG <= 32 ? 1 : -1]; |
14274
da5595160b9f
Allow multiple gnulib generated replacements to coexist.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
155 # define GNULIB_defined_verify_NSIG_constraint 1 |
da5595160b9f
Allow multiple gnulib generated replacements to coexist.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
156 # endif |
9259
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
157 |
12938
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
158 # endif |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
159 |
9259
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
160 /* Test whether a given signal is contained in a signal set. */ |
13022
63c614c3b5e9
signal: Undefine macro definitions in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12938
diff
changeset
|
161 # if @HAVE_POSIX_SIGNALBLOCKING@ |
63c614c3b5e9
signal: Undefine macro definitions in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12938
diff
changeset
|
162 /* This function is defined as a macro on MacOS X. */ |
63c614c3b5e9
signal: Undefine macro definitions in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12938
diff
changeset
|
163 # if defined __cplusplus && defined GNULIB_NAMESPACE |
63c614c3b5e9
signal: Undefine macro definitions in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12938
diff
changeset
|
164 # undef sigismember |
63c614c3b5e9
signal: Undefine macro definitions in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12938
diff
changeset
|
165 # endif |
63c614c3b5e9
signal: Undefine macro definitions in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12938
diff
changeset
|
166 # else |
12938
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
167 _GL_FUNCDECL_SYS (sigismember, int, (const sigset_t *set, int sig) |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
168 _GL_ARG_NONNULL ((1))); |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
169 # endif |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
170 _GL_CXXALIAS_SYS (sigismember, int, (const sigset_t *set, int sig)); |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
171 _GL_CXXALIASWARN (sigismember); |
9259
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
172 |
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
173 /* Initialize a signal set to the empty set. */ |
13022
63c614c3b5e9
signal: Undefine macro definitions in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12938
diff
changeset
|
174 # if @HAVE_POSIX_SIGNALBLOCKING@ |
63c614c3b5e9
signal: Undefine macro definitions in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12938
diff
changeset
|
175 /* This function is defined as a macro on MacOS X. */ |
63c614c3b5e9
signal: Undefine macro definitions in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12938
diff
changeset
|
176 # if defined __cplusplus && defined GNULIB_NAMESPACE |
63c614c3b5e9
signal: Undefine macro definitions in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12938
diff
changeset
|
177 # undef sigemptyset |
63c614c3b5e9
signal: Undefine macro definitions in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12938
diff
changeset
|
178 # endif |
63c614c3b5e9
signal: Undefine macro definitions in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12938
diff
changeset
|
179 # else |
12938
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
180 _GL_FUNCDECL_SYS (sigemptyset, int, (sigset_t *set) _GL_ARG_NONNULL ((1))); |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
181 # endif |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
182 _GL_CXXALIAS_SYS (sigemptyset, int, (sigset_t *set)); |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
183 _GL_CXXALIASWARN (sigemptyset); |
9259
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
184 |
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
185 /* Add a signal to a signal set. */ |
13022
63c614c3b5e9
signal: Undefine macro definitions in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12938
diff
changeset
|
186 # if @HAVE_POSIX_SIGNALBLOCKING@ |
63c614c3b5e9
signal: Undefine macro definitions in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12938
diff
changeset
|
187 /* This function is defined as a macro on MacOS X. */ |
63c614c3b5e9
signal: Undefine macro definitions in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12938
diff
changeset
|
188 # if defined __cplusplus && defined GNULIB_NAMESPACE |
63c614c3b5e9
signal: Undefine macro definitions in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12938
diff
changeset
|
189 # undef sigaddset |
63c614c3b5e9
signal: Undefine macro definitions in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12938
diff
changeset
|
190 # endif |
63c614c3b5e9
signal: Undefine macro definitions in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12938
diff
changeset
|
191 # else |
12938
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
192 _GL_FUNCDECL_SYS (sigaddset, int, (sigset_t *set, int sig) |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
193 _GL_ARG_NONNULL ((1))); |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
194 # endif |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
195 _GL_CXXALIAS_SYS (sigaddset, int, (sigset_t *set, int sig)); |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
196 _GL_CXXALIASWARN (sigaddset); |
9259
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
197 |
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
198 /* Remove a signal from a signal set. */ |
13022
63c614c3b5e9
signal: Undefine macro definitions in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12938
diff
changeset
|
199 # if @HAVE_POSIX_SIGNALBLOCKING@ |
63c614c3b5e9
signal: Undefine macro definitions in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12938
diff
changeset
|
200 /* This function is defined as a macro on MacOS X. */ |
63c614c3b5e9
signal: Undefine macro definitions in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12938
diff
changeset
|
201 # if defined __cplusplus && defined GNULIB_NAMESPACE |
63c614c3b5e9
signal: Undefine macro definitions in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12938
diff
changeset
|
202 # undef sigdelset |
63c614c3b5e9
signal: Undefine macro definitions in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12938
diff
changeset
|
203 # endif |
63c614c3b5e9
signal: Undefine macro definitions in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12938
diff
changeset
|
204 # else |
12938
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
205 _GL_FUNCDECL_SYS (sigdelset, int, (sigset_t *set, int sig) |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
206 _GL_ARG_NONNULL ((1))); |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
207 # endif |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
208 _GL_CXXALIAS_SYS (sigdelset, int, (sigset_t *set, int sig)); |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
209 _GL_CXXALIASWARN (sigdelset); |
9259
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
210 |
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
211 /* Fill a signal set with all possible signals. */ |
13022
63c614c3b5e9
signal: Undefine macro definitions in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12938
diff
changeset
|
212 # if @HAVE_POSIX_SIGNALBLOCKING@ |
63c614c3b5e9
signal: Undefine macro definitions in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12938
diff
changeset
|
213 /* This function is defined as a macro on MacOS X. */ |
63c614c3b5e9
signal: Undefine macro definitions in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12938
diff
changeset
|
214 # if defined __cplusplus && defined GNULIB_NAMESPACE |
63c614c3b5e9
signal: Undefine macro definitions in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12938
diff
changeset
|
215 # undef sigfillset |
63c614c3b5e9
signal: Undefine macro definitions in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12938
diff
changeset
|
216 # endif |
63c614c3b5e9
signal: Undefine macro definitions in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12938
diff
changeset
|
217 # else |
12938
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
218 _GL_FUNCDECL_SYS (sigfillset, int, (sigset_t *set) _GL_ARG_NONNULL ((1))); |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
219 # endif |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
220 _GL_CXXALIAS_SYS (sigfillset, int, (sigset_t *set)); |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
221 _GL_CXXALIASWARN (sigfillset); |
9259
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
222 |
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
223 /* Return the set of those blocked signals that are pending. */ |
12938
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
224 # if !@HAVE_POSIX_SIGNALBLOCKING@ |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
225 _GL_FUNCDECL_SYS (sigpending, int, (sigset_t *set) _GL_ARG_NONNULL ((1))); |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
226 # endif |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
227 _GL_CXXALIAS_SYS (sigpending, int, (sigset_t *set)); |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
228 _GL_CXXALIASWARN (sigpending); |
9259
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
229 |
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
230 /* If OLD_SET is not NULL, put the current set of blocked signals in *OLD_SET. |
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
231 Then, if SET is not NULL, affect the current set of blocked signals by |
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
232 combining it with *SET as indicated in OPERATION. |
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
233 In this implementation, you are not allowed to change a signal handler |
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
234 while the signal is blocked. */ |
12938
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
235 # if !@HAVE_POSIX_SIGNALBLOCKING@ |
12535
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
236 # define SIG_BLOCK 0 /* blocked_set = blocked_set | *set; */ |
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
237 # define SIG_SETMASK 1 /* blocked_set = *set; */ |
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
238 # define SIG_UNBLOCK 2 /* blocked_set = blocked_set & ~*set; */ |
12938
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
239 _GL_FUNCDECL_SYS (sigprocmask, int, |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
240 (int operation, const sigset_t *set, sigset_t *old_set)); |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
241 # endif |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
242 _GL_CXXALIAS_SYS (sigprocmask, int, |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
243 (int operation, const sigset_t *set, sigset_t *old_set)); |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
244 _GL_CXXALIASWARN (sigprocmask); |
9259
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
245 |
10228
9b123d1aa781
Improve robustness of sigprocmask by overriding signal.
Eric Blake <ebb9@byu.net>
parents:
9309
diff
changeset
|
246 /* Install the handler FUNC for signal SIG, and return the previous |
9b123d1aa781
Improve robustness of sigprocmask by overriding signal.
Eric Blake <ebb9@byu.net>
parents:
9309
diff
changeset
|
247 handler. */ |
12938
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
248 # ifdef __cplusplus |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
249 extern "C" { |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
250 # endif |
14274
da5595160b9f
Allow multiple gnulib generated replacements to coexist.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
251 # if !GNULIB_defined_function_taking_int_returning_void_t |
12938
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
252 typedef void (*_gl_function_taking_int_returning_void_t) (int); |
14274
da5595160b9f
Allow multiple gnulib generated replacements to coexist.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
253 # define GNULIB_defined_function_taking_int_returning_void_t 1 |
da5595160b9f
Allow multiple gnulib generated replacements to coexist.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
254 # endif |
12938
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
255 # ifdef __cplusplus |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
256 } |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
257 # endif |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
258 # if !@HAVE_POSIX_SIGNALBLOCKING@ |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
259 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
260 # define signal rpl_signal |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
261 # endif |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
262 _GL_FUNCDECL_RPL (signal, _gl_function_taking_int_returning_void_t, |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
263 (int sig, _gl_function_taking_int_returning_void_t func)); |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
264 _GL_CXXALIAS_RPL (signal, _gl_function_taking_int_returning_void_t, |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
265 (int sig, _gl_function_taking_int_returning_void_t func)); |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
266 # else |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
267 _GL_CXXALIAS_SYS (signal, _gl_function_taking_int_returning_void_t, |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
268 (int sig, _gl_function_taking_int_returning_void_t func)); |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
269 # endif |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
270 _GL_CXXALIASWARN (signal); |
10483
5a24031ebf7d
Support signal handling with SIGPIPE on native Windows platforms.
Bruno Haible <bruno@clisp.org>
parents:
10375
diff
changeset
|
271 |
5a24031ebf7d
Support signal handling with SIGPIPE on native Windows platforms.
Bruno Haible <bruno@clisp.org>
parents:
10375
diff
changeset
|
272 /* Raise signal SIG. */ |
12938
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
273 # if !@HAVE_POSIX_SIGNALBLOCKING@ && GNULIB_defined_SIGPIPE |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
274 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
12535
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
275 # undef raise |
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
276 # define raise rpl_raise |
12938
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
277 # endif |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
278 _GL_FUNCDECL_RPL (raise, int, (int sig)); |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
279 _GL_CXXALIAS_RPL (raise, int, (int sig)); |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
280 # else |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
281 _GL_CXXALIAS_SYS (raise, int, (int sig)); |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
282 # endif |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
283 _GL_CXXALIASWARN (raise); |
10483
5a24031ebf7d
Support signal handling with SIGPIPE on native Windows platforms.
Bruno Haible <bruno@clisp.org>
parents:
10375
diff
changeset
|
284 |
12535
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
285 #elif defined GNULIB_POSIXCHECK |
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
286 # undef sigaddset |
12766
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
287 # if HAVE_RAW_DECL_SIGADDSET |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
288 _GL_WARN_ON_USE (sigaddset, "sigaddset is unportable - " |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
289 "use the gnulib module sigprocmask for portability"); |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
290 # endif |
12535
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
291 # undef sigdelset |
12766
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
292 # if HAVE_RAW_DECL_SIGDELSET |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
293 _GL_WARN_ON_USE (sigdelset, "sigdelset is unportable - " |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
294 "use the gnulib module sigprocmask for portability"); |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
295 # endif |
12535
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
296 # undef sigemptyset |
12766
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
297 # if HAVE_RAW_DECL_SIGEMPTYSET |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
298 _GL_WARN_ON_USE (sigemptyset, "sigemptyset is unportable - " |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
299 "use the gnulib module sigprocmask for portability"); |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
300 # endif |
12535
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
301 # undef sigfillset |
12766
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
302 # if HAVE_RAW_DECL_SIGFILLSET |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
303 _GL_WARN_ON_USE (sigfillset, "sigfillset is unportable - " |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
304 "use the gnulib module sigprocmask for portability"); |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
305 # endif |
12535
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
306 # undef sigismember |
12766
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
307 # if HAVE_RAW_DECL_SIGISMEMBER |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
308 _GL_WARN_ON_USE (sigismember, "sigismember is unportable - " |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
309 "use the gnulib module sigprocmask for portability"); |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
310 # endif |
12535
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
311 # undef sigpending |
12766
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
312 # if HAVE_RAW_DECL_SIGPENDING |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
313 _GL_WARN_ON_USE (sigpending, "sigpending is unportable - " |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
314 "use the gnulib module sigprocmask for portability"); |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
315 # endif |
12535
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
316 # undef sigprocmask |
12766
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
317 # if HAVE_RAW_DECL_SIGPROCMASK |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
318 _GL_WARN_ON_USE (sigprocmask, "sigprocmask is unportable - " |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
319 "use the gnulib module sigprocmask for portability"); |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
320 # endif |
12535
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
321 #endif /* @GNULIB_SIGPROCMASK@ */ |
10229
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
322 |
10483
5a24031ebf7d
Support signal handling with SIGPIPE on native Windows platforms.
Bruno Haible <bruno@clisp.org>
parents:
10375
diff
changeset
|
323 |
12535
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
324 #if @GNULIB_SIGACTION@ |
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
325 # if !@HAVE_SIGACTION@ |
10229
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
326 |
12535
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
327 # if !@HAVE_SIGINFO_T@ |
14274
da5595160b9f
Allow multiple gnulib generated replacements to coexist.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
328 |
da5595160b9f
Allow multiple gnulib generated replacements to coexist.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
329 # if !GNULIB_defined_siginfo_types |
da5595160b9f
Allow multiple gnulib generated replacements to coexist.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
330 |
10229
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
331 /* Present to allow compilation, but unsupported by gnulib. */ |
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
332 union sigval |
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
333 { |
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
334 int sival_int; |
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
335 void *sival_ptr; |
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
336 }; |
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
337 |
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
338 /* Present to allow compilation, but unsupported by gnulib. */ |
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
339 struct siginfo_t |
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
340 { |
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
341 int si_signo; |
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
342 int si_code; |
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
343 int si_errno; |
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
344 pid_t si_pid; |
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
345 uid_t si_uid; |
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
346 void *si_addr; |
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
347 int si_status; |
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
348 long si_band; |
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
349 union sigval si_value; |
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
350 }; |
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
351 typedef struct siginfo_t siginfo_t; |
14274
da5595160b9f
Allow multiple gnulib generated replacements to coexist.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
352 |
da5595160b9f
Allow multiple gnulib generated replacements to coexist.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
353 # define GNULIB_defined_siginfo_types 1 |
da5595160b9f
Allow multiple gnulib generated replacements to coexist.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
354 # endif |
da5595160b9f
Allow multiple gnulib generated replacements to coexist.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
355 |
12535
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
356 # endif /* !@HAVE_SIGINFO_T@ */ |
10229
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
357 |
10243 | 358 /* We assume that platforms which lack the sigaction() function also lack |
359 the 'struct sigaction' type, and vice versa. */ | |
10229
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
360 |
14274
da5595160b9f
Allow multiple gnulib generated replacements to coexist.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
361 # if !GNULIB_defined_struct_sigaction |
da5595160b9f
Allow multiple gnulib generated replacements to coexist.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
362 |
10229
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
363 struct sigaction |
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
364 { |
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
365 union |
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
366 { |
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
367 void (*_sa_handler) (int); |
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
368 /* Present to allow compilation, but unsupported by gnulib. POSIX |
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
369 says that implementations may, but not must, make sa_sigaction |
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
370 overlap with sa_handler, but we know of no implementation where |
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
371 they do not overlap. */ |
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
372 void (*_sa_sigaction) (int, siginfo_t *, void *); |
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
373 } _sa_func; |
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
374 sigset_t sa_mask; |
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
375 /* Not all POSIX flags are supported. */ |
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
376 int sa_flags; |
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
377 }; |
14274
da5595160b9f
Allow multiple gnulib generated replacements to coexist.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
378 # define sa_handler _sa_func._sa_handler |
da5595160b9f
Allow multiple gnulib generated replacements to coexist.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
379 # define sa_sigaction _sa_func._sa_sigaction |
10229
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
380 /* Unsupported flags are not present. */ |
14274
da5595160b9f
Allow multiple gnulib generated replacements to coexist.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
381 # define SA_RESETHAND 1 |
da5595160b9f
Allow multiple gnulib generated replacements to coexist.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
382 # define SA_NODEFER 2 |
da5595160b9f
Allow multiple gnulib generated replacements to coexist.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
383 # define SA_RESTART 4 |
da5595160b9f
Allow multiple gnulib generated replacements to coexist.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
384 |
da5595160b9f
Allow multiple gnulib generated replacements to coexist.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
385 # define GNULIB_defined_struct_sigaction 1 |
da5595160b9f
Allow multiple gnulib generated replacements to coexist.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
386 # endif |
10229
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
387 |
12938
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
388 _GL_FUNCDECL_SYS (sigaction, int, (int, const struct sigaction *restrict, |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
389 struct sigaction *restrict)); |
10229
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
390 |
12535
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
391 # elif !@HAVE_STRUCT_SIGACTION_SA_SIGACTION@ |
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
392 |
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
393 # define sa_sigaction sa_handler |
10321
a6493a165dd2
c-stack: fix regression on Irix 5.3 from 2008-06-21
Eric Blake <ebb9@byu.net>
parents:
10243
diff
changeset
|
394 |
12535
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
395 # endif /* !@HAVE_SIGACTION@, !@HAVE_STRUCT_SIGACTION_SA_SIGACTION@ */ |
12938
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
396 |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
397 _GL_CXXALIAS_SYS (sigaction, int, (int, const struct sigaction *restrict, |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
398 struct sigaction *restrict)); |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
399 _GL_CXXALIASWARN (sigaction); |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
400 |
12535
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
401 #elif defined GNULIB_POSIXCHECK |
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
402 # undef sigaction |
12766
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
403 # if HAVE_RAW_DECL_SIGACTION |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
404 _GL_WARN_ON_USE (sigaction, "sigaction is unportable - " |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
405 "use the gnulib module sigaction for portability"); |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
406 # endif |
12535
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
407 #endif |
9259
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
408 |
10706
5a35e8f56744
Define a dummy SA_NODEFER macro on Interix.
Bruno Haible <bruno@clisp.org>
parents:
10655
diff
changeset
|
409 /* Some systems don't have SA_NODEFER. */ |
5a35e8f56744
Define a dummy SA_NODEFER macro on Interix.
Bruno Haible <bruno@clisp.org>
parents:
10655
diff
changeset
|
410 #ifndef SA_NODEFER |
5a35e8f56744
Define a dummy SA_NODEFER macro on Interix.
Bruno Haible <bruno@clisp.org>
parents:
10655
diff
changeset
|
411 # define SA_NODEFER 0 |
5a35e8f56744
Define a dummy SA_NODEFER macro on Interix.
Bruno Haible <bruno@clisp.org>
parents:
10655
diff
changeset
|
412 #endif |
5a35e8f56744
Define a dummy SA_NODEFER macro on Interix.
Bruno Haible <bruno@clisp.org>
parents:
10655
diff
changeset
|
413 |
5a35e8f56744
Define a dummy SA_NODEFER macro on Interix.
Bruno Haible <bruno@clisp.org>
parents:
10655
diff
changeset
|
414 |
14840
5f709022a256
Allow multiple gnulib generated include files to be combined.
Bruno Haible <bruno@clisp.org>
parents:
14686
diff
changeset
|
415 #endif /* _@GUARD_PREFIX@_SIGNAL_H */ |
5f709022a256
Allow multiple gnulib generated include files to be combined.
Bruno Haible <bruno@clisp.org>
parents:
14686
diff
changeset
|
416 #endif /* _@GUARD_PREFIX@_SIGNAL_H */ |
9259
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
417 #endif |