1 /* Copyright (C) 1991-2023 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
4 The GNU C Library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Lesser General Public
6 License as published by the Free Software Foundation; either
7 version 2.1 of the License, or (at your option) any later version.
9 The GNU C Library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Lesser General Public License for more details.
14 You should have received a copy of the GNU Lesser General Public
15 License along with the GNU C Library; if not, see
16 <https://www.gnu.org/licenses/>. */
18 #ifndef _BITS_SIGACTION_H
19 #define _BITS_SIGACTION_H 1
22 # error "Never include <bits/sigaction.h> directly; use <signal.h> instead."
25 /* These definitions match those used by the 4.4 BSD kernel.
26 If the operating system has a `sigaction' system call that correctly
27 implements the POSIX.1 behavior, there should be a system-dependent
28 version of this file that defines `struct sigaction' and the `SA_*'
29 constants appropriately. */
31 /* Structure describing the action to be taken when a signal arrives. */
35 #if defined __USE_POSIX199309 || defined __USE_XOPEN_EXTENDED
38 /* Used if SA_SIGINFO is not set. */
39 __sighandler_t sa_handler
;
40 /* Used if SA_SIGINFO is set. */
41 void (*sa_sigaction
) (int, siginfo_t
*, void *);
44 # define sa_handler __sigaction_handler.sa_handler
45 # define sa_sigaction __sigaction_handler.sa_sigaction
47 __sighandler_t sa_handler
;
50 /* Additional set of signals to be blocked. */
57 /* Bits in `sa_flags'. */
58 #if defined __USE_XOPEN_EXTENDED || defined __USE_MISC
59 # define SA_ONSTACK 0x0001 /* Take signal on signal stack. */
61 #if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8
62 # define SA_RESTART 0x0002 /* Restart syscall on signal return. */
63 # define SA_NODEFER 0x0010 /* Don't automatically block the signal when
64 its handler is being executed. */
65 # define SA_RESETHAND 0x0004 /* Reset to SIG_DFL on entry to handler. */
67 #define SA_NOCLDSTOP 0x0008 /* Don't send SIGCHLD when children stop. */
68 #define SA_SIGINFO 0x0040 /* Signal handler with SA_SIGINFO args */
71 # define SA_INTERRUPT 0 /* Historical no-op ("not SA_RESTART"). */
73 /* Some aliases for the SA_ constants. */
74 # define SA_NOMASK SA_NODEFER
75 # define SA_ONESHOT SA_RESETHAND
76 # define SA_STACK SA_ONSTACK
80 /* Values for the HOW argument to `sigprocmask'. */
81 #define SIG_BLOCK 1 /* Block signals. */
82 #define SIG_UNBLOCK 2 /* Unblock signals. */
83 #define SIG_SETMASK 3 /* Set the set of blocked signals. */