Blame bits/sigaction.h

Packit 6c4009
/* Copyright (C) 1991-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
/* These definitions match those used by the 4.4 BSD kernel.
Packit 6c4009
   If the operating system has a `sigaction' system call that correctly
Packit 6c4009
   implements the POSIX.1 behavior, there should be a system-dependent
Packit 6c4009
   version of this file that defines `struct sigaction' and the `SA_*'
Packit 6c4009
   constants appropriately.  */
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
Packit 6c4009
/* Bits in `sa_flags'.  */
Packit 6c4009
#if defined __USE_XOPEN_EXTENDED || defined __USE_MISC
Packit 6c4009
# define SA_ONSTACK	0x0001	/* Take signal on signal stack.  */
Packit 6c4009
#endif
Packit 6c4009
#if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8
Packit 6c4009
# define SA_RESTART	0x0002	/* Restart syscall on signal return.  */
Packit 6c4009
# define SA_NODEFER	0x0010	/* Don't automatically block the signal when
Packit 6c4009
				    its handler is being executed.  */
Packit 6c4009
# define SA_RESETHAND	0x0004	/* Reset to SIG_DFL on entry to handler.  */
Packit 6c4009
#endif
Packit 6c4009
#define	SA_NOCLDSTOP	0x0008	/* Don't send SIGCHLD when children stop.  */
Packit 6c4009
Packit 6c4009
#ifdef __USE_MISC
Packit 6c4009
# define SA_INTERRUPT	0	/* Historical no-op ("not SA_RESTART").  */
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
Packit 6c4009
/* Values for the HOW argument to `sigprocmask'.  */
Packit 6c4009
#define	SIG_BLOCK	1	/* Block signals.  */
Packit 6c4009
#define	SIG_UNBLOCK	2	/* Unblock signals.  */
Packit 6c4009
#define	SIG_SETMASK	3	/* Set the set of blocked signals.  */
Packit 6c4009
Packit 6c4009
#endif