Mercurial > hg > octave-lojdl > gnulib-hg
annotate lib/signal.in.h @ 13761:a19ace3ba849
Avoid line length limitation from HP NonStop system header files.
* m4/include_next.m4 (gl_INCLUDE_NEXT): Define also PRAGMA_COLUMNS.
* lib/arpa_inet.in.h: Use PRAGMA_COLUMNS.
* lib/ctype.in.h: Likewise.
* lib/dirent.in.h: Likewise.
* lib/errno.in.h: Likewise.
* lib/fcntl.in.h: Likewise.
* lib/float.in.h: Likewise.
* lib/getopt.in.h: Likewise.
* lib/iconv.in.h: Likewise.
* lib/inttypes.in.h: Likewise.
* lib/langinfo.in.h: Likewise.
* lib/locale.in.h: Likewise.
* lib/math.in.h: Likewise.
* lib/netdb.in.h: Likewise.
* lib/netinet_in.in.h: Likewise.
* lib/poll.in.h: Likewise.
* lib/pthread.in.h: Likewise.
* lib/pty.in.h: Likewise.
* lib/sched.in.h: Likewise.
* lib/se-selinux.in.h: Likewise.
* lib/search.in.h: Likewise.
* lib/signal.in.h: Likewise.
* lib/spawn.in.h: Likewise.
* lib/stdarg.in.h: Likewise.
* lib/stddef.in.h: Likewise.
* lib/stdint.in.h: Likewise.
* lib/stdio.in.h: Likewise.
* lib/stdlib.in.h: Likewise.
* lib/string.in.h: Likewise.
* lib/strings.in.h: Likewise.
* lib/sys_file.in.h: Likewise.
* lib/sys_ioctl.in.h: Likewise.
* lib/sys_select.in.h: Likewise.
* lib/sys_socket.in.h: Likewise.
* lib/sys_stat.in.h: Likewise.
* lib/sys_time.in.h: Likewise.
* lib/sys_times.in.h: Likewise.
* lib/sys_utsname.in.h: Likewise.
* lib/sys_wait.in.h: Likewise.
* lib/sysexits.in.h: Likewise.
* lib/termios.in.h: Likewise.
* lib/time.in.h: Likewise.
* lib/unistd.in.h: Likewise.
* lib/wchar.in.h: Likewise.
* lib/wctype.in.h: Likewise.
* modules/arpa_inet (Makefile.am): Substitute PRAGMA_COLUMNS.
* modules/ctype (Makefile.am): Likewise.
* modules/dirent (Makefile.am): Likewise.
* modules/errno (Makefile.am): Likewise.
* modules/fcntl-h (Makefile.am): Likewise.
* modules/float (Makefile.am): Likewise.
* modules/getopt-posix (Makefile.am): Likewise.
* modules/iconv-h (Makefile.am): Likewise.
* modules/inttypes (Makefile.am): Likewise.
* modules/langinfo (Makefile.am): Likewise.
* modules/locale (Makefile.am): Likewise.
* modules/math (Makefile.am): Likewise.
* modules/netdb (Makefile.am): Likewise.
* modules/netinet_in (Makefile.am): Likewise.
* modules/poll-h (Makefile.am): Likewise.
* modules/pthread (Makefile.am): Likewise.
* modules/pty (Makefile.am): Likewise.
* modules/sched (Makefile.am): Likewise.
* modules/search (Makefile.am): Likewise.
* modules/selinux-h (Makefile.am): Likewise.
* modules/signal (Makefile.am): Likewise.
* modules/spawn (Makefile.am): Likewise.
* modules/stdarg (Makefile.am): Likewise.
* modules/stddef (Makefile.am): Likewise.
* modules/stdint (Makefile.am): Likewise.
* modules/stdio (Makefile.am): Likewise.
* modules/stdlib (Makefile.am): Likewise.
* modules/string (Makefile.am): Likewise.
* modules/strings (Makefile.am): Likewise.
* modules/sys_file (Makefile.am): Likewise.
* modules/sys_ioctl (Makefile.am): Likewise.
* modules/sys_select (Makefile.am): Likewise.
* modules/sys_socket (Makefile.am): Likewise.
* modules/sys_stat (Makefile.am): Likewise.
* modules/sys_time (Makefile.am): Likewise.
* modules/sys_times (Makefile.am): Likewise.
* modules/sys_utsname (Makefile.am): Likewise.
* modules/sys_wait (Makefile.am): Likewise.
* modules/sysexits (Makefile.am): Likewise.
* modules/termios (Makefile.am): Likewise.
* modules/time (Makefile.am): Likewise.
* modules/unistd (Makefile.am): Likewise.
* modules/wchar (Makefile.am): Likewise.
* modules/wctype (Makefile.am): Likewise.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Mon, 04 Oct 2010 23:35:51 +0200 |
parents | 63c614c3b5e9 |
children | f4b0b520e409 |
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 |
12559
c2cbabec01dd
update nearly all FSF copyright year lists to include 2010
Jim Meyering <meyering@redhat.com>
parents:
12535
diff
changeset
|
3 Copyright (C) 2006-2010 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 |
9259
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
23 #if defined __need_sig_atomic_t || defined __need_sigset_t |
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
24 /* Special invocation convention inside glibc header files. */ |
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
25 |
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
26 # @INCLUDE_NEXT@ @NEXT_SIGNAL_H@ |
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
27 |
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
28 #else |
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
29 /* Normal invocation convention. */ |
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
30 |
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
31 #ifndef _GL_SIGNAL_H |
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
32 |
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
33 /* 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
|
34 #@INCLUDE_NEXT@ @NEXT_SIGNAL_H@ |
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
35 |
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
36 #ifndef _GL_SIGNAL_H |
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
37 #define _GL_SIGNAL_H |
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
38 |
12938
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
39 /* 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
|
40 |
12766
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
41 /* 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
|
42 |
12766
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
43 /* 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
|
44 |
10235 | 45 /* Define pid_t, uid_t. |
46 Also, mingw defines sigset_t not in <signal.h>, but in <sys/types.h>. */ | |
10229
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
47 #include <sys/types.h> |
9259
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
48 |
11424
2b94c0e7849d
signal.h: always support 'volatile sig_atomic_t'
Eric Blake <ebb9@byu.net>
parents:
10706
diff
changeset
|
49 /* 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
|
50 '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
|
51 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
|
52 #if ! @HAVE_TYPE_VOLATILE_SIG_ATOMIC_T@ |
2b94c0e7849d
signal.h: always support 'volatile sig_atomic_t'
Eric Blake <ebb9@byu.net>
parents:
10706
diff
changeset
|
53 typedef int rpl_sig_atomic_t; |
2b94c0e7849d
signal.h: always support 'volatile sig_atomic_t'
Eric Blake <ebb9@byu.net>
parents:
10706
diff
changeset
|
54 # undef sig_atomic_t |
2b94c0e7849d
signal.h: always support 'volatile sig_atomic_t'
Eric Blake <ebb9@byu.net>
parents:
10706
diff
changeset
|
55 # define sig_atomic_t rpl_sig_atomic_t |
2b94c0e7849d
signal.h: always support 'volatile sig_atomic_t'
Eric Blake <ebb9@byu.net>
parents:
10706
diff
changeset
|
56 #endif |
2b94c0e7849d
signal.h: always support 'volatile sig_atomic_t'
Eric Blake <ebb9@byu.net>
parents:
10706
diff
changeset
|
57 |
12535
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
58 /* A set or mask of signals. */ |
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
59 #if !@HAVE_SIGSET_T@ |
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
60 typedef unsigned int sigset_t; |
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
61 #endif |
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
62 |
9259
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
63 |
10483
5a24031ebf7d
Support signal handling with SIGPIPE on native Windows platforms.
Bruno Haible <bruno@clisp.org>
parents:
10375
diff
changeset
|
64 #if @GNULIB_SIGNAL_H_SIGPIPE@ |
5a24031ebf7d
Support signal handling with SIGPIPE on native Windows platforms.
Bruno Haible <bruno@clisp.org>
parents:
10375
diff
changeset
|
65 # ifndef SIGPIPE |
5a24031ebf7d
Support signal handling with SIGPIPE on native Windows platforms.
Bruno Haible <bruno@clisp.org>
parents:
10375
diff
changeset
|
66 /* 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
|
67 # define SIGPIPE 13 |
5a24031ebf7d
Support signal handling with SIGPIPE on native Windows platforms.
Bruno Haible <bruno@clisp.org>
parents:
10375
diff
changeset
|
68 # define GNULIB_defined_SIGPIPE 1 |
5a24031ebf7d
Support signal handling with SIGPIPE on native Windows platforms.
Bruno Haible <bruno@clisp.org>
parents:
10375
diff
changeset
|
69 /* 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
|
70 'write', 'stdio'. */ |
5a24031ebf7d
Support signal handling with SIGPIPE on native Windows platforms.
Bruno Haible <bruno@clisp.org>
parents:
10375
diff
changeset
|
71 # endif |
5a24031ebf7d
Support signal handling with SIGPIPE on native Windows platforms.
Bruno Haible <bruno@clisp.org>
parents:
10375
diff
changeset
|
72 #endif |
5a24031ebf7d
Support signal handling with SIGPIPE on native Windows platforms.
Bruno Haible <bruno@clisp.org>
parents:
10375
diff
changeset
|
73 |
5a24031ebf7d
Support signal handling with SIGPIPE on native Windows platforms.
Bruno Haible <bruno@clisp.org>
parents:
10375
diff
changeset
|
74 |
12535
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
75 #if @GNULIB_SIGPROCMASK@ |
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
76 # if !@HAVE_POSIX_SIGNALBLOCKING@ |
9259
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
77 |
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
78 /* Maximum signal number + 1. */ |
12535
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
79 # ifndef NSIG |
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
80 # define NSIG 32 |
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
81 # endif |
9259
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
82 |
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
83 /* This code supports only 32 signals. */ |
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
84 typedef int verify_NSIG_constraint[2 * (NSIG <= 32) - 1]; |
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
85 |
12938
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
86 # endif |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
87 |
9259
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
88 /* 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
|
89 # if @HAVE_POSIX_SIGNALBLOCKING@ |
63c614c3b5e9
signal: Undefine macro definitions in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12938
diff
changeset
|
90 /* This function is defined as a macro on MacOS X. */ |
63c614c3b5e9
signal: Undefine macro definitions in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12938
diff
changeset
|
91 # if defined __cplusplus && defined GNULIB_NAMESPACE |
63c614c3b5e9
signal: Undefine macro definitions in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12938
diff
changeset
|
92 # undef sigismember |
63c614c3b5e9
signal: Undefine macro definitions in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12938
diff
changeset
|
93 # endif |
63c614c3b5e9
signal: Undefine macro definitions in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12938
diff
changeset
|
94 # else |
12938
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
95 _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
|
96 _GL_ARG_NONNULL ((1))); |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
97 # endif |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
98 _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
|
99 _GL_CXXALIASWARN (sigismember); |
9259
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
100 |
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
101 /* 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
|
102 # if @HAVE_POSIX_SIGNALBLOCKING@ |
63c614c3b5e9
signal: Undefine macro definitions in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12938
diff
changeset
|
103 /* This function is defined as a macro on MacOS X. */ |
63c614c3b5e9
signal: Undefine macro definitions in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12938
diff
changeset
|
104 # if defined __cplusplus && defined GNULIB_NAMESPACE |
63c614c3b5e9
signal: Undefine macro definitions in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12938
diff
changeset
|
105 # undef sigemptyset |
63c614c3b5e9
signal: Undefine macro definitions in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12938
diff
changeset
|
106 # endif |
63c614c3b5e9
signal: Undefine macro definitions in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12938
diff
changeset
|
107 # else |
12938
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
108 _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
|
109 # endif |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
110 _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
|
111 _GL_CXXALIASWARN (sigemptyset); |
9259
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
112 |
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
113 /* 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
|
114 # if @HAVE_POSIX_SIGNALBLOCKING@ |
63c614c3b5e9
signal: Undefine macro definitions in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12938
diff
changeset
|
115 /* This function is defined as a macro on MacOS X. */ |
63c614c3b5e9
signal: Undefine macro definitions in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12938
diff
changeset
|
116 # if defined __cplusplus && defined GNULIB_NAMESPACE |
63c614c3b5e9
signal: Undefine macro definitions in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12938
diff
changeset
|
117 # undef sigaddset |
63c614c3b5e9
signal: Undefine macro definitions in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12938
diff
changeset
|
118 # endif |
63c614c3b5e9
signal: Undefine macro definitions in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12938
diff
changeset
|
119 # else |
12938
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
120 _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
|
121 _GL_ARG_NONNULL ((1))); |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
122 # endif |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
123 _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
|
124 _GL_CXXALIASWARN (sigaddset); |
9259
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
125 |
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
126 /* 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
|
127 # if @HAVE_POSIX_SIGNALBLOCKING@ |
63c614c3b5e9
signal: Undefine macro definitions in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12938
diff
changeset
|
128 /* This function is defined as a macro on MacOS X. */ |
63c614c3b5e9
signal: Undefine macro definitions in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12938
diff
changeset
|
129 # if defined __cplusplus && defined GNULIB_NAMESPACE |
63c614c3b5e9
signal: Undefine macro definitions in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12938
diff
changeset
|
130 # undef sigdelset |
63c614c3b5e9
signal: Undefine macro definitions in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12938
diff
changeset
|
131 # endif |
63c614c3b5e9
signal: Undefine macro definitions in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12938
diff
changeset
|
132 # else |
12938
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
133 _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
|
134 _GL_ARG_NONNULL ((1))); |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
135 # endif |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
136 _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
|
137 _GL_CXXALIASWARN (sigdelset); |
9259
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
138 |
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
139 /* 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
|
140 # if @HAVE_POSIX_SIGNALBLOCKING@ |
63c614c3b5e9
signal: Undefine macro definitions in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12938
diff
changeset
|
141 /* This function is defined as a macro on MacOS X. */ |
63c614c3b5e9
signal: Undefine macro definitions in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12938
diff
changeset
|
142 # if defined __cplusplus && defined GNULIB_NAMESPACE |
63c614c3b5e9
signal: Undefine macro definitions in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12938
diff
changeset
|
143 # undef sigfillset |
63c614c3b5e9
signal: Undefine macro definitions in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12938
diff
changeset
|
144 # endif |
63c614c3b5e9
signal: Undefine macro definitions in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12938
diff
changeset
|
145 # else |
12938
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
146 _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
|
147 # endif |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
148 _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
|
149 _GL_CXXALIASWARN (sigfillset); |
9259
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
150 |
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
151 /* 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
|
152 # if !@HAVE_POSIX_SIGNALBLOCKING@ |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
153 _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
|
154 # endif |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
155 _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
|
156 _GL_CXXALIASWARN (sigpending); |
9259
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
157 |
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
158 /* 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
|
159 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
|
160 combining it with *SET as indicated in OPERATION. |
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
161 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
|
162 while the signal is blocked. */ |
12938
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
163 # if !@HAVE_POSIX_SIGNALBLOCKING@ |
12535
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
164 # define SIG_BLOCK 0 /* blocked_set = blocked_set | *set; */ |
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
165 # define SIG_SETMASK 1 /* blocked_set = *set; */ |
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
166 # 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
|
167 _GL_FUNCDECL_SYS (sigprocmask, int, |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
168 (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
|
169 # endif |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
170 _GL_CXXALIAS_SYS (sigprocmask, int, |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
171 (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
|
172 _GL_CXXALIASWARN (sigprocmask); |
9259
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
173 |
10228
9b123d1aa781
Improve robustness of sigprocmask by overriding signal.
Eric Blake <ebb9@byu.net>
parents:
9309
diff
changeset
|
174 /* 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
|
175 handler. */ |
12938
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
176 # ifdef __cplusplus |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
177 extern "C" { |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
178 # endif |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
179 typedef void (*_gl_function_taking_int_returning_void_t) (int); |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
180 # ifdef __cplusplus |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
181 } |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
182 # endif |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
183 # if !@HAVE_POSIX_SIGNALBLOCKING@ |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
184 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
185 # define signal rpl_signal |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
186 # endif |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
187 _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
|
188 (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
|
189 _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
|
190 (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
|
191 # else |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
192 _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
|
193 (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
|
194 # endif |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
195 _GL_CXXALIASWARN (signal); |
10483
5a24031ebf7d
Support signal handling with SIGPIPE on native Windows platforms.
Bruno Haible <bruno@clisp.org>
parents:
10375
diff
changeset
|
196 |
5a24031ebf7d
Support signal handling with SIGPIPE on native Windows platforms.
Bruno Haible <bruno@clisp.org>
parents:
10375
diff
changeset
|
197 /* Raise signal SIG. */ |
12938
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
198 # if !@HAVE_POSIX_SIGNALBLOCKING@ && GNULIB_defined_SIGPIPE |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
199 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
12535
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
200 # undef raise |
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
201 # define raise rpl_raise |
12938
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
202 # endif |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
203 _GL_FUNCDECL_RPL (raise, int, (int sig)); |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
204 _GL_CXXALIAS_RPL (raise, int, (int sig)); |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
205 # else |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
206 _GL_CXXALIAS_SYS (raise, int, (int sig)); |
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_CXXALIASWARN (raise); |
10483
5a24031ebf7d
Support signal handling with SIGPIPE on native Windows platforms.
Bruno Haible <bruno@clisp.org>
parents:
10375
diff
changeset
|
209 |
12535
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
210 #elif defined GNULIB_POSIXCHECK |
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
211 # undef sigaddset |
12766
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
212 # if HAVE_RAW_DECL_SIGADDSET |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
213 _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
|
214 "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
|
215 # endif |
12535
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
216 # undef sigdelset |
12766
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
217 # if HAVE_RAW_DECL_SIGDELSET |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
218 _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
|
219 "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
|
220 # endif |
12535
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
221 # undef sigemptyset |
12766
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
222 # if HAVE_RAW_DECL_SIGEMPTYSET |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
223 _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
|
224 "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
|
225 # endif |
12535
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
226 # undef sigfillset |
12766
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
227 # if HAVE_RAW_DECL_SIGFILLSET |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
228 _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
|
229 "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
|
230 # endif |
12535
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
231 # undef sigismember |
12766
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
232 # if HAVE_RAW_DECL_SIGISMEMBER |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
233 _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
|
234 "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
|
235 # endif |
12535
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
236 # undef sigpending |
12766
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
237 # if HAVE_RAW_DECL_SIGPENDING |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
238 _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
|
239 "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
|
240 # endif |
12535
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
241 # undef sigprocmask |
12766
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
242 # if HAVE_RAW_DECL_SIGPROCMASK |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
243 _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
|
244 "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
|
245 # endif |
12535
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
246 #endif /* @GNULIB_SIGPROCMASK@ */ |
10229
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
247 |
10483
5a24031ebf7d
Support signal handling with SIGPIPE on native Windows platforms.
Bruno Haible <bruno@clisp.org>
parents:
10375
diff
changeset
|
248 |
12535
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
249 #if @GNULIB_SIGACTION@ |
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
250 # if !@HAVE_SIGACTION@ |
10229
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
251 |
12535
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
252 # if !@HAVE_SIGINFO_T@ |
10229
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
253 /* Present to allow compilation, but unsupported by gnulib. */ |
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
254 union sigval |
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
255 { |
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
256 int sival_int; |
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
257 void *sival_ptr; |
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
258 }; |
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
259 |
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
260 /* Present to allow compilation, but unsupported by gnulib. */ |
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
261 struct siginfo_t |
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
262 { |
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
263 int si_signo; |
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
264 int si_code; |
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
265 int si_errno; |
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
266 pid_t si_pid; |
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
267 uid_t si_uid; |
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
268 void *si_addr; |
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
269 int si_status; |
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
270 long si_band; |
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
271 union sigval si_value; |
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
272 }; |
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
273 typedef struct siginfo_t siginfo_t; |
12535
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
274 # endif /* !@HAVE_SIGINFO_T@ */ |
10229
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
275 |
10243 | 276 /* We assume that platforms which lack the sigaction() function also lack |
277 the 'struct sigaction' type, and vice versa. */ | |
10229
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
278 |
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
279 struct sigaction |
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
280 { |
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
281 union |
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
282 { |
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
283 void (*_sa_handler) (int); |
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
284 /* Present to allow compilation, but unsupported by gnulib. POSIX |
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
285 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
|
286 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
|
287 they do not overlap. */ |
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
288 void (*_sa_sigaction) (int, siginfo_t *, void *); |
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
289 } _sa_func; |
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
290 sigset_t sa_mask; |
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
291 /* Not all POSIX flags are supported. */ |
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
292 int sa_flags; |
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
293 }; |
12535
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
294 # define sa_handler _sa_func._sa_handler |
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
295 # define sa_sigaction _sa_func._sa_sigaction |
10229
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
296 /* Unsupported flags are not present. */ |
12535
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
297 # define SA_RESETHAND 1 |
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
298 # define SA_NODEFER 2 |
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
299 # define SA_RESTART 4 |
10229
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
300 |
12938
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
301 _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
|
302 struct sigaction *restrict)); |
10229
29502a2dd08a
New module sigaction, for mingw.
Eric Blake <ebb9@byu.net>
parents:
10228
diff
changeset
|
303 |
12535
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
304 # elif !@HAVE_STRUCT_SIGACTION_SA_SIGACTION@ |
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
305 |
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
306 # 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
|
307 |
12535
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
308 # 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
|
309 |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
310 _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
|
311 struct sigaction *restrict)); |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
312 _GL_CXXALIASWARN (sigaction); |
baf17c6b8bd7
signal: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
313 |
12535
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
314 #elif defined GNULIB_POSIXCHECK |
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
315 # undef sigaction |
12766
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
316 # if HAVE_RAW_DECL_SIGACTION |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
317 _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
|
318 "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
|
319 # endif |
12535
8c827f8e5f04
signal, spawn: use link warnings
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
320 #endif |
9259
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
321 |
10706
5a35e8f56744
Define a dummy SA_NODEFER macro on Interix.
Bruno Haible <bruno@clisp.org>
parents:
10655
diff
changeset
|
322 /* 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
|
323 #ifndef SA_NODEFER |
5a35e8f56744
Define a dummy SA_NODEFER macro on Interix.
Bruno Haible <bruno@clisp.org>
parents:
10655
diff
changeset
|
324 # define SA_NODEFER 0 |
5a35e8f56744
Define a dummy SA_NODEFER macro on Interix.
Bruno Haible <bruno@clisp.org>
parents:
10655
diff
changeset
|
325 #endif |
5a35e8f56744
Define a dummy SA_NODEFER macro on Interix.
Bruno Haible <bruno@clisp.org>
parents:
10655
diff
changeset
|
326 |
5a35e8f56744
Define a dummy SA_NODEFER macro on Interix.
Bruno Haible <bruno@clisp.org>
parents:
10655
diff
changeset
|
327 |
9259
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
328 #endif /* _GL_SIGNAL_H */ |
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
329 #endif /* _GL_SIGNAL_H */ |
cda94d6d670f
Rename signal_.h to signal.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
330 #endif |