|
Packit |
6c4009 |
/* The proper definitions for Linux's sigaction.
|
|
Packit |
6c4009 |
Copyright (C) 1993-2018 Free Software Foundation, Inc.
|
|
Packit |
6c4009 |
This file is part of the GNU C Library.
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
The GNU C Library is free software; you can redistribute it and/or
|
|
Packit |
6c4009 |
modify it under the terms of the GNU Lesser General Public
|
|
Packit |
6c4009 |
License as published by the Free Software Foundation; either
|
|
Packit |
6c4009 |
version 2.1 of the License, or (at your option) any later version.
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
The GNU C Library is distributed in the hope that it will be useful,
|
|
Packit |
6c4009 |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit |
6c4009 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit |
6c4009 |
Lesser General Public License for more details.
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
You should have received a copy of the GNU Lesser General Public
|
|
Packit |
6c4009 |
License along with the GNU C Library; if not, see
|
|
Packit |
6c4009 |
<http://www.gnu.org/licenses/>. */
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
#ifndef _BITS_SIGACTION_H
|
|
Packit |
6c4009 |
#define _BITS_SIGACTION_H 1
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
#ifndef _SIGNAL_H
|
|
Packit |
6c4009 |
# error "Never include <bits/sigaction.h> directly; use <signal.h> instead."
|
|
Packit |
6c4009 |
#endif
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
/* Structure describing the action to be taken when a signal arrives. */
|
|
Packit |
6c4009 |
struct sigaction
|
|
Packit |
6c4009 |
{
|
|
Packit |
6c4009 |
/* Signal handler. */
|
|
Packit |
6c4009 |
#if defined __USE_POSIX199309 || defined __USE_XOPEN_EXTENDED
|
|
Packit |
6c4009 |
union
|
|
Packit |
6c4009 |
{
|
|
Packit |
6c4009 |
/* Used if SA_SIGINFO is not set. */
|
|
Packit |
6c4009 |
__sighandler_t sa_handler;
|
|
Packit |
6c4009 |
/* Used if SA_SIGINFO is set. */
|
|
Packit |
6c4009 |
void (*sa_sigaction) (int, siginfo_t *, void *);
|
|
Packit |
6c4009 |
}
|
|
Packit |
6c4009 |
__sigaction_handler;
|
|
Packit |
6c4009 |
# define sa_handler __sigaction_handler.sa_handler
|
|
Packit |
6c4009 |
# define sa_sigaction __sigaction_handler.sa_sigaction
|
|
Packit |
6c4009 |
#else
|
|
Packit |
6c4009 |
__sighandler_t sa_handler;
|
|
Packit |
6c4009 |
#endif
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
/* Additional set of signals to be blocked. */
|
|
Packit |
6c4009 |
__sigset_t sa_mask;
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
/* Special flags. */
|
|
Packit |
6c4009 |
int sa_flags;
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
/* Restore handler. */
|
|
Packit |
6c4009 |
void (*sa_restorer) (void);
|
|
Packit |
6c4009 |
};
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
/* Bits in `sa_flags'. */
|
|
Packit |
6c4009 |
#define SA_NOCLDSTOP 1 /* Don't send SIGCHLD when children stop. */
|
|
Packit |
6c4009 |
#define SA_NOCLDWAIT 2 /* Don't create zombie on child death. */
|
|
Packit |
6c4009 |
#define SA_SIGINFO 4 /* Invoke signal-catching function with
|
|
Packit |
6c4009 |
three arguments instead of one. */
|
|
Packit |
6c4009 |
#if defined __USE_XOPEN_EXTENDED || defined __USE_MISC
|
|
Packit |
6c4009 |
# define SA_ONSTACK 0x08000000 /* Use signal stack by using `sa_restorer'. */
|
|
Packit |
6c4009 |
#endif
|
|
Packit |
6c4009 |
#if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8
|
|
Packit |
6c4009 |
# define SA_RESTART 0x10000000 /* Restart syscall on signal return. */
|
|
Packit |
6c4009 |
# define SA_NODEFER 0x40000000 /* Don't automatically block the signal when
|
|
Packit |
6c4009 |
its handler is being executed. */
|
|
Packit |
6c4009 |
# define SA_RESETHAND 0x80000000 /* Reset to SIG_DFL on entry to handler. */
|
|
Packit |
6c4009 |
#endif
|
|
Packit |
6c4009 |
#ifdef __USE_MISC
|
|
Packit |
6c4009 |
# define SA_INTERRUPT 0x20000000 /* Historical no-op. */
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
/* Some aliases for the SA_ constants. */
|
|
Packit |
6c4009 |
# define SA_NOMASK SA_NODEFER
|
|
Packit |
6c4009 |
# define SA_ONESHOT SA_RESETHAND
|
|
Packit |
6c4009 |
# define SA_STACK SA_ONSTACK
|
|
Packit |
6c4009 |
#endif
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
/* Values for the HOW argument to `sigprocmask'. */
|
|
Packit |
6c4009 |
#define SIG_BLOCK 0 /* Block signals. */
|
|
Packit |
6c4009 |
#define SIG_UNBLOCK 1 /* Unblock signals. */
|
|
Packit |
6c4009 |
#define SIG_SETMASK 2 /* Set the set of blocked signals. */
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
#endif
|