#ifndef _SIGNAL_H
#define _SIGNAL_H
#include <features.h>
__BEGIN_DECLS
#include <bits/types.h>
#include <bits/signum-generic.h>
#include <bits/types/sig_atomic_t.h>
#if defined __USE_POSIX
#include <bits/types/sigset_t.h>
#endif
#if defined __USE_XOPEN || defined __USE_XOPEN2K
# ifndef __pid_t_defined
typedef __pid_t pid_t;
# define __pid_t_defined
#endif
#ifdef __USE_XOPEN
# endif
# ifndef __uid_t_defined
typedef __uid_t uid_t;
# define __uid_t_defined
# endif
#endif /* Unix98 */
#ifdef __USE_POSIX199309
# include <bits/types/struct_timespec.h>
#endif
#if defined __USE_POSIX199309 || defined __USE_XOPEN_EXTENDED
# include <bits/types/siginfo_t.h>
# include <bits/siginfo-consts.h>
#endif
#ifdef __USE_MISC
# include <bits/types/sigval_t.h>
#endif
#ifdef __USE_POSIX199309
# include <bits/types/sigevent_t.h>
# include <bits/sigevent-consts.h>
#endif
typedef void (*__sighandler_t) (int);
extern __sighandler_t __sysv_signal (int __sig, __sighandler_t __handler)
__THROW;
#ifdef __USE_GNU
extern __sighandler_t sysv_signal (int __sig, __sighandler_t __handler)
__THROW;
#endif
#ifdef __USE_MISC
extern __sighandler_t signal (int __sig, __sighandler_t __handler)
__THROW;
#else
# ifdef __REDIRECT_NTH
extern __sighandler_t __REDIRECT_NTH (signal,
(int __sig, __sighandler_t __handler),
__sysv_signal);
# else
# define signal __sysv_signal
# endif
#endif
#if defined __USE_XOPEN_EXTENDED && !defined __USE_XOPEN2K8
extern __sighandler_t bsd_signal (int __sig, __sighandler_t __handler)
__THROW;
#endif
#ifdef __USE_POSIX
extern int kill (__pid_t __pid, int __sig) __THROW;
#endif /* Use POSIX. */
#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED
extern int killpg (__pid_t __pgrp, int __sig) __THROW;
#endif /* Use misc || X/Open Unix. */
extern int raise (int __sig) __THROW;
#ifdef __USE_MISC
extern __sighandler_t ssignal (int __sig, __sighandler_t __handler)
__THROW;
extern int gsignal (int __sig) __THROW;
#endif /* Use misc. */
#ifdef __USE_XOPEN2K8
extern void psignal (int __sig, const char *__s);
extern void psiginfo (const siginfo_t *__pinfo, const char *__s);
#endif /* POSIX 2008. */
#ifdef __USE_XOPEN_EXTENDED
# ifdef __GNUC__
extern int sigpause (int __sig) __asm__ ("__xpg_sigpause")
__attribute_deprecated_msg__ ("Use the sigsuspend function instead");
# else
extern int __sigpause (int __sig_or_mask, int __is_sig);
# define sigpause(sig) __sigpause ((sig), 1)
# endif
#endif
#ifdef __USE_MISC
# define sigmask(sig) \
__glibc_macro_warning ("sigmask is deprecated") \
((int)(1u << ((sig) - 1)))
extern int sigblock (int __mask) __THROW __attribute_deprecated__;
extern int sigsetmask (int __mask) __THROW __attribute_deprecated__;
extern int siggetmask (void) __THROW __attribute_deprecated__;
#endif /* Use misc. */
#ifdef __USE_MISC
# define NSIG _NSIG
#endif
#ifdef __USE_GNU
typedef __sighandler_t sighandler_t;
#endif
#ifdef __USE_MISC
typedef __sighandler_t sig_t;
#endif
#ifdef __USE_POSIX
extern int sigemptyset (sigset_t *__set) __THROW __nonnull ((1));
extern int sigfillset (sigset_t *__set) __THROW __nonnull ((1));
extern int sigaddset (sigset_t *__set, int __signo) __THROW __nonnull ((1));
extern int sigdelset (sigset_t *__set, int __signo) __THROW __nonnull ((1));
extern int sigismember (const sigset_t *__set, int __signo)
__THROW __nonnull ((1));
# ifdef __USE_GNU
extern int sigisemptyset (const sigset_t *__set) __THROW __nonnull ((1));
extern int sigandset (sigset_t *__set, const sigset_t *__left,
const sigset_t *__right) __THROW __nonnull ((1, 2, 3));
extern int sigorset (sigset_t *__set, const sigset_t *__left,
const sigset_t *__right) __THROW __nonnull ((1, 2, 3));
# endif /* GNU */
# include <bits/sigaction.h>
extern int sigprocmask (int __how, const sigset_t *__restrict __set,
sigset_t *__restrict __oset) __THROW;
extern int sigsuspend (const sigset_t *__set) __nonnull ((1));
extern int sigaction (int __sig, const struct sigaction *__restrict __act,
struct sigaction *__restrict __oact) __THROW;
extern int sigpending (sigset_t *__set) __THROW __nonnull ((1));
# ifdef __USE_POSIX199506
extern int sigwait (const sigset_t *__restrict __set, int *__restrict __sig)
__nonnull ((1, 2));
# endif /* Use POSIX 1995. */
# ifdef __USE_POSIX199309
extern int sigwaitinfo (const sigset_t *__restrict __set,
siginfo_t *__restrict __info) __nonnull ((1));
# ifndef __USE_TIME_BITS64
extern int sigtimedwait (const sigset_t *__restrict __set,
siginfo_t *__restrict __info,
const struct timespec *__restrict __timeout)
__nonnull ((1));
# else
# ifdef __REDIRECT
extern int __REDIRECT (sigtimedwait,
(const sigset_t *__restrict __set,
siginfo_t *__restrict __info,
const struct timespec *__restrict __timeout),
__sigtimedwait64)
__nonnull ((1));
# else
# define sigtimedwait __sigtimedwait64
# endif
# endif
extern int sigqueue (__pid_t __pid, int __sig, const union sigval __val)
__THROW;
# endif /* Use POSIX 199306. */
#endif /* Use POSIX. */
#ifdef __USE_MISC
# include <bits/sigcontext.h>
extern int sigreturn (struct sigcontext *__scp) __THROW;
#endif /* Use misc. */
#if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8
# define __need_size_t
# include <stddef.h>
# include <bits/types/stack_t.h>
# if defined __USE_XOPEN || defined __USE_XOPEN2K8
# include <sys/ucontext.h>
# endif
#endif /* Use POSIX.1-2008 or X/Open Unix. */
#if defined __USE_XOPEN_EXTENDED || defined __USE_MISC
extern int siginterrupt (int __sig, int __interrupt) __THROW
__attribute_deprecated_msg__ ("Use sigaction with SA_RESTART instead");
# include <bits/sigstack.h>
# include <bits/sigstksz.h>
# include <bits/ss_flags.h>
extern int sigaltstack (const stack_t *__restrict __ss,
stack_t *__restrict __oss) __THROW;
#endif /* __USE_XOPEN_EXTENDED || __USE_MISC */
#if ((defined __USE_XOPEN_EXTENDED && !defined __USE_XOPEN2K8) \
|| defined __USE_MISC)
# include <bits/types/struct_sigstack.h>
#endif
#if ((defined __USE_XOPEN_EXTENDED && !defined __USE_XOPEN2K) \
|| defined __USE_MISC)
extern int sigstack (struct sigstack *__ss, struct sigstack *__oss)
__THROW __attribute_deprecated__;
#endif
#ifdef __USE_XOPEN_EXTENDED
extern int sighold (int __sig) __THROW
__attribute_deprecated_msg__ ("Use the sigprocmask function instead");
extern int sigrelse (int __sig) __THROW
__attribute_deprecated_msg__ ("Use the sigprocmask function instead");
extern int sigignore (int __sig) __THROW
__attribute_deprecated_msg__ ("Use the signal function instead");
extern __sighandler_t sigset (int __sig, __sighandler_t __disp) __THROW
__attribute_deprecated_msg__
("Use the signal and sigprocmask functions instead");
#endif
#if defined __USE_POSIX199506 || defined __USE_UNIX98
# include <bits/pthreadtypes.h>
# include <bits/sigthread.h>
#endif /* use Unix98 */
extern int __libc_current_sigrtmin (void) __THROW;
extern int __libc_current_sigrtmax (void) __THROW;
#define SIGRTMIN (__libc_current_sigrtmin ())
#define SIGRTMAX (__libc_current_sigrtmax ())
#include <bits/signal_ext.h>
__END_DECLS
#endif /* not signal.h */