Mercurial > gnulib
annotate lib/signal.in.h @ 39207:ca2c3817b8a6
pthread_sigmask: Avoid compilation error on mingw.
Reported by Tim Rühsen <tim.ruehsen@gmx.de>.
* lib/signal.in.h (pthread_sigmask): Don't declare it it's defined as a
macro.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Thu, 04 Jan 2018 10:42:21 +0100 |
parents | 24e347e0e326 |
children | b06060465f09 |
rev | line source |
---|---|
28950
cde07c866610
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1 /* A GNU-like <signal.h>. |
cde07c866610
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
2 |
39199
24e347e0e326
maint: Run 'make update-copyright'
Paul Eggert <eggert@cs.ucla.edu>
parents:
39154
diff
changeset
|
3 Copyright (C) 2006-2018 Free Software Foundation, Inc. |
28950
cde07c866610
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4 |
29000
49d1cc4454bf
Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents:
28950
diff
changeset
|
5 This program is free software: you can redistribute it and/or modify |
28950
cde07c866610
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 |
29000
49d1cc4454bf
Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents:
28950
diff
changeset
|
7 the Free Software Foundation; either version 3 of the License, or |
49d1cc4454bf
Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents:
28950
diff
changeset
|
8 (at your option) any later version. |
28950
cde07c866610
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
9 |
cde07c866610
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, |
cde07c866610
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 |
cde07c866610
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 |
cde07c866610
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
13 GNU General Public License for more details. |
cde07c866610
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
14 |
cde07c866610
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 |
38844 | 16 along with this program. If not, see <https://www.gnu.org/licenses/>. */ |
28950
cde07c866610
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
17 |
30346
3a2cbb16720d
Avoid gcc warnings because of #pragma GCC system_header on older gcc.
Bruno Haible <bruno@clisp.org>
parents:
30174
diff
changeset
|
18 #if __GNUC__ >= 3 |
30066
7902c57e7155
Avoid some "gcc -pedantic" warnings.
Bruno Haible <bruno@clisp.org>
parents:
30012
diff
changeset
|
19 @PRAGMA_SYSTEM_HEADER@ |
30346
3a2cbb16720d
Avoid gcc warnings because of #pragma GCC system_header on older gcc.
Bruno Haible <bruno@clisp.org>
parents:
30174
diff
changeset
|
20 #endif |
33452
68b29a59bbd8
Avoid line length limitation from HP NonStop system header files.
Bruno Haible <bruno@clisp.org>
parents:
32713
diff
changeset
|
21 @PRAGMA_COLUMNS@ |
30066
7902c57e7155
Avoid some "gcc -pedantic" warnings.
Bruno Haible <bruno@clisp.org>
parents:
30012
diff
changeset
|
22 |
35056
c2588d0f001a
pthread_sigmask: Make declaration C++ safe.
Bruno Haible <bruno@clisp.org>
parents:
35055
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) |
c2588d0f001a
pthread_sigmask: Make declaration C++ safe.
Bruno Haible <bruno@clisp.org>
parents:
35055
diff
changeset
|
24 /* Special invocation convention: |
c2588d0f001a
pthread_sigmask: Make declaration C++ safe.
Bruno Haible <bruno@clisp.org>
parents:
35055
diff
changeset
|
25 - Inside glibc header files. |
c2588d0f001a
pthread_sigmask: Make declaration C++ safe.
Bruno Haible <bruno@clisp.org>
parents:
35055
diff
changeset
|
26 - On glibc systems we have a sequence of nested includes |
c2588d0f001a
pthread_sigmask: Make declaration C++ safe.
Bruno Haible <bruno@clisp.org>
parents:
35055
diff
changeset
|
27 <signal.h> -> <ucontext.h> -> <signal.h>. |
c2588d0f001a
pthread_sigmask: Make declaration C++ safe.
Bruno Haible <bruno@clisp.org>
parents:
35055
diff
changeset
|
28 In this situation, the functions are not yet declared, therefore we cannot |
c2588d0f001a
pthread_sigmask: Make declaration C++ safe.
Bruno Haible <bruno@clisp.org>
parents:
35055
diff
changeset
|
29 provide the C++ aliases. |
c2588d0f001a
pthread_sigmask: Make declaration C++ safe.
Bruno Haible <bruno@clisp.org>
parents:
35055
diff
changeset
|
30 - On glibc systems with GCC 4.3 we have a sequence of nested includes |
c2588d0f001a
pthread_sigmask: Make declaration C++ safe.
Bruno Haible <bruno@clisp.org>
parents:
35055
diff
changeset
|
31 <csignal> -> </usr/include/signal.h> -> <sys/ucontext.h> -> <signal.h>. |
c2588d0f001a
pthread_sigmask: Make declaration C++ safe.
Bruno Haible <bruno@clisp.org>
parents:
35055
diff
changeset
|
32 In this situation, some of the functions are not yet declared, therefore |
c2588d0f001a
pthread_sigmask: Make declaration C++ safe.
Bruno Haible <bruno@clisp.org>
parents:
35055
diff
changeset
|
33 we cannot provide the C++ aliases. */ |
28950
cde07c866610
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
34 |
cde07c866610
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
35 # @INCLUDE_NEXT@ @NEXT_SIGNAL_H@ |
cde07c866610
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
36 |
cde07c866610
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
37 #else |
cde07c866610
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
38 /* Normal invocation convention. */ |
cde07c866610
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
39 |
34531
aebcca9ddd62
Allow multiple gnulib generated include files to be combined.
Bruno Haible <bruno@clisp.org>
parents:
34377
diff
changeset
|
40 #ifndef _@GUARD_PREFIX@_SIGNAL_H |
28950
cde07c866610
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
41 |
35056
c2588d0f001a
pthread_sigmask: Make declaration C++ safe.
Bruno Haible <bruno@clisp.org>
parents:
35055
diff
changeset
|
42 #define _GL_ALREADY_INCLUDING_SIGNAL_H |
c2588d0f001a
pthread_sigmask: Make declaration C++ safe.
Bruno Haible <bruno@clisp.org>
parents:
35055
diff
changeset
|
43 |
35034
96eee4b97625
pthread_sigmask: new module
Paul Eggert <eggert@cs.ucla.edu>
parents:
34531
diff
changeset
|
44 /* Define pid_t, uid_t. |
96eee4b97625
pthread_sigmask: new module
Paul Eggert <eggert@cs.ucla.edu>
parents:
34531
diff
changeset
|
45 Also, mingw defines sigset_t not in <signal.h>, but in <sys/types.h>. |
96eee4b97625
pthread_sigmask: new module
Paul Eggert <eggert@cs.ucla.edu>
parents:
34531
diff
changeset
|
46 On Solaris 10, <signal.h> includes <sys/types.h>, which eventually includes |
96eee4b97625
pthread_sigmask: new module
Paul Eggert <eggert@cs.ucla.edu>
parents:
34531
diff
changeset
|
47 us; so include <sys/types.h> now, before the second inclusion guard. */ |
96eee4b97625
pthread_sigmask: new module
Paul Eggert <eggert@cs.ucla.edu>
parents:
34531
diff
changeset
|
48 #include <sys/types.h> |
96eee4b97625
pthread_sigmask: new module
Paul Eggert <eggert@cs.ucla.edu>
parents:
34531
diff
changeset
|
49 |
28950
cde07c866610
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. */ |
cde07c866610
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
51 #@INCLUDE_NEXT@ @NEXT_SIGNAL_H@ |
cde07c866610
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
52 |
35056
c2588d0f001a
pthread_sigmask: Make declaration C++ safe.
Bruno Haible <bruno@clisp.org>
parents:
35055
diff
changeset
|
53 #undef _GL_ALREADY_INCLUDING_SIGNAL_H |
c2588d0f001a
pthread_sigmask: Make declaration C++ safe.
Bruno Haible <bruno@clisp.org>
parents:
35055
diff
changeset
|
54 |
34531
aebcca9ddd62
Allow multiple gnulib generated include files to be combined.
Bruno Haible <bruno@clisp.org>
parents:
34377
diff
changeset
|
55 #ifndef _@GUARD_PREFIX@_SIGNAL_H |
aebcca9ddd62
Allow multiple gnulib generated include files to be combined.
Bruno Haible <bruno@clisp.org>
parents:
34377
diff
changeset
|
56 #define _@GUARD_PREFIX@_SIGNAL_H |
28950
cde07c866610
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
57 |
37590
11e138cf1762
signal_h: Fix Android build
Kevin Cernekee <cernekee@google.com>
parents:
37528
diff
changeset
|
58 /* Mac OS X 10.3, FreeBSD 6.4, OpenBSD 3.8, OSF/1 4.0, Solaris 2.6, Android |
11e138cf1762
signal_h: Fix Android build
Kevin Cernekee <cernekee@google.com>
parents:
37528
diff
changeset
|
59 declare pthread_sigmask in <pthread.h>, not in <signal.h>. |
35059
698898219a1e
pthread_sigmask: Ensure declaration in <signal.h>.
Bruno Haible <bruno@clisp.org>
parents:
35056
diff
changeset
|
60 But avoid namespace pollution on glibc systems.*/ |
698898219a1e
pthread_sigmask: Ensure declaration in <signal.h>.
Bruno Haible <bruno@clisp.org>
parents:
35056
diff
changeset
|
61 #if (@GNULIB_PTHREAD_SIGMASK@ || defined GNULIB_POSIXCHECK) \ |
37590
11e138cf1762
signal_h: Fix Android build
Kevin Cernekee <cernekee@google.com>
parents:
37528
diff
changeset
|
62 && ((defined __APPLE__ && defined __MACH__) \ |
11e138cf1762
signal_h: Fix Android build
Kevin Cernekee <cernekee@google.com>
parents:
37528
diff
changeset
|
63 || defined __FreeBSD__ || defined __OpenBSD__ || defined __osf__ \ |
11e138cf1762
signal_h: Fix Android build
Kevin Cernekee <cernekee@google.com>
parents:
37528
diff
changeset
|
64 || defined __sun || defined __ANDROID__) \ |
35059
698898219a1e
pthread_sigmask: Ensure declaration in <signal.h>.
Bruno Haible <bruno@clisp.org>
parents:
35056
diff
changeset
|
65 && ! defined __GLIBC__ |
698898219a1e
pthread_sigmask: Ensure declaration in <signal.h>.
Bruno Haible <bruno@clisp.org>
parents:
35056
diff
changeset
|
66 # include <pthread.h> |
698898219a1e
pthread_sigmask: Ensure declaration in <signal.h>.
Bruno Haible <bruno@clisp.org>
parents:
35056
diff
changeset
|
67 #endif |
698898219a1e
pthread_sigmask: Ensure declaration in <signal.h>.
Bruno Haible <bruno@clisp.org>
parents:
35056
diff
changeset
|
68 |
32629
9a24ca590ba9
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
32457
diff
changeset
|
69 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ |
9a24ca590ba9
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
32457
diff
changeset
|
70 |
32457
c7ecc0826315
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
32250
diff
changeset
|
71 /* The definition of _GL_ARG_NONNULL is copied here. */ |
28950
cde07c866610
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
72 |
32457
c7ecc0826315
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
32250
diff
changeset
|
73 /* The definition of _GL_WARN_ON_USE is copied here. */ |
32113
7fdd5d6b4fea
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
31115
diff
changeset
|
74 |
31115
b639c3f9e6b1
signal.h: always support 'volatile sig_atomic_t'
Eric Blake <ebb9@byu.net>
parents:
30397
diff
changeset
|
75 /* On AIX, sig_atomic_t already includes volatile. C99 requires that |
b639c3f9e6b1
signal.h: always support 'volatile sig_atomic_t'
Eric Blake <ebb9@byu.net>
parents:
30397
diff
changeset
|
76 'volatile sig_atomic_t' ignore the extra modifier, but C89 did not. |
b639c3f9e6b1
signal.h: always support 'volatile sig_atomic_t'
Eric Blake <ebb9@byu.net>
parents:
30397
diff
changeset
|
77 Hence, redefine this to a non-volatile type as needed. */ |
b639c3f9e6b1
signal.h: always support 'volatile sig_atomic_t'
Eric Blake <ebb9@byu.net>
parents:
30397
diff
changeset
|
78 #if ! @HAVE_TYPE_VOLATILE_SIG_ATOMIC_T@ |
33965
a40b2c4c777b
Allow multiple gnulib generated replacements to coexist.
Bruno Haible <bruno@clisp.org>
parents:
33770
diff
changeset
|
79 # if !GNULIB_defined_sig_atomic_t |
31115
b639c3f9e6b1
signal.h: always support 'volatile sig_atomic_t'
Eric Blake <ebb9@byu.net>
parents:
30397
diff
changeset
|
80 typedef int rpl_sig_atomic_t; |
33965
a40b2c4c777b
Allow multiple gnulib generated replacements to coexist.
Bruno Haible <bruno@clisp.org>
parents:
33770
diff
changeset
|
81 # undef sig_atomic_t |
a40b2c4c777b
Allow multiple gnulib generated replacements to coexist.
Bruno Haible <bruno@clisp.org>
parents:
33770
diff
changeset
|
82 # define sig_atomic_t rpl_sig_atomic_t |
a40b2c4c777b
Allow multiple gnulib generated replacements to coexist.
Bruno Haible <bruno@clisp.org>
parents:
33770
diff
changeset
|
83 # define GNULIB_defined_sig_atomic_t 1 |
a40b2c4c777b
Allow multiple gnulib generated replacements to coexist.
Bruno Haible <bruno@clisp.org>
parents:
33770
diff
changeset
|
84 # endif |
31115
b639c3f9e6b1
signal.h: always support 'volatile sig_atomic_t'
Eric Blake <ebb9@byu.net>
parents:
30397
diff
changeset
|
85 #endif |
b639c3f9e6b1
signal.h: always support 'volatile sig_atomic_t'
Eric Blake <ebb9@byu.net>
parents:
30397
diff
changeset
|
86 |
32226
a8de5cccb0e5
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
32113
diff
changeset
|
87 /* A set or mask of signals. */ |
a8de5cccb0e5
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
32113
diff
changeset
|
88 #if !@HAVE_SIGSET_T@ |
33965
a40b2c4c777b
Allow multiple gnulib generated replacements to coexist.
Bruno Haible <bruno@clisp.org>
parents:
33770
diff
changeset
|
89 # if !GNULIB_defined_sigset_t |
32226
a8de5cccb0e5
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
32113
diff
changeset
|
90 typedef unsigned int sigset_t; |
33965
a40b2c4c777b
Allow multiple gnulib generated replacements to coexist.
Bruno Haible <bruno@clisp.org>
parents:
33770
diff
changeset
|
91 # define GNULIB_defined_sigset_t 1 |
a40b2c4c777b
Allow multiple gnulib generated replacements to coexist.
Bruno Haible <bruno@clisp.org>
parents:
33770
diff
changeset
|
92 # endif |
32226
a8de5cccb0e5
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
32113
diff
changeset
|
93 #endif |
a8de5cccb0e5
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
32113
diff
changeset
|
94 |
34377
22a5fff524ea
signal: Define sighandler_t.
Bruno Haible <bruno@clisp.org>
parents:
33965
diff
changeset
|
95 /* Define sighandler_t, the type of signal handlers. A GNU extension. */ |
22a5fff524ea
signal: Define sighandler_t.
Bruno Haible <bruno@clisp.org>
parents:
33965
diff
changeset
|
96 #if !@HAVE_SIGHANDLER_T@ |
22a5fff524ea
signal: Define sighandler_t.
Bruno Haible <bruno@clisp.org>
parents:
33965
diff
changeset
|
97 # ifdef __cplusplus |
22a5fff524ea
signal: Define sighandler_t.
Bruno Haible <bruno@clisp.org>
parents:
33965
diff
changeset
|
98 extern "C" { |
22a5fff524ea
signal: Define sighandler_t.
Bruno Haible <bruno@clisp.org>
parents:
33965
diff
changeset
|
99 # endif |
22a5fff524ea
signal: Define sighandler_t.
Bruno Haible <bruno@clisp.org>
parents:
33965
diff
changeset
|
100 # if !GNULIB_defined_sighandler_t |
22a5fff524ea
signal: Define sighandler_t.
Bruno Haible <bruno@clisp.org>
parents:
33965
diff
changeset
|
101 typedef void (*sighandler_t) (int); |
22a5fff524ea
signal: Define sighandler_t.
Bruno Haible <bruno@clisp.org>
parents:
33965
diff
changeset
|
102 # define GNULIB_defined_sighandler_t 1 |
22a5fff524ea
signal: Define sighandler_t.
Bruno Haible <bruno@clisp.org>
parents:
33965
diff
changeset
|
103 # endif |
22a5fff524ea
signal: Define sighandler_t.
Bruno Haible <bruno@clisp.org>
parents:
33965
diff
changeset
|
104 # ifdef __cplusplus |
22a5fff524ea
signal: Define sighandler_t.
Bruno Haible <bruno@clisp.org>
parents:
33965
diff
changeset
|
105 } |
22a5fff524ea
signal: Define sighandler_t.
Bruno Haible <bruno@clisp.org>
parents:
33965
diff
changeset
|
106 # endif |
22a5fff524ea
signal: Define sighandler_t.
Bruno Haible <bruno@clisp.org>
parents:
33965
diff
changeset
|
107 #endif |
22a5fff524ea
signal: Define sighandler_t.
Bruno Haible <bruno@clisp.org>
parents:
33965
diff
changeset
|
108 |
28950
cde07c866610
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
109 |
30174
be50cfde3f08
Support signal handling with SIGPIPE on native Windows platforms.
Bruno Haible <bruno@clisp.org>
parents:
30066
diff
changeset
|
110 #if @GNULIB_SIGNAL_H_SIGPIPE@ |
be50cfde3f08
Support signal handling with SIGPIPE on native Windows platforms.
Bruno Haible <bruno@clisp.org>
parents:
30066
diff
changeset
|
111 # ifndef SIGPIPE |
be50cfde3f08
Support signal handling with SIGPIPE on native Windows platforms.
Bruno Haible <bruno@clisp.org>
parents:
30066
diff
changeset
|
112 /* Define SIGPIPE to a value that does not overlap with other signals. */ |
be50cfde3f08
Support signal handling with SIGPIPE on native Windows platforms.
Bruno Haible <bruno@clisp.org>
parents:
30066
diff
changeset
|
113 # define SIGPIPE 13 |
be50cfde3f08
Support signal handling with SIGPIPE on native Windows platforms.
Bruno Haible <bruno@clisp.org>
parents:
30066
diff
changeset
|
114 # define GNULIB_defined_SIGPIPE 1 |
be50cfde3f08
Support signal handling with SIGPIPE on native Windows platforms.
Bruno Haible <bruno@clisp.org>
parents:
30066
diff
changeset
|
115 /* To actually use SIGPIPE, you also need the gnulib modules 'sigprocmask', |
be50cfde3f08
Support signal handling with SIGPIPE on native Windows platforms.
Bruno Haible <bruno@clisp.org>
parents:
30066
diff
changeset
|
116 'write', 'stdio'. */ |
be50cfde3f08
Support signal handling with SIGPIPE on native Windows platforms.
Bruno Haible <bruno@clisp.org>
parents:
30066
diff
changeset
|
117 # endif |
be50cfde3f08
Support signal handling with SIGPIPE on native Windows platforms.
Bruno Haible <bruno@clisp.org>
parents:
30066
diff
changeset
|
118 #endif |
be50cfde3f08
Support signal handling with SIGPIPE on native Windows platforms.
Bruno Haible <bruno@clisp.org>
parents:
30066
diff
changeset
|
119 |
be50cfde3f08
Support signal handling with SIGPIPE on native Windows platforms.
Bruno Haible <bruno@clisp.org>
parents:
30066
diff
changeset
|
120 |
33698 | 121 /* Maximum signal number + 1. */ |
122 #ifndef NSIG | |
123 # if defined __TANDEM | |
124 # define NSIG 32 | |
125 # endif | |
126 #endif | |
127 | |
128 | |
35034
96eee4b97625
pthread_sigmask: new module
Paul Eggert <eggert@cs.ucla.edu>
parents:
34531
diff
changeset
|
129 #if @GNULIB_PTHREAD_SIGMASK@ |
35061
65ae13992d49
pthread_sigmask: Fix link requirements on OSF/1 5.1 and with pth.
Bruno Haible <bruno@clisp.org>
parents:
35060
diff
changeset
|
130 # if @REPLACE_PTHREAD_SIGMASK@ |
65ae13992d49
pthread_sigmask: Fix link requirements on OSF/1 5.1 and with pth.
Bruno Haible <bruno@clisp.org>
parents:
35060
diff
changeset
|
131 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
65ae13992d49
pthread_sigmask: Fix link requirements on OSF/1 5.1 and with pth.
Bruno Haible <bruno@clisp.org>
parents:
35060
diff
changeset
|
132 # undef pthread_sigmask |
65ae13992d49
pthread_sigmask: Fix link requirements on OSF/1 5.1 and with pth.
Bruno Haible <bruno@clisp.org>
parents:
35060
diff
changeset
|
133 # define pthread_sigmask rpl_pthread_sigmask |
65ae13992d49
pthread_sigmask: Fix link requirements on OSF/1 5.1 and with pth.
Bruno Haible <bruno@clisp.org>
parents:
35060
diff
changeset
|
134 # endif |
65ae13992d49
pthread_sigmask: Fix link requirements on OSF/1 5.1 and with pth.
Bruno Haible <bruno@clisp.org>
parents:
35060
diff
changeset
|
135 _GL_FUNCDECL_RPL (pthread_sigmask, int, |
65ae13992d49
pthread_sigmask: Fix link requirements on OSF/1 5.1 and with pth.
Bruno Haible <bruno@clisp.org>
parents:
35060
diff
changeset
|
136 (int how, const sigset_t *new_mask, sigset_t *old_mask)); |
65ae13992d49
pthread_sigmask: Fix link requirements on OSF/1 5.1 and with pth.
Bruno Haible <bruno@clisp.org>
parents:
35060
diff
changeset
|
137 _GL_CXXALIAS_RPL (pthread_sigmask, int, |
65ae13992d49
pthread_sigmask: Fix link requirements on OSF/1 5.1 and with pth.
Bruno Haible <bruno@clisp.org>
parents:
35060
diff
changeset
|
138 (int how, const sigset_t *new_mask, sigset_t *old_mask)); |
65ae13992d49
pthread_sigmask: Fix link requirements on OSF/1 5.1 and with pth.
Bruno Haible <bruno@clisp.org>
parents:
35060
diff
changeset
|
139 # else |
39207
ca2c3817b8a6
pthread_sigmask: Avoid compilation error on mingw.
Bruno Haible <bruno@clisp.org>
parents:
39199
diff
changeset
|
140 # if !(@HAVE_PTHREAD_SIGMASK@ || defined pthread_sigmask) |
35055
c652c288c696
pthread_sigmask: Fix return value.
Bruno Haible <bruno@clisp.org>
parents:
35034
diff
changeset
|
141 _GL_FUNCDECL_SYS (pthread_sigmask, int, |
c652c288c696
pthread_sigmask: Fix return value.
Bruno Haible <bruno@clisp.org>
parents:
35034
diff
changeset
|
142 (int how, const sigset_t *new_mask, sigset_t *old_mask)); |
35061
65ae13992d49
pthread_sigmask: Fix link requirements on OSF/1 5.1 and with pth.
Bruno Haible <bruno@clisp.org>
parents:
35060
diff
changeset
|
143 # endif |
35056
c2588d0f001a
pthread_sigmask: Make declaration C++ safe.
Bruno Haible <bruno@clisp.org>
parents:
35055
diff
changeset
|
144 _GL_CXXALIAS_SYS (pthread_sigmask, int, |
c2588d0f001a
pthread_sigmask: Make declaration C++ safe.
Bruno Haible <bruno@clisp.org>
parents:
35055
diff
changeset
|
145 (int how, const sigset_t *new_mask, sigset_t *old_mask)); |
35061
65ae13992d49
pthread_sigmask: Fix link requirements on OSF/1 5.1 and with pth.
Bruno Haible <bruno@clisp.org>
parents:
35060
diff
changeset
|
146 # endif |
35056
c2588d0f001a
pthread_sigmask: Make declaration C++ safe.
Bruno Haible <bruno@clisp.org>
parents:
35055
diff
changeset
|
147 _GL_CXXALIASWARN (pthread_sigmask); |
35034
96eee4b97625
pthread_sigmask: new module
Paul Eggert <eggert@cs.ucla.edu>
parents:
34531
diff
changeset
|
148 #elif defined GNULIB_POSIXCHECK |
96eee4b97625
pthread_sigmask: new module
Paul Eggert <eggert@cs.ucla.edu>
parents:
34531
diff
changeset
|
149 # undef pthread_sigmask |
96eee4b97625
pthread_sigmask: new module
Paul Eggert <eggert@cs.ucla.edu>
parents:
34531
diff
changeset
|
150 # if HAVE_RAW_DECL_PTHREAD_SIGMASK |
96eee4b97625
pthread_sigmask: new module
Paul Eggert <eggert@cs.ucla.edu>
parents:
34531
diff
changeset
|
151 _GL_WARN_ON_USE (pthread_sigmask, "pthread_sigmask is not portable - " |
96eee4b97625
pthread_sigmask: new module
Paul Eggert <eggert@cs.ucla.edu>
parents:
34531
diff
changeset
|
152 "use gnulib module pthread_sigmask for portability"); |
96eee4b97625
pthread_sigmask: new module
Paul Eggert <eggert@cs.ucla.edu>
parents:
34531
diff
changeset
|
153 # endif |
96eee4b97625
pthread_sigmask: new module
Paul Eggert <eggert@cs.ucla.edu>
parents:
34531
diff
changeset
|
154 #endif |
96eee4b97625
pthread_sigmask: new module
Paul Eggert <eggert@cs.ucla.edu>
parents:
34531
diff
changeset
|
155 |
96eee4b97625
pthread_sigmask: new module
Paul Eggert <eggert@cs.ucla.edu>
parents:
34531
diff
changeset
|
156 |
35446 | 157 #if @GNULIB_RAISE@ |
158 # if @REPLACE_RAISE@ | |
159 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) | |
160 # undef raise | |
161 # define raise rpl_raise | |
162 # endif | |
163 _GL_FUNCDECL_RPL (raise, int, (int sig)); | |
164 _GL_CXXALIAS_RPL (raise, int, (int sig)); | |
165 # else | |
166 # if !@HAVE_RAISE@ | |
167 _GL_FUNCDECL_SYS (raise, int, (int sig)); | |
168 # endif | |
169 _GL_CXXALIAS_SYS (raise, int, (int sig)); | |
170 # endif | |
171 _GL_CXXALIASWARN (raise); | |
172 #elif defined GNULIB_POSIXCHECK | |
173 # undef raise | |
174 /* Assume raise is always declared. */ | |
175 _GL_WARN_ON_USE (raise, "raise can crash on native Windows - " | |
176 "use gnulib module raise for portability"); | |
177 #endif | |
178 | |
179 | |
32226
a8de5cccb0e5
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
32113
diff
changeset
|
180 #if @GNULIB_SIGPROCMASK@ |
a8de5cccb0e5
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
32113
diff
changeset
|
181 # if !@HAVE_POSIX_SIGNALBLOCKING@ |
28950
cde07c866610
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
182 |
35485
95023d7ffbc1
raise: Fix double declaration with modules 'sigprocmask' and 'sigpipe'.
Bruno Haible <bruno@clisp.org>
parents:
35446
diff
changeset
|
183 # ifndef GNULIB_defined_signal_blocking |
95023d7ffbc1
raise: Fix double declaration with modules 'sigprocmask' and 'sigpipe'.
Bruno Haible <bruno@clisp.org>
parents:
35446
diff
changeset
|
184 # define GNULIB_defined_signal_blocking 1 |
95023d7ffbc1
raise: Fix double declaration with modules 'sigprocmask' and 'sigpipe'.
Bruno Haible <bruno@clisp.org>
parents:
35446
diff
changeset
|
185 # endif |
95023d7ffbc1
raise: Fix double declaration with modules 'sigprocmask' and 'sigpipe'.
Bruno Haible <bruno@clisp.org>
parents:
35446
diff
changeset
|
186 |
28950
cde07c866610
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
187 /* Maximum signal number + 1. */ |
32226
a8de5cccb0e5
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
32113
diff
changeset
|
188 # ifndef NSIG |
a8de5cccb0e5
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
32113
diff
changeset
|
189 # define NSIG 32 |
a8de5cccb0e5
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
32113
diff
changeset
|
190 # endif |
28950
cde07c866610
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
191 |
cde07c866610
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
192 /* This code supports only 32 signals. */ |
33965
a40b2c4c777b
Allow multiple gnulib generated replacements to coexist.
Bruno Haible <bruno@clisp.org>
parents:
33770
diff
changeset
|
193 # if !GNULIB_defined_verify_NSIG_constraint |
33478
eea97d87082f
prefer (X ? 1 : -1) when converting from boolean (1,0) to int (1,-1)
Paul Eggert <eggert@cs.ucla.edu>
parents:
33452
diff
changeset
|
194 typedef int verify_NSIG_constraint[NSIG <= 32 ? 1 : -1]; |
33965
a40b2c4c777b
Allow multiple gnulib generated replacements to coexist.
Bruno Haible <bruno@clisp.org>
parents:
33770
diff
changeset
|
195 # define GNULIB_defined_verify_NSIG_constraint 1 |
a40b2c4c777b
Allow multiple gnulib generated replacements to coexist.
Bruno Haible <bruno@clisp.org>
parents:
33770
diff
changeset
|
196 # endif |
28950
cde07c866610
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
197 |
32629
9a24ca590ba9
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
32457
diff
changeset
|
198 # endif |
9a24ca590ba9
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
32457
diff
changeset
|
199 |
37178
e736826b86c7
signal: OS X port of sigaddset etc. + extern inline
Paul Eggert <eggert@cs.ucla.edu>
parents:
36940
diff
changeset
|
200 /* When also using extern inline, suppress the use of static inline in |
e736826b86c7
signal: OS X port of sigaddset etc. + extern inline
Paul Eggert <eggert@cs.ucla.edu>
parents:
36940
diff
changeset
|
201 standard headers of problematic Apple configurations, as Libc at |
e736826b86c7
signal: OS X port of sigaddset etc. + extern inline
Paul Eggert <eggert@cs.ucla.edu>
parents:
36940
diff
changeset
|
202 least through Libc-825.26 (2013-04-09) mishandles it; see, e.g., |
39154
55dc3d465b51
maint: shorten https://lists.gnu.org/archive/html/... links
Jim Meyering <meyering@fb.com>
parents:
38846
diff
changeset
|
203 <https://lists.gnu.org/r/bug-gnulib/2012-12/msg00023.html>. |
37178
e736826b86c7
signal: OS X port of sigaddset etc. + extern inline
Paul Eggert <eggert@cs.ucla.edu>
parents:
36940
diff
changeset
|
204 Perhaps Apple will fix this some day. */ |
e736826b86c7
signal: OS X port of sigaddset etc. + extern inline
Paul Eggert <eggert@cs.ucla.edu>
parents:
36940
diff
changeset
|
205 #if (defined _GL_EXTERN_INLINE_IN_USE && defined __APPLE__ \ |
e736826b86c7
signal: OS X port of sigaddset etc. + extern inline
Paul Eggert <eggert@cs.ucla.edu>
parents:
36940
diff
changeset
|
206 && (defined __i386__ || defined __x86_64__)) |
e736826b86c7
signal: OS X port of sigaddset etc. + extern inline
Paul Eggert <eggert@cs.ucla.edu>
parents:
36940
diff
changeset
|
207 # undef sigaddset |
e736826b86c7
signal: OS X port of sigaddset etc. + extern inline
Paul Eggert <eggert@cs.ucla.edu>
parents:
36940
diff
changeset
|
208 # undef sigdelset |
e736826b86c7
signal: OS X port of sigaddset etc. + extern inline
Paul Eggert <eggert@cs.ucla.edu>
parents:
36940
diff
changeset
|
209 # undef sigemptyset |
e736826b86c7
signal: OS X port of sigaddset etc. + extern inline
Paul Eggert <eggert@cs.ucla.edu>
parents:
36940
diff
changeset
|
210 # undef sigfillset |
e736826b86c7
signal: OS X port of sigaddset etc. + extern inline
Paul Eggert <eggert@cs.ucla.edu>
parents:
36940
diff
changeset
|
211 # undef sigismember |
e736826b86c7
signal: OS X port of sigaddset etc. + extern inline
Paul Eggert <eggert@cs.ucla.edu>
parents:
36940
diff
changeset
|
212 #endif |
e736826b86c7
signal: OS X port of sigaddset etc. + extern inline
Paul Eggert <eggert@cs.ucla.edu>
parents:
36940
diff
changeset
|
213 |
28950
cde07c866610
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
214 /* Test whether a given signal is contained in a signal set. */ |
32713
a91515f44ea2
signal: Undefine macro definitions in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
32629
diff
changeset
|
215 # if @HAVE_POSIX_SIGNALBLOCKING@ |
36626
fa36c6a7c96f
Write "Mac OS X" instead of "MacOS X".
Bruno Haible <bruno@clisp.org>
parents:
35892
diff
changeset
|
216 /* This function is defined as a macro on Mac OS X. */ |
32713
a91515f44ea2
signal: Undefine macro definitions in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
32629
diff
changeset
|
217 # if defined __cplusplus && defined GNULIB_NAMESPACE |
a91515f44ea2
signal: Undefine macro definitions in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
32629
diff
changeset
|
218 # undef sigismember |
a91515f44ea2
signal: Undefine macro definitions in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
32629
diff
changeset
|
219 # endif |
a91515f44ea2
signal: Undefine macro definitions in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
32629
diff
changeset
|
220 # else |
32629
9a24ca590ba9
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
32457
diff
changeset
|
221 _GL_FUNCDECL_SYS (sigismember, int, (const sigset_t *set, int sig) |
9a24ca590ba9
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
32457
diff
changeset
|
222 _GL_ARG_NONNULL ((1))); |
9a24ca590ba9
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
32457
diff
changeset
|
223 # endif |
9a24ca590ba9
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
32457
diff
changeset
|
224 _GL_CXXALIAS_SYS (sigismember, int, (const sigset_t *set, int sig)); |
9a24ca590ba9
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
32457
diff
changeset
|
225 _GL_CXXALIASWARN (sigismember); |
28950
cde07c866610
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
226 |
cde07c866610
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
227 /* Initialize a signal set to the empty set. */ |
32713
a91515f44ea2
signal: Undefine macro definitions in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
32629
diff
changeset
|
228 # if @HAVE_POSIX_SIGNALBLOCKING@ |
36626
fa36c6a7c96f
Write "Mac OS X" instead of "MacOS X".
Bruno Haible <bruno@clisp.org>
parents:
35892
diff
changeset
|
229 /* This function is defined as a macro on Mac OS X. */ |
32713
a91515f44ea2
signal: Undefine macro definitions in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
32629
diff
changeset
|
230 # if defined __cplusplus && defined GNULIB_NAMESPACE |
a91515f44ea2
signal: Undefine macro definitions in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
32629
diff
changeset
|
231 # undef sigemptyset |
a91515f44ea2
signal: Undefine macro definitions in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
32629
diff
changeset
|
232 # endif |
a91515f44ea2
signal: Undefine macro definitions in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
32629
diff
changeset
|
233 # else |
32629
9a24ca590ba9
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
32457
diff
changeset
|
234 _GL_FUNCDECL_SYS (sigemptyset, int, (sigset_t *set) _GL_ARG_NONNULL ((1))); |
9a24ca590ba9
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
32457
diff
changeset
|
235 # endif |
9a24ca590ba9
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
32457
diff
changeset
|
236 _GL_CXXALIAS_SYS (sigemptyset, int, (sigset_t *set)); |
9a24ca590ba9
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
32457
diff
changeset
|
237 _GL_CXXALIASWARN (sigemptyset); |
28950
cde07c866610
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
238 |
cde07c866610
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
239 /* Add a signal to a signal set. */ |
32713
a91515f44ea2
signal: Undefine macro definitions in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
32629
diff
changeset
|
240 # if @HAVE_POSIX_SIGNALBLOCKING@ |
36626
fa36c6a7c96f
Write "Mac OS X" instead of "MacOS X".
Bruno Haible <bruno@clisp.org>
parents:
35892
diff
changeset
|
241 /* This function is defined as a macro on Mac OS X. */ |
32713
a91515f44ea2
signal: Undefine macro definitions in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
32629
diff
changeset
|
242 # if defined __cplusplus && defined GNULIB_NAMESPACE |
a91515f44ea2
signal: Undefine macro definitions in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
32629
diff
changeset
|
243 # undef sigaddset |
a91515f44ea2
signal: Undefine macro definitions in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
32629
diff
changeset
|
244 # endif |
a91515f44ea2
signal: Undefine macro definitions in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
32629
diff
changeset
|
245 # else |
32629
9a24ca590ba9
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
32457
diff
changeset
|
246 _GL_FUNCDECL_SYS (sigaddset, int, (sigset_t *set, int sig) |
9a24ca590ba9
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
32457
diff
changeset
|
247 _GL_ARG_NONNULL ((1))); |
9a24ca590ba9
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
32457
diff
changeset
|
248 # endif |
9a24ca590ba9
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
32457
diff
changeset
|
249 _GL_CXXALIAS_SYS (sigaddset, int, (sigset_t *set, int sig)); |
9a24ca590ba9
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
32457
diff
changeset
|
250 _GL_CXXALIASWARN (sigaddset); |
28950
cde07c866610
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
251 |
cde07c866610
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
252 /* Remove a signal from a signal set. */ |
32713
a91515f44ea2
signal: Undefine macro definitions in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
32629
diff
changeset
|
253 # if @HAVE_POSIX_SIGNALBLOCKING@ |
36626
fa36c6a7c96f
Write "Mac OS X" instead of "MacOS X".
Bruno Haible <bruno@clisp.org>
parents:
35892
diff
changeset
|
254 /* This function is defined as a macro on Mac OS X. */ |
32713
a91515f44ea2
signal: Undefine macro definitions in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
32629
diff
changeset
|
255 # if defined __cplusplus && defined GNULIB_NAMESPACE |
a91515f44ea2
signal: Undefine macro definitions in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
32629
diff
changeset
|
256 # undef sigdelset |
a91515f44ea2
signal: Undefine macro definitions in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
32629
diff
changeset
|
257 # endif |
a91515f44ea2
signal: Undefine macro definitions in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
32629
diff
changeset
|
258 # else |
32629
9a24ca590ba9
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
32457
diff
changeset
|
259 _GL_FUNCDECL_SYS (sigdelset, int, (sigset_t *set, int sig) |
9a24ca590ba9
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
32457
diff
changeset
|
260 _GL_ARG_NONNULL ((1))); |
9a24ca590ba9
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
32457
diff
changeset
|
261 # endif |
9a24ca590ba9
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
32457
diff
changeset
|
262 _GL_CXXALIAS_SYS (sigdelset, int, (sigset_t *set, int sig)); |
9a24ca590ba9
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
32457
diff
changeset
|
263 _GL_CXXALIASWARN (sigdelset); |
28950
cde07c866610
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
264 |
cde07c866610
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
265 /* Fill a signal set with all possible signals. */ |
32713
a91515f44ea2
signal: Undefine macro definitions in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
32629
diff
changeset
|
266 # if @HAVE_POSIX_SIGNALBLOCKING@ |
36626
fa36c6a7c96f
Write "Mac OS X" instead of "MacOS X".
Bruno Haible <bruno@clisp.org>
parents:
35892
diff
changeset
|
267 /* This function is defined as a macro on Mac OS X. */ |
32713
a91515f44ea2
signal: Undefine macro definitions in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
32629
diff
changeset
|
268 # if defined __cplusplus && defined GNULIB_NAMESPACE |
a91515f44ea2
signal: Undefine macro definitions in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
32629
diff
changeset
|
269 # undef sigfillset |
a91515f44ea2
signal: Undefine macro definitions in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
32629
diff
changeset
|
270 # endif |
a91515f44ea2
signal: Undefine macro definitions in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
32629
diff
changeset
|
271 # else |
32629
9a24ca590ba9
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
32457
diff
changeset
|
272 _GL_FUNCDECL_SYS (sigfillset, int, (sigset_t *set) _GL_ARG_NONNULL ((1))); |
9a24ca590ba9
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
32457
diff
changeset
|
273 # endif |
9a24ca590ba9
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
32457
diff
changeset
|
274 _GL_CXXALIAS_SYS (sigfillset, int, (sigset_t *set)); |
9a24ca590ba9
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
32457
diff
changeset
|
275 _GL_CXXALIASWARN (sigfillset); |
28950
cde07c866610
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
276 |
cde07c866610
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
277 /* Return the set of those blocked signals that are pending. */ |
32629
9a24ca590ba9
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
32457
diff
changeset
|
278 # if !@HAVE_POSIX_SIGNALBLOCKING@ |
9a24ca590ba9
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
32457
diff
changeset
|
279 _GL_FUNCDECL_SYS (sigpending, int, (sigset_t *set) _GL_ARG_NONNULL ((1))); |
9a24ca590ba9
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
32457
diff
changeset
|
280 # endif |
9a24ca590ba9
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
32457
diff
changeset
|
281 _GL_CXXALIAS_SYS (sigpending, int, (sigset_t *set)); |
9a24ca590ba9
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
32457
diff
changeset
|
282 _GL_CXXALIASWARN (sigpending); |
28950
cde07c866610
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
283 |
cde07c866610
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
284 /* If OLD_SET is not NULL, put the current set of blocked signals in *OLD_SET. |
cde07c866610
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
285 Then, if SET is not NULL, affect the current set of blocked signals by |
cde07c866610
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
286 combining it with *SET as indicated in OPERATION. |
cde07c866610
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
287 In this implementation, you are not allowed to change a signal handler |
cde07c866610
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
288 while the signal is blocked. */ |
32629
9a24ca590ba9
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
32457
diff
changeset
|
289 # if !@HAVE_POSIX_SIGNALBLOCKING@ |
32226
a8de5cccb0e5
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
32113
diff
changeset
|
290 # define SIG_BLOCK 0 /* blocked_set = blocked_set | *set; */ |
a8de5cccb0e5
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
32113
diff
changeset
|
291 # define SIG_SETMASK 1 /* blocked_set = *set; */ |
a8de5cccb0e5
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
32113
diff
changeset
|
292 # define SIG_UNBLOCK 2 /* blocked_set = blocked_set & ~*set; */ |
32629
9a24ca590ba9
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
32457
diff
changeset
|
293 _GL_FUNCDECL_SYS (sigprocmask, int, |
9a24ca590ba9
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
32457
diff
changeset
|
294 (int operation, const sigset_t *set, sigset_t *old_set)); |
9a24ca590ba9
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
32457
diff
changeset
|
295 # endif |
9a24ca590ba9
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
32457
diff
changeset
|
296 _GL_CXXALIAS_SYS (sigprocmask, int, |
9a24ca590ba9
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
32457
diff
changeset
|
297 (int operation, const sigset_t *set, sigset_t *old_set)); |
9a24ca590ba9
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
32457
diff
changeset
|
298 _GL_CXXALIASWARN (sigprocmask); |
28950
cde07c866610
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
299 |
29919
84003504e43e
Improve robustness of sigprocmask by overriding signal.
Eric Blake <ebb9@byu.net>
parents:
29000
diff
changeset
|
300 /* Install the handler FUNC for signal SIG, and return the previous |
84003504e43e
Improve robustness of sigprocmask by overriding signal.
Eric Blake <ebb9@byu.net>
parents:
29000
diff
changeset
|
301 handler. */ |
32629
9a24ca590ba9
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
32457
diff
changeset
|
302 # ifdef __cplusplus |
9a24ca590ba9
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
32457
diff
changeset
|
303 extern "C" { |
9a24ca590ba9
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
32457
diff
changeset
|
304 # endif |
33965
a40b2c4c777b
Allow multiple gnulib generated replacements to coexist.
Bruno Haible <bruno@clisp.org>
parents:
33770
diff
changeset
|
305 # if !GNULIB_defined_function_taking_int_returning_void_t |
32629
9a24ca590ba9
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
32457
diff
changeset
|
306 typedef void (*_gl_function_taking_int_returning_void_t) (int); |
33965
a40b2c4c777b
Allow multiple gnulib generated replacements to coexist.
Bruno Haible <bruno@clisp.org>
parents:
33770
diff
changeset
|
307 # define GNULIB_defined_function_taking_int_returning_void_t 1 |
a40b2c4c777b
Allow multiple gnulib generated replacements to coexist.
Bruno Haible <bruno@clisp.org>
parents:
33770
diff
changeset
|
308 # endif |
32629
9a24ca590ba9
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
32457
diff
changeset
|
309 # ifdef __cplusplus |
9a24ca590ba9
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
32457
diff
changeset
|
310 } |
9a24ca590ba9
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
32457
diff
changeset
|
311 # endif |
9a24ca590ba9
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
32457
diff
changeset
|
312 # if !@HAVE_POSIX_SIGNALBLOCKING@ |
9a24ca590ba9
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
32457
diff
changeset
|
313 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
9a24ca590ba9
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
32457
diff
changeset
|
314 # define signal rpl_signal |
9a24ca590ba9
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
32457
diff
changeset
|
315 # endif |
9a24ca590ba9
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
32457
diff
changeset
|
316 _GL_FUNCDECL_RPL (signal, _gl_function_taking_int_returning_void_t, |
9a24ca590ba9
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
32457
diff
changeset
|
317 (int sig, _gl_function_taking_int_returning_void_t func)); |
9a24ca590ba9
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
32457
diff
changeset
|
318 _GL_CXXALIAS_RPL (signal, _gl_function_taking_int_returning_void_t, |
9a24ca590ba9
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
32457
diff
changeset
|
319 (int sig, _gl_function_taking_int_returning_void_t func)); |
9a24ca590ba9
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
32457
diff
changeset
|
320 # else |
9a24ca590ba9
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
32457
diff
changeset
|
321 _GL_CXXALIAS_SYS (signal, _gl_function_taking_int_returning_void_t, |
9a24ca590ba9
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
32457
diff
changeset
|
322 (int sig, _gl_function_taking_int_returning_void_t func)); |
9a24ca590ba9
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
32457
diff
changeset
|
323 # endif |
9a24ca590ba9
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
32457
diff
changeset
|
324 _GL_CXXALIASWARN (signal); |
30174
be50cfde3f08
Support signal handling with SIGPIPE on native Windows platforms.
Bruno Haible <bruno@clisp.org>
parents:
30066
diff
changeset
|
325 |
32629
9a24ca590ba9
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
32457
diff
changeset
|
326 # if !@HAVE_POSIX_SIGNALBLOCKING@ && GNULIB_defined_SIGPIPE |
35485
95023d7ffbc1
raise: Fix double declaration with modules 'sigprocmask' and 'sigpipe'.
Bruno Haible <bruno@clisp.org>
parents:
35446
diff
changeset
|
327 /* Raise signal SIGPIPE. */ |
95023d7ffbc1
raise: Fix double declaration with modules 'sigprocmask' and 'sigpipe'.
Bruno Haible <bruno@clisp.org>
parents:
35446
diff
changeset
|
328 _GL_EXTERN_C int _gl_raise_SIGPIPE (void); |
32629
9a24ca590ba9
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
32457
diff
changeset
|
329 # endif |
30174
be50cfde3f08
Support signal handling with SIGPIPE on native Windows platforms.
Bruno Haible <bruno@clisp.org>
parents:
30066
diff
changeset
|
330 |
32226
a8de5cccb0e5
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
32113
diff
changeset
|
331 #elif defined GNULIB_POSIXCHECK |
a8de5cccb0e5
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
32113
diff
changeset
|
332 # undef sigaddset |
32457
c7ecc0826315
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
32250
diff
changeset
|
333 # if HAVE_RAW_DECL_SIGADDSET |
c7ecc0826315
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
32250
diff
changeset
|
334 _GL_WARN_ON_USE (sigaddset, "sigaddset is unportable - " |
c7ecc0826315
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
32250
diff
changeset
|
335 "use the gnulib module sigprocmask for portability"); |
c7ecc0826315
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
32250
diff
changeset
|
336 # endif |
32226
a8de5cccb0e5
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
32113
diff
changeset
|
337 # undef sigdelset |
32457
c7ecc0826315
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
32250
diff
changeset
|
338 # if HAVE_RAW_DECL_SIGDELSET |
c7ecc0826315
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
32250
diff
changeset
|
339 _GL_WARN_ON_USE (sigdelset, "sigdelset is unportable - " |
c7ecc0826315
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
32250
diff
changeset
|
340 "use the gnulib module sigprocmask for portability"); |
c7ecc0826315
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
32250
diff
changeset
|
341 # endif |
32226
a8de5cccb0e5
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
32113
diff
changeset
|
342 # undef sigemptyset |
32457
c7ecc0826315
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
32250
diff
changeset
|
343 # if HAVE_RAW_DECL_SIGEMPTYSET |
c7ecc0826315
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
32250
diff
changeset
|
344 _GL_WARN_ON_USE (sigemptyset, "sigemptyset is unportable - " |
c7ecc0826315
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
32250
diff
changeset
|
345 "use the gnulib module sigprocmask for portability"); |
c7ecc0826315
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
32250
diff
changeset
|
346 # endif |
32226
a8de5cccb0e5
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
32113
diff
changeset
|
347 # undef sigfillset |
32457
c7ecc0826315
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
32250
diff
changeset
|
348 # if HAVE_RAW_DECL_SIGFILLSET |
c7ecc0826315
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
32250
diff
changeset
|
349 _GL_WARN_ON_USE (sigfillset, "sigfillset is unportable - " |
c7ecc0826315
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
32250
diff
changeset
|
350 "use the gnulib module sigprocmask for portability"); |
c7ecc0826315
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
32250
diff
changeset
|
351 # endif |
32226
a8de5cccb0e5
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
32113
diff
changeset
|
352 # undef sigismember |
32457
c7ecc0826315
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
32250
diff
changeset
|
353 # if HAVE_RAW_DECL_SIGISMEMBER |
c7ecc0826315
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
32250
diff
changeset
|
354 _GL_WARN_ON_USE (sigismember, "sigismember is unportable - " |
c7ecc0826315
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
32250
diff
changeset
|
355 "use the gnulib module sigprocmask for portability"); |
c7ecc0826315
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
32250
diff
changeset
|
356 # endif |
32226
a8de5cccb0e5
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
32113
diff
changeset
|
357 # undef sigpending |
32457
c7ecc0826315
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
32250
diff
changeset
|
358 # if HAVE_RAW_DECL_SIGPENDING |
c7ecc0826315
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
32250
diff
changeset
|
359 _GL_WARN_ON_USE (sigpending, "sigpending is unportable - " |
c7ecc0826315
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
32250
diff
changeset
|
360 "use the gnulib module sigprocmask for portability"); |
c7ecc0826315
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
32250
diff
changeset
|
361 # endif |
32226
a8de5cccb0e5
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
32113
diff
changeset
|
362 # undef sigprocmask |
32457
c7ecc0826315
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
32250
diff
changeset
|
363 # if HAVE_RAW_DECL_SIGPROCMASK |
c7ecc0826315
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
32250
diff
changeset
|
364 _GL_WARN_ON_USE (sigprocmask, "sigprocmask is unportable - " |
c7ecc0826315
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
32250
diff
changeset
|
365 "use the gnulib module sigprocmask for portability"); |
c7ecc0826315
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
32250
diff
changeset
|
366 # endif |
32226
a8de5cccb0e5
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
32113
diff
changeset
|
367 #endif /* @GNULIB_SIGPROCMASK@ */ |
29920
751ae2428ca1
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
29919
diff
changeset
|
368 |
30174
be50cfde3f08
Support signal handling with SIGPIPE on native Windows platforms.
Bruno Haible <bruno@clisp.org>
parents:
30066
diff
changeset
|
369 |
32226
a8de5cccb0e5
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
32113
diff
changeset
|
370 #if @GNULIB_SIGACTION@ |
a8de5cccb0e5
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
32113
diff
changeset
|
371 # if !@HAVE_SIGACTION@ |
29920
751ae2428ca1
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
29919
diff
changeset
|
372 |
32226
a8de5cccb0e5
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
32113
diff
changeset
|
373 # if !@HAVE_SIGINFO_T@ |
33965
a40b2c4c777b
Allow multiple gnulib generated replacements to coexist.
Bruno Haible <bruno@clisp.org>
parents:
33770
diff
changeset
|
374 |
a40b2c4c777b
Allow multiple gnulib generated replacements to coexist.
Bruno Haible <bruno@clisp.org>
parents:
33770
diff
changeset
|
375 # if !GNULIB_defined_siginfo_types |
a40b2c4c777b
Allow multiple gnulib generated replacements to coexist.
Bruno Haible <bruno@clisp.org>
parents:
33770
diff
changeset
|
376 |
29920
751ae2428ca1
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
29919
diff
changeset
|
377 /* Present to allow compilation, but unsupported by gnulib. */ |
751ae2428ca1
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
29919
diff
changeset
|
378 union sigval |
751ae2428ca1
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
29919
diff
changeset
|
379 { |
751ae2428ca1
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
29919
diff
changeset
|
380 int sival_int; |
751ae2428ca1
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
29919
diff
changeset
|
381 void *sival_ptr; |
751ae2428ca1
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
29919
diff
changeset
|
382 }; |
751ae2428ca1
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
29919
diff
changeset
|
383 |
751ae2428ca1
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
29919
diff
changeset
|
384 /* Present to allow compilation, but unsupported by gnulib. */ |
751ae2428ca1
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
29919
diff
changeset
|
385 struct siginfo_t |
751ae2428ca1
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
29919
diff
changeset
|
386 { |
751ae2428ca1
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
29919
diff
changeset
|
387 int si_signo; |
751ae2428ca1
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
29919
diff
changeset
|
388 int si_code; |
751ae2428ca1
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
29919
diff
changeset
|
389 int si_errno; |
751ae2428ca1
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
29919
diff
changeset
|
390 pid_t si_pid; |
751ae2428ca1
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
29919
diff
changeset
|
391 uid_t si_uid; |
751ae2428ca1
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
29919
diff
changeset
|
392 void *si_addr; |
751ae2428ca1
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
29919
diff
changeset
|
393 int si_status; |
751ae2428ca1
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
29919
diff
changeset
|
394 long si_band; |
751ae2428ca1
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
29919
diff
changeset
|
395 union sigval si_value; |
751ae2428ca1
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
29919
diff
changeset
|
396 }; |
751ae2428ca1
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
29919
diff
changeset
|
397 typedef struct siginfo_t siginfo_t; |
33965
a40b2c4c777b
Allow multiple gnulib generated replacements to coexist.
Bruno Haible <bruno@clisp.org>
parents:
33770
diff
changeset
|
398 |
a40b2c4c777b
Allow multiple gnulib generated replacements to coexist.
Bruno Haible <bruno@clisp.org>
parents:
33770
diff
changeset
|
399 # define GNULIB_defined_siginfo_types 1 |
a40b2c4c777b
Allow multiple gnulib generated replacements to coexist.
Bruno Haible <bruno@clisp.org>
parents:
33770
diff
changeset
|
400 # endif |
a40b2c4c777b
Allow multiple gnulib generated replacements to coexist.
Bruno Haible <bruno@clisp.org>
parents:
33770
diff
changeset
|
401 |
32226
a8de5cccb0e5
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
32113
diff
changeset
|
402 # endif /* !@HAVE_SIGINFO_T@ */ |
29920
751ae2428ca1
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
29919
diff
changeset
|
403 |
29934 | 404 /* We assume that platforms which lack the sigaction() function also lack |
405 the 'struct sigaction' type, and vice versa. */ | |
29920
751ae2428ca1
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
29919
diff
changeset
|
406 |
33965
a40b2c4c777b
Allow multiple gnulib generated replacements to coexist.
Bruno Haible <bruno@clisp.org>
parents:
33770
diff
changeset
|
407 # if !GNULIB_defined_struct_sigaction |
a40b2c4c777b
Allow multiple gnulib generated replacements to coexist.
Bruno Haible <bruno@clisp.org>
parents:
33770
diff
changeset
|
408 |
29920
751ae2428ca1
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
29919
diff
changeset
|
409 struct sigaction |
751ae2428ca1
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
29919
diff
changeset
|
410 { |
751ae2428ca1
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
29919
diff
changeset
|
411 union |
751ae2428ca1
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
29919
diff
changeset
|
412 { |
751ae2428ca1
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
29919
diff
changeset
|
413 void (*_sa_handler) (int); |
751ae2428ca1
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
29919
diff
changeset
|
414 /* Present to allow compilation, but unsupported by gnulib. POSIX |
751ae2428ca1
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
29919
diff
changeset
|
415 says that implementations may, but not must, make sa_sigaction |
751ae2428ca1
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
29919
diff
changeset
|
416 overlap with sa_handler, but we know of no implementation where |
751ae2428ca1
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
29919
diff
changeset
|
417 they do not overlap. */ |
751ae2428ca1
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
29919
diff
changeset
|
418 void (*_sa_sigaction) (int, siginfo_t *, void *); |
751ae2428ca1
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
29919
diff
changeset
|
419 } _sa_func; |
751ae2428ca1
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
29919
diff
changeset
|
420 sigset_t sa_mask; |
751ae2428ca1
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
29919
diff
changeset
|
421 /* Not all POSIX flags are supported. */ |
751ae2428ca1
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
29919
diff
changeset
|
422 int sa_flags; |
751ae2428ca1
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
29919
diff
changeset
|
423 }; |
33965
a40b2c4c777b
Allow multiple gnulib generated replacements to coexist.
Bruno Haible <bruno@clisp.org>
parents:
33770
diff
changeset
|
424 # define sa_handler _sa_func._sa_handler |
a40b2c4c777b
Allow multiple gnulib generated replacements to coexist.
Bruno Haible <bruno@clisp.org>
parents:
33770
diff
changeset
|
425 # define sa_sigaction _sa_func._sa_sigaction |
29920
751ae2428ca1
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
29919
diff
changeset
|
426 /* Unsupported flags are not present. */ |
33965
a40b2c4c777b
Allow multiple gnulib generated replacements to coexist.
Bruno Haible <bruno@clisp.org>
parents:
33770
diff
changeset
|
427 # define SA_RESETHAND 1 |
a40b2c4c777b
Allow multiple gnulib generated replacements to coexist.
Bruno Haible <bruno@clisp.org>
parents:
33770
diff
changeset
|
428 # define SA_NODEFER 2 |
a40b2c4c777b
Allow multiple gnulib generated replacements to coexist.
Bruno Haible <bruno@clisp.org>
parents:
33770
diff
changeset
|
429 # define SA_RESTART 4 |
a40b2c4c777b
Allow multiple gnulib generated replacements to coexist.
Bruno Haible <bruno@clisp.org>
parents:
33770
diff
changeset
|
430 |
a40b2c4c777b
Allow multiple gnulib generated replacements to coexist.
Bruno Haible <bruno@clisp.org>
parents:
33770
diff
changeset
|
431 # define GNULIB_defined_struct_sigaction 1 |
a40b2c4c777b
Allow multiple gnulib generated replacements to coexist.
Bruno Haible <bruno@clisp.org>
parents:
33770
diff
changeset
|
432 # endif |
29920
751ae2428ca1
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
29919
diff
changeset
|
433 |
32629
9a24ca590ba9
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
32457
diff
changeset
|
434 _GL_FUNCDECL_SYS (sigaction, int, (int, const struct sigaction *restrict, |
9a24ca590ba9
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
32457
diff
changeset
|
435 struct sigaction *restrict)); |
29920
751ae2428ca1
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
29919
diff
changeset
|
436 |
32226
a8de5cccb0e5
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
32113
diff
changeset
|
437 # elif !@HAVE_STRUCT_SIGACTION_SA_SIGACTION@ |
a8de5cccb0e5
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
32113
diff
changeset
|
438 |
a8de5cccb0e5
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
32113
diff
changeset
|
439 # define sa_sigaction sa_handler |
30012
4decebc67b8b
c-stack: fix regression on Irix 5.3 from 2008-06-21
Eric Blake <ebb9@byu.net>
parents:
29934
diff
changeset
|
440 |
32226
a8de5cccb0e5
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
32113
diff
changeset
|
441 # endif /* !@HAVE_SIGACTION@, !@HAVE_STRUCT_SIGACTION_SA_SIGACTION@ */ |
32629
9a24ca590ba9
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
32457
diff
changeset
|
442 |
9a24ca590ba9
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
32457
diff
changeset
|
443 _GL_CXXALIAS_SYS (sigaction, int, (int, const struct sigaction *restrict, |
9a24ca590ba9
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
32457
diff
changeset
|
444 struct sigaction *restrict)); |
9a24ca590ba9
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
32457
diff
changeset
|
445 _GL_CXXALIASWARN (sigaction); |
9a24ca590ba9
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
32457
diff
changeset
|
446 |
32226
a8de5cccb0e5
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
32113
diff
changeset
|
447 #elif defined GNULIB_POSIXCHECK |
a8de5cccb0e5
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
32113
diff
changeset
|
448 # undef sigaction |
32457
c7ecc0826315
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
32250
diff
changeset
|
449 # if HAVE_RAW_DECL_SIGACTION |
c7ecc0826315
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
32250
diff
changeset
|
450 _GL_WARN_ON_USE (sigaction, "sigaction is unportable - " |
c7ecc0826315
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
32250
diff
changeset
|
451 "use the gnulib module sigaction for portability"); |
c7ecc0826315
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
32250
diff
changeset
|
452 # endif |
32226
a8de5cccb0e5
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
32113
diff
changeset
|
453 #endif |
28950
cde07c866610
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
454 |
30397
6ce98e89158e
Define a dummy SA_NODEFER macro on Interix.
Bruno Haible <bruno@clisp.org>
parents:
30346
diff
changeset
|
455 /* Some systems don't have SA_NODEFER. */ |
6ce98e89158e
Define a dummy SA_NODEFER macro on Interix.
Bruno Haible <bruno@clisp.org>
parents:
30346
diff
changeset
|
456 #ifndef SA_NODEFER |
6ce98e89158e
Define a dummy SA_NODEFER macro on Interix.
Bruno Haible <bruno@clisp.org>
parents:
30346
diff
changeset
|
457 # define SA_NODEFER 0 |
6ce98e89158e
Define a dummy SA_NODEFER macro on Interix.
Bruno Haible <bruno@clisp.org>
parents:
30346
diff
changeset
|
458 #endif |
6ce98e89158e
Define a dummy SA_NODEFER macro on Interix.
Bruno Haible <bruno@clisp.org>
parents:
30346
diff
changeset
|
459 |
6ce98e89158e
Define a dummy SA_NODEFER macro on Interix.
Bruno Haible <bruno@clisp.org>
parents:
30346
diff
changeset
|
460 |
34531
aebcca9ddd62
Allow multiple gnulib generated include files to be combined.
Bruno Haible <bruno@clisp.org>
parents:
34377
diff
changeset
|
461 #endif /* _@GUARD_PREFIX@_SIGNAL_H */ |
aebcca9ddd62
Allow multiple gnulib generated include files to be combined.
Bruno Haible <bruno@clisp.org>
parents:
34377
diff
changeset
|
462 #endif /* _@GUARD_PREFIX@_SIGNAL_H */ |
28950
cde07c866610
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
463 #endif |