Mercurial > hg > octave-kai > gnulib-hg
annotate lib/signal.in.h @ 17249:e542fd46ad6f
maint: update all copyright year number ranges
Run "make update-copyright". Compare to commit 1602f0a from last year.
Signed-off-by: Eric Blake <eblake@redhat.com>
author | Eric Blake <eblake@redhat.com> |
---|---|
date | Tue, 01 Jan 2013 00:50:58 +0000 |
parents | 498a2211d839 |
children |
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 |
17249
e542fd46ad6f
maint: update all copyright year number ranges
Eric Blake <eblake@redhat.com>
parents:
16935
diff
changeset
|
3 Copyright (C) 2006-2013 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 |
16935
498a2211d839
Write "Mac OS X" instead of "MacOS X".
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
58 /* Mac OS X 10.3, FreeBSD 6.4, OpenBSD 3.8, OSF/1 4.0, Solaris 2.6 declare |
15369
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@ |
15370
54bbcd9bb255
pthread_sigmask: Fix link requirements on OSF/1 5.1 and with pth.
Bruno Haible <bruno@clisp.org>
parents:
15369
diff
changeset
|
128 # if @REPLACE_PTHREAD_SIGMASK@ |
54bbcd9bb255
pthread_sigmask: Fix link requirements on OSF/1 5.1 and with pth.
Bruno Haible <bruno@clisp.org>
parents:
15369
diff
changeset
|
129 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
54bbcd9bb255
pthread_sigmask: Fix link requirements on OSF/1 5.1 and with pth.
Bruno Haible <bruno@clisp.org>
parents:
15369
diff
changeset
|
130 # undef pthread_sigmask |
54bbcd9bb255
pthread_sigmask: Fix link requirements on OSF/1 5.1 and with pth.
Bruno Haible <bruno@clisp.org>
parents:
15369
diff
changeset
|
131 # define pthread_sigmask rpl_pthread_sigmask |
54bbcd9bb255
pthread_sigmask: Fix link requirements on OSF/1 5.1 and with pth.
Bruno Haible <bruno@clisp.org>
parents:
15369
diff
changeset
|
132 # endif |
54bbcd9bb255
pthread_sigmask: Fix link requirements on OSF/1 5.1 and with pth.
Bruno Haible <bruno@clisp.org>
parents:
15369
diff
changeset
|
133 _GL_FUNCDECL_RPL (pthread_sigmask, int, |
54bbcd9bb255
pthread_sigmask: Fix link requirements on OSF/1 5.1 and with pth.
Bruno Haible <bruno@clisp.org>
parents:
15369
diff
changeset
|
134 (int how, const sigset_t *new_mask, sigset_t *old_mask)); |
54bbcd9bb255
pthread_sigmask: Fix link requirements on OSF/1 5.1 and with pth.
Bruno Haible <bruno@clisp.org>
parents:
15369
diff
changeset
|
135 _GL_CXXALIAS_RPL (pthread_sigmask, int, |
54bbcd9bb255
pthread_sigmask: Fix link requirements on OSF/1 5.1 and with pth.
Bruno Haible <bruno@clisp.org>
parents:
15369
diff
changeset
|
136 (int how, const sigset_t *new_mask, sigset_t *old_mask)); |
54bbcd9bb255
pthread_sigmask: Fix link requirements on OSF/1 5.1 and with pth.
Bruno Haible <bruno@clisp.org>
parents:
15369
diff
changeset
|
137 # else |
54bbcd9bb255
pthread_sigmask: Fix link requirements on OSF/1 5.1 and with pth.
Bruno Haible <bruno@clisp.org>
parents:
15369
diff
changeset
|
138 # if !@HAVE_PTHREAD_SIGMASK@ |
15364
f81fb597c41a
pthread_sigmask: Fix return value.
Bruno Haible <bruno@clisp.org>
parents:
15343
diff
changeset
|
139 _GL_FUNCDECL_SYS (pthread_sigmask, int, |
f81fb597c41a
pthread_sigmask: Fix return value.
Bruno Haible <bruno@clisp.org>
parents:
15343
diff
changeset
|
140 (int how, const sigset_t *new_mask, sigset_t *old_mask)); |
15370
54bbcd9bb255
pthread_sigmask: Fix link requirements on OSF/1 5.1 and with pth.
Bruno Haible <bruno@clisp.org>
parents:
15369
diff
changeset
|
141 # endif |
15365
8e2f1d4b9199
pthread_sigmask: Make declaration C++ safe.
Bruno Haible <bruno@clisp.org>
parents:
15364
diff
changeset
|
142 _GL_CXXALIAS_SYS (pthread_sigmask, int, |
8e2f1d4b9199
pthread_sigmask: Make declaration C++ safe.
Bruno Haible <bruno@clisp.org>
parents:
15364
diff
changeset
|
143 (int how, const sigset_t *new_mask, sigset_t *old_mask)); |
15370
54bbcd9bb255
pthread_sigmask: Fix link requirements on OSF/1 5.1 and with pth.
Bruno Haible <bruno@clisp.org>
parents:
15369
diff
changeset
|
144 # endif |
15365
8e2f1d4b9199
pthread_sigmask: Make declaration C++ safe.
Bruno Haible <bruno@clisp.org>
parents:
15364
diff
changeset
|
145 _GL_CXXALIASWARN (pthread_sigmask); |
15343
107f8443e77a
pthread_sigmask: new module
Paul Eggert <eggert@cs.ucla.edu>
parents:
14840
diff
changeset
|
146 #elif defined GNULIB_POSIXCHECK |
107f8443e77a
pthread_sigmask: new module
Paul Eggert <eggert@cs.ucla.edu>
parents:
14840
diff
changeset
|
147 # undef pthread_sigmask |
107f8443e77a
pthread_sigmask: new module
Paul Eggert <eggert@cs.ucla.edu>
parents:
14840
diff
changeset
|
148 # if HAVE_RAW_DECL_PTHREAD_SIGMASK |
107f8443e77a
pthread_sigmask: new module
Paul Eggert <eggert@cs.ucla.edu>
parents:
14840
diff
changeset
|
149 _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
|
150 "use gnulib module pthread_sigmask for portability"); |
107f8443e77a
pthread_sigmask: new module
Paul Eggert <eggert@cs.ucla.edu>
parents:
14840
diff
changeset
|
151 # endif |
107f8443e77a
pthread_sigmask: new module
Paul Eggert <eggert@cs.ucla.edu>
parents:
14840
diff
changeset
|
152 #endif |
107f8443e77a
pthread_sigmask: new module
Paul Eggert <eggert@cs.ucla.edu>
parents:
14840
diff
changeset
|
153 |
107f8443e77a
pthread_sigmask: new module
Paul Eggert <eggert@cs.ucla.edu>
parents:
14840
diff
changeset
|
154 |
15755 | 155 #if @GNULIB_RAISE@ |
156 # if @REPLACE_RAISE@ | |
157 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) | |
158 # undef raise | |
159 # define raise rpl_raise | |
160 # endif | |
161 _GL_FUNCDECL_RPL (raise, int, (int sig)); | |
162 _GL_CXXALIAS_RPL (raise, int, (int sig)); | |
163 # else | |
164 # if !@HAVE_RAISE@ | |
165 _GL_FUNCDECL_SYS (raise, int, (int sig)); | |
166 # endif | |
167 _GL_CXXALIAS_SYS (raise, int, (int sig)); | |
168 # endif | |
169 _GL_CXXALIASWARN (raise); | |
170 #elif defined GNULIB_POSIXCHECK | |
171 # undef raise | |
172 /* Assume raise is always declared. */ | |
173 _GL_WARN_ON_USE (raise, "raise can crash on native Windows - " | |
174 "use gnulib module raise for portability"); | |
175 #endif | |
176 | |
177 | |
12535
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
178 #if @GNULIB_SIGPROCMASK@ |
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
179 # if !@HAVE_POSIX_SIGNALBLOCKING@ |
9259
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
180 |
15794
13eba3ca057f
raise: Fix double declaration with modules 'sigprocmask' and 'sigpipe'.
Bruno Haible <bruno@clisp.org>
parents:
15755
diff
changeset
|
181 # ifndef GNULIB_defined_signal_blocking |
13eba3ca057f
raise: Fix double declaration with modules 'sigprocmask' and 'sigpipe'.
Bruno Haible <bruno@clisp.org>
parents:
15755
diff
changeset
|
182 # define GNULIB_defined_signal_blocking 1 |
13eba3ca057f
raise: Fix double declaration with modules 'sigprocmask' and 'sigpipe'.
Bruno Haible <bruno@clisp.org>
parents:
15755
diff
changeset
|
183 # endif |
13eba3ca057f
raise: Fix double declaration with modules 'sigprocmask' and 'sigpipe'.
Bruno Haible <bruno@clisp.org>
parents:
15755
diff
changeset
|
184 |
9259
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
185 /* Maximum signal number + 1. */ |
12535
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
186 # ifndef NSIG |
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
187 # define NSIG 32 |
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
188 # endif |
9259
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
189 |
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
190 /* This code supports only 32 signals. */ |
14274
da5595160b9f
Allow multiple gnulib generated replacements to coexist.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
191 # 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
|
192 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
|
193 # define GNULIB_defined_verify_NSIG_constraint 1 |
da5595160b9f
Allow multiple gnulib generated replacements to coexist.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
194 # endif |
9259
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
195 |
12938
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
196 # endif |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
197 |
9259
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
198 /* 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
|
199 # if @HAVE_POSIX_SIGNALBLOCKING@ |
16935
498a2211d839
Write "Mac OS X" instead of "MacOS X".
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
200 /* This function is defined as a macro on Mac OS X. */ |
13022
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 sigismember |
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 (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
|
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 (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
|
209 _GL_CXXALIASWARN (sigismember); |
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 /* 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
|
212 # if @HAVE_POSIX_SIGNALBLOCKING@ |
16935
498a2211d839
Write "Mac OS X" instead of "MacOS X".
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
213 /* This function is defined as a macro on Mac OS X. */ |
13022
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 sigemptyset |
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 (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
|
219 # endif |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
220 _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
|
221 _GL_CXXALIASWARN (sigemptyset); |
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 /* 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
|
224 # if @HAVE_POSIX_SIGNALBLOCKING@ |
16935
498a2211d839
Write "Mac OS X" instead of "MacOS X".
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
225 /* This function is defined as a macro on Mac OS X. */ |
13022
63c614c3b5e9
signal: Undefine macro definitions in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12938
diff
changeset
|
226 # if defined __cplusplus && defined GNULIB_NAMESPACE |
63c614c3b5e9
signal: Undefine macro definitions in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12938
diff
changeset
|
227 # undef sigaddset |
63c614c3b5e9
signal: Undefine macro definitions in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12938
diff
changeset
|
228 # endif |
63c614c3b5e9
signal: Undefine macro definitions in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12938
diff
changeset
|
229 # else |
12938
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
230 _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
|
231 _GL_ARG_NONNULL ((1))); |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
232 # endif |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
233 _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
|
234 _GL_CXXALIASWARN (sigaddset); |
9259
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
235 |
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
236 /* 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
|
237 # if @HAVE_POSIX_SIGNALBLOCKING@ |
16935
498a2211d839
Write "Mac OS X" instead of "MacOS X".
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
238 /* This function is defined as a macro on Mac OS X. */ |
13022
63c614c3b5e9
signal: Undefine macro definitions in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12938
diff
changeset
|
239 # if defined __cplusplus && defined GNULIB_NAMESPACE |
63c614c3b5e9
signal: Undefine macro definitions in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12938
diff
changeset
|
240 # undef sigdelset |
63c614c3b5e9
signal: Undefine macro definitions in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12938
diff
changeset
|
241 # endif |
63c614c3b5e9
signal: Undefine macro definitions in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12938
diff
changeset
|
242 # else |
12938
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
243 _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
|
244 _GL_ARG_NONNULL ((1))); |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
245 # endif |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
246 _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
|
247 _GL_CXXALIASWARN (sigdelset); |
9259
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
248 |
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
249 /* 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
|
250 # if @HAVE_POSIX_SIGNALBLOCKING@ |
16935
498a2211d839
Write "Mac OS X" instead of "MacOS X".
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
251 /* This function is defined as a macro on Mac OS X. */ |
13022
63c614c3b5e9
signal: Undefine macro definitions in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12938
diff
changeset
|
252 # if defined __cplusplus && defined GNULIB_NAMESPACE |
63c614c3b5e9
signal: Undefine macro definitions in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12938
diff
changeset
|
253 # undef sigfillset |
63c614c3b5e9
signal: Undefine macro definitions in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12938
diff
changeset
|
254 # endif |
63c614c3b5e9
signal: Undefine macro definitions in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12938
diff
changeset
|
255 # else |
12938
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
256 _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
|
257 # endif |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
258 _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
|
259 _GL_CXXALIASWARN (sigfillset); |
9259
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
260 |
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
261 /* 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
|
262 # if !@HAVE_POSIX_SIGNALBLOCKING@ |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
263 _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
|
264 # endif |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
265 _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
|
266 _GL_CXXALIASWARN (sigpending); |
9259
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
267 |
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
268 /* 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
|
269 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
|
270 combining it with *SET as indicated in OPERATION. |
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
271 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
|
272 while the signal is blocked. */ |
12938
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
273 # if !@HAVE_POSIX_SIGNALBLOCKING@ |
12535
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
274 # define SIG_BLOCK 0 /* blocked_set = blocked_set | *set; */ |
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
275 # define SIG_SETMASK 1 /* blocked_set = *set; */ |
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
276 # 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
|
277 _GL_FUNCDECL_SYS (sigprocmask, int, |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
278 (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
|
279 # endif |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
280 _GL_CXXALIAS_SYS (sigprocmask, int, |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
281 (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
|
282 _GL_CXXALIASWARN (sigprocmask); |
9259
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
283 |
10228
9b123d1aa781
Improve robustness of sigprocmask by overriding signal.
Eric Blake <ebb9@byu.net>
parents:
9309
diff
changeset
|
284 /* 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
|
285 handler. */ |
12938
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
286 # ifdef __cplusplus |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
287 extern "C" { |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
288 # endif |
14274
da5595160b9f
Allow multiple gnulib generated replacements to coexist.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
289 # 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
|
290 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
|
291 # 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
|
292 # endif |
12938
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
293 # ifdef __cplusplus |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
294 } |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
295 # endif |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
296 # if !@HAVE_POSIX_SIGNALBLOCKING@ |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
297 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
298 # define signal rpl_signal |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
299 # endif |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
300 _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
|
301 (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
|
302 _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
|
303 (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
|
304 # else |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
305 _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
|
306 (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
|
307 # endif |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
308 _GL_CXXALIASWARN (signal); |
10483
5a24031ebf7d
Support signal handling with SIGPIPE on native Windows platforms.
Bruno Haible <bruno@clisp.org>
parents:
10375
diff
changeset
|
309 |
12938
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
310 # if !@HAVE_POSIX_SIGNALBLOCKING@ && GNULIB_defined_SIGPIPE |
15794
13eba3ca057f
raise: Fix double declaration with modules 'sigprocmask' and 'sigpipe'.
Bruno Haible <bruno@clisp.org>
parents:
15755
diff
changeset
|
311 /* Raise signal SIGPIPE. */ |
13eba3ca057f
raise: Fix double declaration with modules 'sigprocmask' and 'sigpipe'.
Bruno Haible <bruno@clisp.org>
parents:
15755
diff
changeset
|
312 _GL_EXTERN_C int _gl_raise_SIGPIPE (void); |
12938
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
313 # endif |
10483
5a24031ebf7d
Support signal handling with SIGPIPE on native Windows platforms.
Bruno Haible <bruno@clisp.org>
parents:
10375
diff
changeset
|
314 |
12535
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
315 #elif defined GNULIB_POSIXCHECK |
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
316 # undef sigaddset |
12766
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
317 # if HAVE_RAW_DECL_SIGADDSET |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
318 _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
|
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 # undef sigdelset |
12766
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
322 # if HAVE_RAW_DECL_SIGDELSET |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
323 _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
|
324 "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
|
325 # endif |
12535
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
326 # undef sigemptyset |
12766
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
327 # if HAVE_RAW_DECL_SIGEMPTYSET |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
328 _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
|
329 "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
|
330 # endif |
12535
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
331 # undef sigfillset |
12766
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
332 # if HAVE_RAW_DECL_SIGFILLSET |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
333 _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
|
334 "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
|
335 # endif |
12535
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
336 # undef sigismember |
12766
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
337 # if HAVE_RAW_DECL_SIGISMEMBER |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
338 _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
|
339 "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
|
340 # endif |
12535
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
341 # undef sigpending |
12766
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
342 # if HAVE_RAW_DECL_SIGPENDING |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
343 _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
|
344 "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
|
345 # endif |
12535
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
346 # undef sigprocmask |
12766
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
347 # if HAVE_RAW_DECL_SIGPROCMASK |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
348 _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
|
349 "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
|
350 # endif |
12535
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
351 #endif /* @GNULIB_SIGPROCMASK@ */ |
10229
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
352 |
10483
5a24031ebf7d
Support signal handling with SIGPIPE on native Windows platforms.
Bruno Haible <bruno@clisp.org>
parents:
10375
diff
changeset
|
353 |
12535
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
354 #if @GNULIB_SIGACTION@ |
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
355 # if !@HAVE_SIGACTION@ |
10229
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
356 |
12535
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
357 # if !@HAVE_SIGINFO_T@ |
14274
da5595160b9f
Allow multiple gnulib generated replacements to coexist.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
358 |
da5595160b9f
Allow multiple gnulib generated replacements to coexist.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
359 # if !GNULIB_defined_siginfo_types |
da5595160b9f
Allow multiple gnulib generated replacements to coexist.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
360 |
10229
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
361 /* Present to allow compilation, but unsupported by gnulib. */ |
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
362 union sigval |
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
363 { |
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
364 int sival_int; |
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
365 void *sival_ptr; |
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 |
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
368 /* Present to allow compilation, but unsupported by gnulib. */ |
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
369 struct siginfo_t |
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
370 { |
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
371 int si_signo; |
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
372 int si_code; |
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
373 int si_errno; |
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
374 pid_t si_pid; |
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
375 uid_t si_uid; |
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
376 void *si_addr; |
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
377 int si_status; |
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
378 long si_band; |
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
379 union sigval si_value; |
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
380 }; |
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
381 typedef struct siginfo_t siginfo_t; |
14274
da5595160b9f
Allow multiple gnulib generated replacements to coexist.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
382 |
da5595160b9f
Allow multiple gnulib generated replacements to coexist.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
383 # define GNULIB_defined_siginfo_types 1 |
da5595160b9f
Allow multiple gnulib generated replacements to coexist.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
384 # endif |
da5595160b9f
Allow multiple gnulib generated replacements to coexist.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
385 |
12535
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
386 # endif /* !@HAVE_SIGINFO_T@ */ |
10229
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
387 |
10243 | 388 /* We assume that platforms which lack the sigaction() function also lack |
389 the 'struct sigaction' type, and vice versa. */ | |
10229
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
390 |
14274
da5595160b9f
Allow multiple gnulib generated replacements to coexist.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
391 # if !GNULIB_defined_struct_sigaction |
da5595160b9f
Allow multiple gnulib generated replacements to coexist.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
392 |
10229
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
393 struct sigaction |
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
394 { |
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
395 union |
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
396 { |
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
397 void (*_sa_handler) (int); |
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
398 /* Present to allow compilation, but unsupported by gnulib. POSIX |
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
399 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
|
400 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
|
401 they do not overlap. */ |
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
402 void (*_sa_sigaction) (int, siginfo_t *, void *); |
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
403 } _sa_func; |
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
404 sigset_t sa_mask; |
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
405 /* Not all POSIX flags are supported. */ |
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
406 int sa_flags; |
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
407 }; |
14274
da5595160b9f
Allow multiple gnulib generated replacements to coexist.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
408 # define sa_handler _sa_func._sa_handler |
da5595160b9f
Allow multiple gnulib generated replacements to coexist.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
409 # define sa_sigaction _sa_func._sa_sigaction |
10229
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
410 /* Unsupported flags are not present. */ |
14274
da5595160b9f
Allow multiple gnulib generated replacements to coexist.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
411 # define SA_RESETHAND 1 |
da5595160b9f
Allow multiple gnulib generated replacements to coexist.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
412 # define SA_NODEFER 2 |
da5595160b9f
Allow multiple gnulib generated replacements to coexist.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
413 # define SA_RESTART 4 |
da5595160b9f
Allow multiple gnulib generated replacements to coexist.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
414 |
da5595160b9f
Allow multiple gnulib generated replacements to coexist.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
415 # define GNULIB_defined_struct_sigaction 1 |
da5595160b9f
Allow multiple gnulib generated replacements to coexist.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
416 # endif |
10229
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
417 |
12938
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
418 _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
|
419 struct sigaction *restrict)); |
10229
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
420 |
12535
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
421 # elif !@HAVE_STRUCT_SIGACTION_SA_SIGACTION@ |
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
422 |
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
423 # 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
|
424 |
12535
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
425 # 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
|
426 |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
427 _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
|
428 struct sigaction *restrict)); |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
429 _GL_CXXALIASWARN (sigaction); |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
430 |
12535
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
431 #elif defined GNULIB_POSIXCHECK |
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
432 # undef sigaction |
12766
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
433 # if HAVE_RAW_DECL_SIGACTION |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
434 _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
|
435 "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
|
436 # endif |
12535
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
437 #endif |
9259
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
438 |
10706
5a35e8f56744
Define a dummy SA_NODEFER macro on Interix.
Bruno Haible <bruno@clisp.org>
parents:
10655
diff
changeset
|
439 /* 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
|
440 #ifndef SA_NODEFER |
5a35e8f56744
Define a dummy SA_NODEFER macro on Interix.
Bruno Haible <bruno@clisp.org>
parents:
10655
diff
changeset
|
441 # define SA_NODEFER 0 |
5a35e8f56744
Define a dummy SA_NODEFER macro on Interix.
Bruno Haible <bruno@clisp.org>
parents:
10655
diff
changeset
|
442 #endif |
5a35e8f56744
Define a dummy SA_NODEFER macro on Interix.
Bruno Haible <bruno@clisp.org>
parents:
10655
diff
changeset
|
443 |
5a35e8f56744
Define a dummy SA_NODEFER macro on Interix.
Bruno Haible <bruno@clisp.org>
parents:
10655
diff
changeset
|
444 |
14840
5f709022a256
Allow multiple gnulib generated include files to be combined.
Bruno Haible <bruno@clisp.org>
parents:
14686
diff
changeset
|
445 #endif /* _@GUARD_PREFIX@_SIGNAL_H */ |
5f709022a256
Allow multiple gnulib generated include files to be combined.
Bruno Haible <bruno@clisp.org>
parents:
14686
diff
changeset
|
446 #endif /* _@GUARD_PREFIX@_SIGNAL_H */ |
9259
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
447 #endif |