Blame lib/signal.in.h

Packit 8f70b4
/* A GNU-like <signal.h>.
Packit 8f70b4
Packit 8f70b4
   Copyright (C) 2006-2018 Free Software Foundation, Inc.
Packit 8f70b4
Packit 8f70b4
   This program is free software: you can redistribute it and/or modify
Packit 8f70b4
   it under the terms of the GNU General Public License as published by
Packit 8f70b4
   the Free Software Foundation; either version 3 of the License, or
Packit 8f70b4
   (at your option) any later version.
Packit 8f70b4
Packit 8f70b4
   This program is distributed in the hope that it will be useful,
Packit 8f70b4
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 8f70b4
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit 8f70b4
   GNU General Public License for more details.
Packit 8f70b4
Packit 8f70b4
   You should have received a copy of the GNU General Public License
Packit 8f70b4
   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
Packit 8f70b4
Packit 8f70b4
#if __GNUC__ >= 3
Packit 8f70b4
@PRAGMA_SYSTEM_HEADER@
Packit 8f70b4
#endif
Packit 8f70b4
@PRAGMA_COLUMNS@
Packit 8f70b4
Packit 8f70b4
#if defined __need_sig_atomic_t || defined __need_sigset_t || defined _GL_ALREADY_INCLUDING_SIGNAL_H || (defined _SIGNAL_H && !defined __SIZEOF_PTHREAD_MUTEX_T)
Packit 8f70b4
/* Special invocation convention:
Packit 8f70b4
   - Inside glibc header files.
Packit 8f70b4
   - On glibc systems we have a sequence of nested includes
Packit 8f70b4
     <signal.h> -> <ucontext.h> -> <signal.h>.
Packit 8f70b4
     In this situation, the functions are not yet declared, therefore we cannot
Packit 8f70b4
     provide the C++ aliases.
Packit 8f70b4
   - On glibc systems with GCC 4.3 we have a sequence of nested includes
Packit 8f70b4
     <csignal> -> </usr/include/signal.h> -> <sys/ucontext.h> -> <signal.h>.
Packit 8f70b4
     In this situation, some of the functions are not yet declared, therefore
Packit 8f70b4
     we cannot provide the C++ aliases.  */
Packit 8f70b4
Packit 8f70b4
# @INCLUDE_NEXT@ @NEXT_SIGNAL_H@
Packit 8f70b4
Packit 8f70b4
#else
Packit 8f70b4
/* Normal invocation convention.  */
Packit 8f70b4
Packit 8f70b4
#ifndef _@GUARD_PREFIX@_SIGNAL_H
Packit 8f70b4
Packit 8f70b4
#define _GL_ALREADY_INCLUDING_SIGNAL_H
Packit 8f70b4
Packit 8f70b4
/* Define pid_t, uid_t.
Packit 8f70b4
   Also, mingw defines sigset_t not in <signal.h>, but in <sys/types.h>.
Packit 8f70b4
   On Solaris 10, <signal.h> includes <sys/types.h>, which eventually includes
Packit 8f70b4
   us; so include <sys/types.h> now, before the second inclusion guard.  */
Packit 8f70b4
#include <sys/types.h>
Packit 8f70b4
Packit 8f70b4
/* The include_next requires a split double-inclusion guard.  */
Packit 8f70b4
#@INCLUDE_NEXT@ @NEXT_SIGNAL_H@
Packit 8f70b4
Packit 8f70b4
#undef _GL_ALREADY_INCLUDING_SIGNAL_H
Packit 8f70b4
Packit 8f70b4
#ifndef _@GUARD_PREFIX@_SIGNAL_H
Packit 8f70b4
#define _@GUARD_PREFIX@_SIGNAL_H
Packit 8f70b4
Packit 8f70b4
/* Mac OS X 10.3, FreeBSD 6.4, OpenBSD 3.8, OSF/1 4.0, Solaris 2.6, Android
Packit 8f70b4
   declare pthread_sigmask in <pthread.h>, not in <signal.h>.
Packit 8f70b4
   But avoid namespace pollution on glibc systems.*/
Packit 8f70b4
#if (@GNULIB_PTHREAD_SIGMASK@ || defined GNULIB_POSIXCHECK) \
Packit 8f70b4
    && ((defined __APPLE__ && defined __MACH__) \
Packit 8f70b4
        || defined __FreeBSD__ || defined __OpenBSD__ || defined __osf__ \
Packit 8f70b4
        || defined __sun || defined __ANDROID__) \
Packit 8f70b4
    && ! defined __GLIBC__
Packit 8f70b4
# include <pthread.h>
Packit 8f70b4
#endif
Packit 8f70b4
Packit 8f70b4
/* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
Packit 8f70b4
Packit 8f70b4
/* The definition of _GL_ARG_NONNULL is copied here.  */
Packit 8f70b4
Packit 8f70b4
/* The definition of _GL_WARN_ON_USE is copied here.  */
Packit 8f70b4
Packit 8f70b4
/* On AIX, sig_atomic_t already includes volatile.  C99 requires that
Packit 8f70b4
   'volatile sig_atomic_t' ignore the extra modifier, but C89 did not.
Packit 8f70b4
   Hence, redefine this to a non-volatile type as needed.  */
Packit 8f70b4
#if ! @HAVE_TYPE_VOLATILE_SIG_ATOMIC_T@
Packit 8f70b4
# if !GNULIB_defined_sig_atomic_t
Packit 8f70b4
typedef int rpl_sig_atomic_t;
Packit 8f70b4
#  undef sig_atomic_t
Packit 8f70b4
#  define sig_atomic_t rpl_sig_atomic_t
Packit 8f70b4
#  define GNULIB_defined_sig_atomic_t 1
Packit 8f70b4
# endif
Packit 8f70b4
#endif
Packit 8f70b4
Packit 8f70b4
/* A set or mask of signals.  */
Packit 8f70b4
#if !@HAVE_SIGSET_T@
Packit 8f70b4
# if !GNULIB_defined_sigset_t
Packit 8f70b4
typedef unsigned int sigset_t;
Packit 8f70b4
#  define GNULIB_defined_sigset_t 1
Packit 8f70b4
# endif
Packit 8f70b4
#endif
Packit 8f70b4
Packit 8f70b4
/* Define sighandler_t, the type of signal handlers.  A GNU extension.  */
Packit 8f70b4
#if !@HAVE_SIGHANDLER_T@
Packit 8f70b4
# ifdef __cplusplus
Packit 8f70b4
extern "C" {
Packit 8f70b4
# endif
Packit 8f70b4
# if !GNULIB_defined_sighandler_t
Packit 8f70b4
typedef void (*sighandler_t) (int);
Packit 8f70b4
#  define GNULIB_defined_sighandler_t 1
Packit 8f70b4
# endif
Packit 8f70b4
# ifdef __cplusplus
Packit 8f70b4
}
Packit 8f70b4
# endif
Packit 8f70b4
#endif
Packit 8f70b4
Packit 8f70b4
Packit 8f70b4
#if @GNULIB_SIGNAL_H_SIGPIPE@
Packit 8f70b4
# ifndef SIGPIPE
Packit 8f70b4
/* Define SIGPIPE to a value that does not overlap with other signals.  */
Packit 8f70b4
#  define SIGPIPE 13
Packit 8f70b4
#  define GNULIB_defined_SIGPIPE 1
Packit 8f70b4
/* To actually use SIGPIPE, you also need the gnulib modules 'sigprocmask',
Packit 8f70b4
   'write', 'stdio'.  */
Packit 8f70b4
# endif
Packit 8f70b4
#endif
Packit 8f70b4
Packit 8f70b4
Packit 8f70b4
/* Maximum signal number + 1.  */
Packit 8f70b4
#ifndef NSIG
Packit 8f70b4
# if defined __TANDEM
Packit 8f70b4
#  define NSIG 32
Packit 8f70b4
# endif
Packit 8f70b4
#endif
Packit 8f70b4
Packit 8f70b4
Packit 8f70b4
#if @GNULIB_PTHREAD_SIGMASK@
Packit 8f70b4
# if @REPLACE_PTHREAD_SIGMASK@
Packit 8f70b4
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit 8f70b4
#   undef pthread_sigmask
Packit 8f70b4
#   define pthread_sigmask rpl_pthread_sigmask
Packit 8f70b4
#  endif
Packit 8f70b4
_GL_FUNCDECL_RPL (pthread_sigmask, int,
Packit 8f70b4
                  (int how, const sigset_t *new_mask, sigset_t *old_mask));
Packit 8f70b4
_GL_CXXALIAS_RPL (pthread_sigmask, int,
Packit 8f70b4
                  (int how, const sigset_t *new_mask, sigset_t *old_mask));
Packit 8f70b4
# else
Packit 8f70b4
#  if !(@HAVE_PTHREAD_SIGMASK@ || defined pthread_sigmask)
Packit 8f70b4
_GL_FUNCDECL_SYS (pthread_sigmask, int,
Packit 8f70b4
                  (int how, const sigset_t *new_mask, sigset_t *old_mask));
Packit 8f70b4
#  endif
Packit 8f70b4
_GL_CXXALIAS_SYS (pthread_sigmask, int,
Packit 8f70b4
                  (int how, const sigset_t *new_mask, sigset_t *old_mask));
Packit 8f70b4
# endif
Packit 8f70b4
_GL_CXXALIASWARN (pthread_sigmask);
Packit 8f70b4
#elif defined GNULIB_POSIXCHECK
Packit 8f70b4
# undef pthread_sigmask
Packit 8f70b4
# if HAVE_RAW_DECL_PTHREAD_SIGMASK
Packit 8f70b4
_GL_WARN_ON_USE (pthread_sigmask, "pthread_sigmask is not portable - "
Packit 8f70b4
                 "use gnulib module pthread_sigmask for portability");
Packit 8f70b4
# endif
Packit 8f70b4
#endif
Packit 8f70b4
Packit 8f70b4
Packit 8f70b4
#if @GNULIB_RAISE@
Packit 8f70b4
# if @REPLACE_RAISE@
Packit 8f70b4
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit 8f70b4
#   undef raise
Packit 8f70b4
#   define raise rpl_raise
Packit 8f70b4
#  endif
Packit 8f70b4
_GL_FUNCDECL_RPL (raise, int, (int sig));
Packit 8f70b4
_GL_CXXALIAS_RPL (raise, int, (int sig));
Packit 8f70b4
# else
Packit 8f70b4
#  if !@HAVE_RAISE@
Packit 8f70b4
_GL_FUNCDECL_SYS (raise, int, (int sig));
Packit 8f70b4
#  endif
Packit 8f70b4
_GL_CXXALIAS_SYS (raise, int, (int sig));
Packit 8f70b4
# endif
Packit 8f70b4
_GL_CXXALIASWARN (raise);
Packit 8f70b4
#elif defined GNULIB_POSIXCHECK
Packit 8f70b4
# undef raise
Packit 8f70b4
/* Assume raise is always declared.  */
Packit 8f70b4
_GL_WARN_ON_USE (raise, "raise can crash on native Windows - "
Packit 8f70b4
                 "use gnulib module raise for portability");
Packit 8f70b4
#endif
Packit 8f70b4
Packit 8f70b4
Packit 8f70b4
#if @GNULIB_SIGPROCMASK@
Packit 8f70b4
# if !@HAVE_POSIX_SIGNALBLOCKING@
Packit 8f70b4
Packit 8f70b4
#  ifndef GNULIB_defined_signal_blocking
Packit 8f70b4
#   define GNULIB_defined_signal_blocking 1
Packit 8f70b4
#  endif
Packit 8f70b4
Packit 8f70b4
/* Maximum signal number + 1.  */
Packit 8f70b4
#  ifndef NSIG
Packit 8f70b4
#   define NSIG 32
Packit 8f70b4
#  endif
Packit 8f70b4
Packit 8f70b4
/* This code supports only 32 signals.  */
Packit 8f70b4
#  if !GNULIB_defined_verify_NSIG_constraint
Packit 8f70b4
typedef int verify_NSIG_constraint[NSIG <= 32 ? 1 : -1];
Packit 8f70b4
#   define GNULIB_defined_verify_NSIG_constraint 1
Packit 8f70b4
#  endif
Packit 8f70b4
Packit 8f70b4
# endif
Packit 8f70b4
Packit 8f70b4
/* When also using extern inline, suppress the use of static inline in
Packit 8f70b4
   standard headers of problematic Apple configurations, as Libc at
Packit 8f70b4
   least through Libc-825.26 (2013-04-09) mishandles it; see, e.g.,
Packit 8f70b4
   <https://lists.gnu.org/r/bug-gnulib/2012-12/msg00023.html>.
Packit 8f70b4
   Perhaps Apple will fix this some day.  */
Packit 8f70b4
#if (defined _GL_EXTERN_INLINE_IN_USE && defined __APPLE__ \
Packit 8f70b4
     && (defined __i386__ || defined __x86_64__))
Packit 8f70b4
# undef sigaddset
Packit 8f70b4
# undef sigdelset
Packit 8f70b4
# undef sigemptyset
Packit 8f70b4
# undef sigfillset
Packit 8f70b4
# undef sigismember
Packit 8f70b4
#endif
Packit 8f70b4
Packit 8f70b4
/* Test whether a given signal is contained in a signal set.  */
Packit 8f70b4
# if @HAVE_POSIX_SIGNALBLOCKING@
Packit 8f70b4
/* This function is defined as a macro on Mac OS X.  */
Packit 8f70b4
#  if defined __cplusplus && defined GNULIB_NAMESPACE
Packit 8f70b4
#   undef sigismember
Packit 8f70b4
#  endif
Packit 8f70b4
# else
Packit 8f70b4
_GL_FUNCDECL_SYS (sigismember, int, (const sigset_t *set, int sig)
Packit 8f70b4
                                    _GL_ARG_NONNULL ((1)));
Packit 8f70b4
# endif
Packit 8f70b4
_GL_CXXALIAS_SYS (sigismember, int, (const sigset_t *set, int sig));
Packit 8f70b4
_GL_CXXALIASWARN (sigismember);
Packit 8f70b4
Packit 8f70b4
/* Initialize a signal set to the empty set.  */
Packit 8f70b4
# if @HAVE_POSIX_SIGNALBLOCKING@
Packit 8f70b4
/* This function is defined as a macro on Mac OS X.  */
Packit 8f70b4
#  if defined __cplusplus && defined GNULIB_NAMESPACE
Packit 8f70b4
#   undef sigemptyset
Packit 8f70b4
#  endif
Packit 8f70b4
# else
Packit 8f70b4
_GL_FUNCDECL_SYS (sigemptyset, int, (sigset_t *set) _GL_ARG_NONNULL ((1)));
Packit 8f70b4
# endif
Packit 8f70b4
_GL_CXXALIAS_SYS (sigemptyset, int, (sigset_t *set));
Packit 8f70b4
_GL_CXXALIASWARN (sigemptyset);
Packit 8f70b4
Packit 8f70b4
/* Add a signal to a signal set.  */
Packit 8f70b4
# if @HAVE_POSIX_SIGNALBLOCKING@
Packit 8f70b4
/* This function is defined as a macro on Mac OS X.  */
Packit 8f70b4
#  if defined __cplusplus && defined GNULIB_NAMESPACE
Packit 8f70b4
#   undef sigaddset
Packit 8f70b4
#  endif
Packit 8f70b4
# else
Packit 8f70b4
_GL_FUNCDECL_SYS (sigaddset, int, (sigset_t *set, int sig)
Packit 8f70b4
                                  _GL_ARG_NONNULL ((1)));
Packit 8f70b4
# endif
Packit 8f70b4
_GL_CXXALIAS_SYS (sigaddset, int, (sigset_t *set, int sig));
Packit 8f70b4
_GL_CXXALIASWARN (sigaddset);
Packit 8f70b4
Packit 8f70b4
/* Remove a signal from a signal set.  */
Packit 8f70b4
# if @HAVE_POSIX_SIGNALBLOCKING@
Packit 8f70b4
/* This function is defined as a macro on Mac OS X.  */
Packit 8f70b4
#  if defined __cplusplus && defined GNULIB_NAMESPACE
Packit 8f70b4
#   undef sigdelset
Packit 8f70b4
#  endif
Packit 8f70b4
# else
Packit 8f70b4
_GL_FUNCDECL_SYS (sigdelset, int, (sigset_t *set, int sig)
Packit 8f70b4
                                  _GL_ARG_NONNULL ((1)));
Packit 8f70b4
# endif
Packit 8f70b4
_GL_CXXALIAS_SYS (sigdelset, int, (sigset_t *set, int sig));
Packit 8f70b4
_GL_CXXALIASWARN (sigdelset);
Packit 8f70b4
Packit 8f70b4
/* Fill a signal set with all possible signals.  */
Packit 8f70b4
# if @HAVE_POSIX_SIGNALBLOCKING@
Packit 8f70b4
/* This function is defined as a macro on Mac OS X.  */
Packit 8f70b4
#  if defined __cplusplus && defined GNULIB_NAMESPACE
Packit 8f70b4
#   undef sigfillset
Packit 8f70b4
#  endif
Packit 8f70b4
# else
Packit 8f70b4
_GL_FUNCDECL_SYS (sigfillset, int, (sigset_t *set) _GL_ARG_NONNULL ((1)));
Packit 8f70b4
# endif
Packit 8f70b4
_GL_CXXALIAS_SYS (sigfillset, int, (sigset_t *set));
Packit 8f70b4
_GL_CXXALIASWARN (sigfillset);
Packit 8f70b4
Packit 8f70b4
/* Return the set of those blocked signals that are pending.  */
Packit 8f70b4
# if !@HAVE_POSIX_SIGNALBLOCKING@
Packit 8f70b4
_GL_FUNCDECL_SYS (sigpending, int, (sigset_t *set) _GL_ARG_NONNULL ((1)));
Packit 8f70b4
# endif
Packit 8f70b4
_GL_CXXALIAS_SYS (sigpending, int, (sigset_t *set));
Packit 8f70b4
_GL_CXXALIASWARN (sigpending);
Packit 8f70b4
Packit 8f70b4
/* If OLD_SET is not NULL, put the current set of blocked signals in *OLD_SET.
Packit 8f70b4
   Then, if SET is not NULL, affect the current set of blocked signals by
Packit 8f70b4
   combining it with *SET as indicated in OPERATION.
Packit 8f70b4
   In this implementation, you are not allowed to change a signal handler
Packit 8f70b4
   while the signal is blocked.  */
Packit 8f70b4
# if !@HAVE_POSIX_SIGNALBLOCKING@
Packit 8f70b4
#  define SIG_BLOCK   0  /* blocked_set = blocked_set | *set; */
Packit 8f70b4
#  define SIG_SETMASK 1  /* blocked_set = *set; */
Packit 8f70b4
#  define SIG_UNBLOCK 2  /* blocked_set = blocked_set & ~*set; */
Packit 8f70b4
_GL_FUNCDECL_SYS (sigprocmask, int,
Packit 8f70b4
                  (int operation, const sigset_t *set, sigset_t *old_set));
Packit 8f70b4
# endif
Packit 8f70b4
_GL_CXXALIAS_SYS (sigprocmask, int,
Packit 8f70b4
                  (int operation, const sigset_t *set, sigset_t *old_set));
Packit 8f70b4
_GL_CXXALIASWARN (sigprocmask);
Packit 8f70b4
Packit 8f70b4
/* Install the handler FUNC for signal SIG, and return the previous
Packit 8f70b4
   handler.  */
Packit 8f70b4
# ifdef __cplusplus
Packit 8f70b4
extern "C" {
Packit 8f70b4
# endif
Packit 8f70b4
# if !GNULIB_defined_function_taking_int_returning_void_t
Packit 8f70b4
typedef void (*_gl_function_taking_int_returning_void_t) (int);
Packit 8f70b4
#  define GNULIB_defined_function_taking_int_returning_void_t 1
Packit 8f70b4
# endif
Packit 8f70b4
# ifdef __cplusplus
Packit 8f70b4
}
Packit 8f70b4
# endif
Packit 8f70b4
# if !@HAVE_POSIX_SIGNALBLOCKING@
Packit 8f70b4
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit 8f70b4
#   define signal rpl_signal
Packit 8f70b4
#  endif
Packit 8f70b4
_GL_FUNCDECL_RPL (signal, _gl_function_taking_int_returning_void_t,
Packit 8f70b4
                  (int sig, _gl_function_taking_int_returning_void_t func));
Packit 8f70b4
_GL_CXXALIAS_RPL (signal, _gl_function_taking_int_returning_void_t,
Packit 8f70b4
                  (int sig, _gl_function_taking_int_returning_void_t func));
Packit 8f70b4
# else
Packit 8f70b4
_GL_CXXALIAS_SYS (signal, _gl_function_taking_int_returning_void_t,
Packit 8f70b4
                  (int sig, _gl_function_taking_int_returning_void_t func));
Packit 8f70b4
# endif
Packit 8f70b4
_GL_CXXALIASWARN (signal);
Packit 8f70b4
Packit 8f70b4
# if !@HAVE_POSIX_SIGNALBLOCKING@ && GNULIB_defined_SIGPIPE
Packit 8f70b4
/* Raise signal SIGPIPE.  */
Packit 8f70b4
_GL_EXTERN_C int _gl_raise_SIGPIPE (void);
Packit 8f70b4
# endif
Packit 8f70b4
Packit 8f70b4
#elif defined GNULIB_POSIXCHECK
Packit 8f70b4
# undef sigaddset
Packit 8f70b4
# if HAVE_RAW_DECL_SIGADDSET
Packit 8f70b4
_GL_WARN_ON_USE (sigaddset, "sigaddset is unportable - "
Packit 8f70b4
                 "use the gnulib module sigprocmask for portability");
Packit 8f70b4
# endif
Packit 8f70b4
# undef sigdelset
Packit 8f70b4
# if HAVE_RAW_DECL_SIGDELSET
Packit 8f70b4
_GL_WARN_ON_USE (sigdelset, "sigdelset is unportable - "
Packit 8f70b4
                 "use the gnulib module sigprocmask for portability");
Packit 8f70b4
# endif
Packit 8f70b4
# undef sigemptyset
Packit 8f70b4
# if HAVE_RAW_DECL_SIGEMPTYSET
Packit 8f70b4
_GL_WARN_ON_USE (sigemptyset, "sigemptyset is unportable - "
Packit 8f70b4
                 "use the gnulib module sigprocmask for portability");
Packit 8f70b4
# endif
Packit 8f70b4
# undef sigfillset
Packit 8f70b4
# if HAVE_RAW_DECL_SIGFILLSET
Packit 8f70b4
_GL_WARN_ON_USE (sigfillset, "sigfillset is unportable - "
Packit 8f70b4
                 "use the gnulib module sigprocmask for portability");
Packit 8f70b4
# endif
Packit 8f70b4
# undef sigismember
Packit 8f70b4
# if HAVE_RAW_DECL_SIGISMEMBER
Packit 8f70b4
_GL_WARN_ON_USE (sigismember, "sigismember is unportable - "
Packit 8f70b4
                 "use the gnulib module sigprocmask for portability");
Packit 8f70b4
# endif
Packit 8f70b4
# undef sigpending
Packit 8f70b4
# if HAVE_RAW_DECL_SIGPENDING
Packit 8f70b4
_GL_WARN_ON_USE (sigpending, "sigpending is unportable - "
Packit 8f70b4
                 "use the gnulib module sigprocmask for portability");
Packit 8f70b4
# endif
Packit 8f70b4
# undef sigprocmask
Packit 8f70b4
# if HAVE_RAW_DECL_SIGPROCMASK
Packit 8f70b4
_GL_WARN_ON_USE (sigprocmask, "sigprocmask is unportable - "
Packit 8f70b4
                 "use the gnulib module sigprocmask for portability");
Packit 8f70b4
# endif
Packit 8f70b4
#endif /* @GNULIB_SIGPROCMASK@ */
Packit 8f70b4
Packit 8f70b4
Packit 8f70b4
#if @GNULIB_SIGACTION@
Packit 8f70b4
# if !@HAVE_SIGACTION@
Packit 8f70b4
Packit 8f70b4
#  if !@HAVE_SIGINFO_T@
Packit 8f70b4
Packit 8f70b4
#   if !GNULIB_defined_siginfo_types
Packit 8f70b4
Packit 8f70b4
/* Present to allow compilation, but unsupported by gnulib.  */
Packit 8f70b4
union sigval
Packit 8f70b4
{
Packit 8f70b4
  int sival_int;
Packit 8f70b4
  void *sival_ptr;
Packit 8f70b4
};
Packit 8f70b4
Packit 8f70b4
/* Present to allow compilation, but unsupported by gnulib.  */
Packit 8f70b4
struct siginfo_t
Packit 8f70b4
{
Packit 8f70b4
  int si_signo;
Packit 8f70b4
  int si_code;
Packit 8f70b4
  int si_errno;
Packit 8f70b4
  pid_t si_pid;
Packit 8f70b4
  uid_t si_uid;
Packit 8f70b4
  void *si_addr;
Packit 8f70b4
  int si_status;
Packit 8f70b4
  long si_band;
Packit 8f70b4
  union sigval si_value;
Packit 8f70b4
};
Packit 8f70b4
typedef struct siginfo_t siginfo_t;
Packit 8f70b4
Packit 8f70b4
#    define GNULIB_defined_siginfo_types 1
Packit 8f70b4
#   endif
Packit 8f70b4
Packit 8f70b4
#  endif /* !@HAVE_SIGINFO_T@ */
Packit 8f70b4
Packit 8f70b4
/* We assume that platforms which lack the sigaction() function also lack
Packit 8f70b4
   the 'struct sigaction' type, and vice versa.  */
Packit 8f70b4
Packit 8f70b4
#  if !GNULIB_defined_struct_sigaction
Packit 8f70b4
Packit 8f70b4
struct sigaction
Packit 8f70b4
{
Packit 8f70b4
  union
Packit 8f70b4
  {
Packit 8f70b4
    void (*_sa_handler) (int);
Packit 8f70b4
    /* Present to allow compilation, but unsupported by gnulib.  POSIX
Packit 8f70b4
       says that implementations may, but not must, make sa_sigaction
Packit 8f70b4
       overlap with sa_handler, but we know of no implementation where
Packit 8f70b4
       they do not overlap.  */
Packit 8f70b4
    void (*_sa_sigaction) (int, siginfo_t *, void *);
Packit 8f70b4
  } _sa_func;
Packit 8f70b4
  sigset_t sa_mask;
Packit 8f70b4
  /* Not all POSIX flags are supported.  */
Packit 8f70b4
  int sa_flags;
Packit 8f70b4
};
Packit 8f70b4
#   define sa_handler _sa_func._sa_handler
Packit 8f70b4
#   define sa_sigaction _sa_func._sa_sigaction
Packit 8f70b4
/* Unsupported flags are not present.  */
Packit 8f70b4
#   define SA_RESETHAND 1
Packit 8f70b4
#   define SA_NODEFER 2
Packit 8f70b4
#   define SA_RESTART 4
Packit 8f70b4
Packit 8f70b4
#   define GNULIB_defined_struct_sigaction 1
Packit 8f70b4
#  endif
Packit 8f70b4
Packit 8f70b4
_GL_FUNCDECL_SYS (sigaction, int, (int, const struct sigaction *restrict,
Packit 8f70b4
                                   struct sigaction *restrict));
Packit 8f70b4
Packit 8f70b4
# elif !@HAVE_STRUCT_SIGACTION_SA_SIGACTION@
Packit 8f70b4
Packit 8f70b4
#  define sa_sigaction sa_handler
Packit 8f70b4
Packit 8f70b4
# endif /* !@HAVE_SIGACTION@, !@HAVE_STRUCT_SIGACTION_SA_SIGACTION@ */
Packit 8f70b4
Packit 8f70b4
_GL_CXXALIAS_SYS (sigaction, int, (int, const struct sigaction *restrict,
Packit 8f70b4
                                   struct sigaction *restrict));
Packit 8f70b4
_GL_CXXALIASWARN (sigaction);
Packit 8f70b4
Packit 8f70b4
#elif defined GNULIB_POSIXCHECK
Packit 8f70b4
# undef sigaction
Packit 8f70b4
# if HAVE_RAW_DECL_SIGACTION
Packit 8f70b4
_GL_WARN_ON_USE (sigaction, "sigaction is unportable - "
Packit 8f70b4
                 "use the gnulib module sigaction for portability");
Packit 8f70b4
# endif
Packit 8f70b4
#endif
Packit 8f70b4
Packit 8f70b4
/* Some systems don't have SA_NODEFER.  */
Packit 8f70b4
#ifndef SA_NODEFER
Packit 8f70b4
# define SA_NODEFER 0
Packit 8f70b4
#endif
Packit 8f70b4
Packit 8f70b4
Packit 8f70b4
#endif /* _@GUARD_PREFIX@_SIGNAL_H */
Packit 8f70b4
#endif /* _@GUARD_PREFIX@_SIGNAL_H */
Packit 8f70b4
#endif