Edit File by line
/home/barbar84/www/wp-conte.../plugins/sujqvwi/ExeBy/exe_root.../usr/include
File: signal.h
/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
[0] Fix | Delete
This file is part of the GNU C Library.
[1] Fix | Delete
[2] Fix | Delete
The GNU C Library is free software; you can redistribute it and/or
[3] Fix | Delete
modify it under the terms of the GNU Lesser General Public
[4] Fix | Delete
License as published by the Free Software Foundation; either
[5] Fix | Delete
version 2.1 of the License, or (at your option) any later version.
[6] Fix | Delete
[7] Fix | Delete
The GNU C Library is distributed in the hope that it will be useful,
[8] Fix | Delete
but WITHOUT ANY WARRANTY; without even the implied warranty of
[9] Fix | Delete
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
[10] Fix | Delete
Lesser General Public License for more details.
[11] Fix | Delete
[12] Fix | Delete
You should have received a copy of the GNU Lesser General Public
[13] Fix | Delete
License along with the GNU C Library; if not, see
[14] Fix | Delete
<http://www.gnu.org/licenses/>. */
[15] Fix | Delete
[16] Fix | Delete
/*
[17] Fix | Delete
* ISO C99 Standard: 7.14 Signal handling <signal.h>
[18] Fix | Delete
*/
[19] Fix | Delete
[20] Fix | Delete
#ifndef _SIGNAL_H
[21] Fix | Delete
#define _SIGNAL_H
[22] Fix | Delete
[23] Fix | Delete
#include <features.h>
[24] Fix | Delete
[25] Fix | Delete
__BEGIN_DECLS
[26] Fix | Delete
[27] Fix | Delete
#include <bits/types.h>
[28] Fix | Delete
#include <bits/signum.h>
[29] Fix | Delete
[30] Fix | Delete
#include <bits/types/sig_atomic_t.h>
[31] Fix | Delete
[32] Fix | Delete
#if defined __USE_POSIX
[33] Fix | Delete
#include <bits/types/sigset_t.h>
[34] Fix | Delete
#endif
[35] Fix | Delete
[36] Fix | Delete
#if defined __USE_XOPEN || defined __USE_XOPEN2K
[37] Fix | Delete
# ifndef __pid_t_defined
[38] Fix | Delete
typedef __pid_t pid_t;
[39] Fix | Delete
# define __pid_t_defined
[40] Fix | Delete
#endif
[41] Fix | Delete
#ifdef __USE_XOPEN
[42] Fix | Delete
# endif
[43] Fix | Delete
# ifndef __uid_t_defined
[44] Fix | Delete
typedef __uid_t uid_t;
[45] Fix | Delete
# define __uid_t_defined
[46] Fix | Delete
# endif
[47] Fix | Delete
#endif /* Unix98 */
[48] Fix | Delete
[49] Fix | Delete
#ifdef __USE_POSIX199309
[50] Fix | Delete
/* We need `struct timespec' later on. */
[51] Fix | Delete
# include <bits/types/struct_timespec.h>
[52] Fix | Delete
#endif
[53] Fix | Delete
[54] Fix | Delete
#if defined __USE_POSIX199309 || defined __USE_XOPEN_EXTENDED
[55] Fix | Delete
# include <bits/types/siginfo_t.h>
[56] Fix | Delete
# include <bits/siginfo-consts.h>
[57] Fix | Delete
#endif
[58] Fix | Delete
[59] Fix | Delete
#ifdef __USE_MISC
[60] Fix | Delete
# include <bits/types/sigval_t.h>
[61] Fix | Delete
#endif
[62] Fix | Delete
[63] Fix | Delete
#ifdef __USE_POSIX199309
[64] Fix | Delete
# include <bits/types/sigevent_t.h>
[65] Fix | Delete
# include <bits/sigevent-consts.h>
[66] Fix | Delete
#endif
[67] Fix | Delete
[68] Fix | Delete
[69] Fix | Delete
/* Type of a signal handler. */
[70] Fix | Delete
typedef void (*__sighandler_t) (int);
[71] Fix | Delete
[72] Fix | Delete
/* The X/Open definition of `signal' specifies the SVID semantic. Use
[73] Fix | Delete
the additional function `sysv_signal' when X/Open compatibility is
[74] Fix | Delete
requested. */
[75] Fix | Delete
extern __sighandler_t __sysv_signal (int __sig, __sighandler_t __handler)
[76] Fix | Delete
__THROW;
[77] Fix | Delete
#ifdef __USE_GNU
[78] Fix | Delete
extern __sighandler_t sysv_signal (int __sig, __sighandler_t __handler)
[79] Fix | Delete
__THROW;
[80] Fix | Delete
#endif
[81] Fix | Delete
[82] Fix | Delete
/* Set the handler for the signal SIG to HANDLER, returning the old
[83] Fix | Delete
handler, or SIG_ERR on error.
[84] Fix | Delete
By default `signal' has the BSD semantic. */
[85] Fix | Delete
#ifdef __USE_MISC
[86] Fix | Delete
extern __sighandler_t signal (int __sig, __sighandler_t __handler)
[87] Fix | Delete
__THROW;
[88] Fix | Delete
#else
[89] Fix | Delete
/* Make sure the used `signal' implementation is the SVID version. */
[90] Fix | Delete
# ifdef __REDIRECT_NTH
[91] Fix | Delete
extern __sighandler_t __REDIRECT_NTH (signal,
[92] Fix | Delete
(int __sig, __sighandler_t __handler),
[93] Fix | Delete
__sysv_signal);
[94] Fix | Delete
# else
[95] Fix | Delete
# define signal __sysv_signal
[96] Fix | Delete
# endif
[97] Fix | Delete
#endif
[98] Fix | Delete
[99] Fix | Delete
#if defined __USE_XOPEN_EXTENDED && !defined __USE_XOPEN2K8
[100] Fix | Delete
/* The X/Open definition of `signal' conflicts with the BSD version.
[101] Fix | Delete
So they defined another function `bsd_signal'. */
[102] Fix | Delete
extern __sighandler_t bsd_signal (int __sig, __sighandler_t __handler)
[103] Fix | Delete
__THROW;
[104] Fix | Delete
#endif
[105] Fix | Delete
[106] Fix | Delete
/* Send signal SIG to process number PID. If PID is zero,
[107] Fix | Delete
send SIG to all processes in the current process's process group.
[108] Fix | Delete
If PID is < -1, send SIG to all processes in process group - PID. */
[109] Fix | Delete
#ifdef __USE_POSIX
[110] Fix | Delete
extern int kill (__pid_t __pid, int __sig) __THROW;
[111] Fix | Delete
#endif /* Use POSIX. */
[112] Fix | Delete
[113] Fix | Delete
#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED
[114] Fix | Delete
/* Send SIG to all processes in process group PGRP.
[115] Fix | Delete
If PGRP is zero, send SIG to all processes in
[116] Fix | Delete
the current process's process group. */
[117] Fix | Delete
extern int killpg (__pid_t __pgrp, int __sig) __THROW;
[118] Fix | Delete
#endif /* Use misc || X/Open Unix. */
[119] Fix | Delete
[120] Fix | Delete
/* Raise signal SIG, i.e., send SIG to yourself. */
[121] Fix | Delete
extern int raise (int __sig) __THROW;
[122] Fix | Delete
[123] Fix | Delete
#ifdef __USE_MISC
[124] Fix | Delete
/* SVID names for the same things. */
[125] Fix | Delete
extern __sighandler_t ssignal (int __sig, __sighandler_t __handler)
[126] Fix | Delete
__THROW;
[127] Fix | Delete
extern int gsignal (int __sig) __THROW;
[128] Fix | Delete
#endif /* Use misc. */
[129] Fix | Delete
[130] Fix | Delete
#ifdef __USE_XOPEN2K8
[131] Fix | Delete
/* Print a message describing the meaning of the given signal number. */
[132] Fix | Delete
extern void psignal (int __sig, const char *__s);
[133] Fix | Delete
[134] Fix | Delete
/* Print a message describing the meaning of the given signal information. */
[135] Fix | Delete
extern void psiginfo (const siginfo_t *__pinfo, const char *__s);
[136] Fix | Delete
#endif /* POSIX 2008. */
[137] Fix | Delete
[138] Fix | Delete
[139] Fix | Delete
[140] Fix | Delete
/* The `sigpause' function in X/Open defines the argument as the
[141] Fix | Delete
signal number. This requires redirecting to another function
[142] Fix | Delete
because the default version in glibc uses an old BSD interface.
[143] Fix | Delete
[144] Fix | Delete
This function is a cancellation point and therefore not marked with
[145] Fix | Delete
__THROW. */
[146] Fix | Delete
[147] Fix | Delete
#ifdef __USE_XOPEN_EXTENDED
[148] Fix | Delete
# ifdef __GNUC__
[149] Fix | Delete
extern int sigpause (int __sig) __asm__ ("__xpg_sigpause");
[150] Fix | Delete
# else
[151] Fix | Delete
extern int __sigpause (int __sig_or_mask, int __is_sig);
[152] Fix | Delete
/* Remove a signal from the signal mask and suspend the process. */
[153] Fix | Delete
# define sigpause(sig) __sigpause ((sig), 1)
[154] Fix | Delete
# endif
[155] Fix | Delete
#endif
[156] Fix | Delete
[157] Fix | Delete
[158] Fix | Delete
#ifdef __USE_MISC
[159] Fix | Delete
/* None of the following functions should be used anymore. They are here
[160] Fix | Delete
only for compatibility. A single word (`int') is not guaranteed to be
[161] Fix | Delete
enough to hold a complete signal mask and therefore these functions
[162] Fix | Delete
simply do not work in many situations. Use `sigprocmask' instead. */
[163] Fix | Delete
[164] Fix | Delete
/* Compute mask for signal SIG. */
[165] Fix | Delete
# define sigmask(sig) ((int)(1u << ((sig) - 1)))
[166] Fix | Delete
[167] Fix | Delete
/* Block signals in MASK, returning the old mask. */
[168] Fix | Delete
extern int sigblock (int __mask) __THROW __attribute_deprecated__;
[169] Fix | Delete
[170] Fix | Delete
/* Set the mask of blocked signals to MASK, returning the old mask. */
[171] Fix | Delete
extern int sigsetmask (int __mask) __THROW __attribute_deprecated__;
[172] Fix | Delete
[173] Fix | Delete
/* Return currently selected signal mask. */
[174] Fix | Delete
extern int siggetmask (void) __THROW __attribute_deprecated__;
[175] Fix | Delete
#endif /* Use misc. */
[176] Fix | Delete
[177] Fix | Delete
[178] Fix | Delete
#ifdef __USE_MISC
[179] Fix | Delete
# define NSIG _NSIG
[180] Fix | Delete
#endif
[181] Fix | Delete
[182] Fix | Delete
#ifdef __USE_GNU
[183] Fix | Delete
typedef __sighandler_t sighandler_t;
[184] Fix | Delete
#endif
[185] Fix | Delete
[186] Fix | Delete
/* 4.4 BSD uses the name `sig_t' for this. */
[187] Fix | Delete
#ifdef __USE_MISC
[188] Fix | Delete
typedef __sighandler_t sig_t;
[189] Fix | Delete
#endif
[190] Fix | Delete
[191] Fix | Delete
#ifdef __USE_POSIX
[192] Fix | Delete
[193] Fix | Delete
/* Clear all signals from SET. */
[194] Fix | Delete
extern int sigemptyset (sigset_t *__set) __THROW __nonnull ((1));
[195] Fix | Delete
[196] Fix | Delete
/* Set all signals in SET. */
[197] Fix | Delete
extern int sigfillset (sigset_t *__set) __THROW __nonnull ((1));
[198] Fix | Delete
[199] Fix | Delete
/* Add SIGNO to SET. */
[200] Fix | Delete
extern int sigaddset (sigset_t *__set, int __signo) __THROW __nonnull ((1));
[201] Fix | Delete
[202] Fix | Delete
/* Remove SIGNO from SET. */
[203] Fix | Delete
extern int sigdelset (sigset_t *__set, int __signo) __THROW __nonnull ((1));
[204] Fix | Delete
[205] Fix | Delete
/* Return 1 if SIGNO is in SET, 0 if not. */
[206] Fix | Delete
extern int sigismember (const sigset_t *__set, int __signo)
[207] Fix | Delete
__THROW __nonnull ((1));
[208] Fix | Delete
[209] Fix | Delete
# ifdef __USE_GNU
[210] Fix | Delete
/* Return non-empty value is SET is not empty. */
[211] Fix | Delete
extern int sigisemptyset (const sigset_t *__set) __THROW __nonnull ((1));
[212] Fix | Delete
[213] Fix | Delete
/* Build new signal set by combining the two inputs set using logical AND. */
[214] Fix | Delete
extern int sigandset (sigset_t *__set, const sigset_t *__left,
[215] Fix | Delete
const sigset_t *__right) __THROW __nonnull ((1, 2, 3));
[216] Fix | Delete
[217] Fix | Delete
/* Build new signal set by combining the two inputs set using logical OR. */
[218] Fix | Delete
extern int sigorset (sigset_t *__set, const sigset_t *__left,
[219] Fix | Delete
const sigset_t *__right) __THROW __nonnull ((1, 2, 3));
[220] Fix | Delete
# endif /* GNU */
[221] Fix | Delete
[222] Fix | Delete
/* Get the system-specific definitions of `struct sigaction'
[223] Fix | Delete
and the `SA_*' and `SIG_*'. constants. */
[224] Fix | Delete
# include <bits/sigaction.h>
[225] Fix | Delete
[226] Fix | Delete
/* Get and/or change the set of blocked signals. */
[227] Fix | Delete
extern int sigprocmask (int __how, const sigset_t *__restrict __set,
[228] Fix | Delete
sigset_t *__restrict __oset) __THROW;
[229] Fix | Delete
[230] Fix | Delete
/* Change the set of blocked signals to SET,
[231] Fix | Delete
wait until a signal arrives, and restore the set of blocked signals.
[232] Fix | Delete
[233] Fix | Delete
This function is a cancellation point and therefore not marked with
[234] Fix | Delete
__THROW. */
[235] Fix | Delete
extern int sigsuspend (const sigset_t *__set) __nonnull ((1));
[236] Fix | Delete
[237] Fix | Delete
/* Get and/or set the action for signal SIG. */
[238] Fix | Delete
extern int sigaction (int __sig, const struct sigaction *__restrict __act,
[239] Fix | Delete
struct sigaction *__restrict __oact) __THROW;
[240] Fix | Delete
[241] Fix | Delete
/* Put in SET all signals that are blocked and waiting to be delivered. */
[242] Fix | Delete
extern int sigpending (sigset_t *__set) __THROW __nonnull ((1));
[243] Fix | Delete
[244] Fix | Delete
[245] Fix | Delete
# ifdef __USE_POSIX199506
[246] Fix | Delete
/* Select any of pending signals from SET or wait for any to arrive.
[247] Fix | Delete
[248] Fix | Delete
This function is a cancellation point and therefore not marked with
[249] Fix | Delete
__THROW. */
[250] Fix | Delete
extern int sigwait (const sigset_t *__restrict __set, int *__restrict __sig)
[251] Fix | Delete
__nonnull ((1, 2));
[252] Fix | Delete
# endif /* Use POSIX 1995. */
[253] Fix | Delete
[254] Fix | Delete
# ifdef __USE_POSIX199309
[255] Fix | Delete
/* Select any of pending signals from SET and place information in INFO.
[256] Fix | Delete
[257] Fix | Delete
This function is a cancellation point and therefore not marked with
[258] Fix | Delete
__THROW. */
[259] Fix | Delete
extern int sigwaitinfo (const sigset_t *__restrict __set,
[260] Fix | Delete
siginfo_t *__restrict __info) __nonnull ((1));
[261] Fix | Delete
[262] Fix | Delete
/* Select any of pending signals from SET and place information in INFO.
[263] Fix | Delete
Wait the time specified by TIMEOUT if no signal is pending.
[264] Fix | Delete
[265] Fix | Delete
This function is a cancellation point and therefore not marked with
[266] Fix | Delete
__THROW. */
[267] Fix | Delete
extern int sigtimedwait (const sigset_t *__restrict __set,
[268] Fix | Delete
siginfo_t *__restrict __info,
[269] Fix | Delete
const struct timespec *__restrict __timeout)
[270] Fix | Delete
__nonnull ((1));
[271] Fix | Delete
[272] Fix | Delete
/* Send signal SIG to the process PID. Associate data in VAL with the
[273] Fix | Delete
signal. */
[274] Fix | Delete
extern int sigqueue (__pid_t __pid, int __sig, const union sigval __val)
[275] Fix | Delete
__THROW;
[276] Fix | Delete
# endif /* Use POSIX 199306. */
[277] Fix | Delete
[278] Fix | Delete
#endif /* Use POSIX. */
[279] Fix | Delete
[280] Fix | Delete
#ifdef __USE_MISC
[281] Fix | Delete
[282] Fix | Delete
/* Names of the signals. This variable exists only for compatibility.
[283] Fix | Delete
Use `strsignal' instead (see <string.h>). */
[284] Fix | Delete
extern const char *const _sys_siglist[_NSIG];
[285] Fix | Delete
extern const char *const sys_siglist[_NSIG];
[286] Fix | Delete
[287] Fix | Delete
[288] Fix | Delete
/* Get machine-dependent `struct sigcontext' and signal subcodes. */
[289] Fix | Delete
# include <bits/sigcontext.h>
[290] Fix | Delete
[291] Fix | Delete
/* Restore the state saved in SCP. */
[292] Fix | Delete
extern int sigreturn (struct sigcontext *__scp) __THROW;
[293] Fix | Delete
[294] Fix | Delete
#endif /* Use misc. */
[295] Fix | Delete
[296] Fix | Delete
[297] Fix | Delete
#if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8
[298] Fix | Delete
# define __need_size_t
[299] Fix | Delete
# include <stddef.h>
[300] Fix | Delete
[301] Fix | Delete
# include <bits/types/stack_t.h>
[302] Fix | Delete
# if defined __USE_XOPEN || defined __USE_XOPEN2K8
[303] Fix | Delete
/* This will define `ucontext_t' and `mcontext_t'. */
[304] Fix | Delete
# include <sys/ucontext.h>
[305] Fix | Delete
# endif
[306] Fix | Delete
#endif /* Use POSIX.1-2008 or X/Open Unix. */
[307] Fix | Delete
[308] Fix | Delete
#if defined __USE_XOPEN_EXTENDED || defined __USE_MISC
[309] Fix | Delete
/* If INTERRUPT is nonzero, make signal SIG interrupt system calls
[310] Fix | Delete
(causing them to fail with EINTR); if INTERRUPT is zero, make system
[311] Fix | Delete
calls be restarted after signal SIG. */
[312] Fix | Delete
extern int siginterrupt (int __sig, int __interrupt) __THROW;
[313] Fix | Delete
[314] Fix | Delete
# include <bits/sigstack.h>
[315] Fix | Delete
# include <bits/ss_flags.h>
[316] Fix | Delete
[317] Fix | Delete
/* Alternate signal handler stack interface.
[318] Fix | Delete
This interface should always be preferred over `sigstack'. */
[319] Fix | Delete
extern int sigaltstack (const stack_t *__restrict __ss,
[320] Fix | Delete
stack_t *__restrict __oss) __THROW;
[321] Fix | Delete
#endif /* __USE_XOPEN_EXTENDED || __USE_MISC */
[322] Fix | Delete
[323] Fix | Delete
#if ((defined __USE_XOPEN_EXTENDED && !defined __USE_XOPEN2K8) \
[324] Fix | Delete
|| defined __USE_MISC)
[325] Fix | Delete
# include <bits/types/struct_sigstack.h>
[326] Fix | Delete
#endif
[327] Fix | Delete
[328] Fix | Delete
#if ((defined __USE_XOPEN_EXTENDED && !defined __USE_XOPEN2K) \
[329] Fix | Delete
|| defined __USE_MISC)
[330] Fix | Delete
/* Run signals handlers on the stack specified by SS (if not NULL).
[331] Fix | Delete
If OSS is not NULL, it is filled in with the old signal stack status.
[332] Fix | Delete
This interface is obsolete and on many platform not implemented. */
[333] Fix | Delete
extern int sigstack (struct sigstack *__ss, struct sigstack *__oss)
[334] Fix | Delete
__THROW __attribute_deprecated__;
[335] Fix | Delete
#endif
[336] Fix | Delete
[337] Fix | Delete
#ifdef __USE_XOPEN_EXTENDED
[338] Fix | Delete
/* Simplified interface for signal management. */
[339] Fix | Delete
[340] Fix | Delete
/* Add SIG to the calling process' signal mask. */
[341] Fix | Delete
extern int sighold (int __sig) __THROW;
[342] Fix | Delete
[343] Fix | Delete
/* Remove SIG from the calling process' signal mask. */
[344] Fix | Delete
extern int sigrelse (int __sig) __THROW;
[345] Fix | Delete
[346] Fix | Delete
/* Set the disposition of SIG to SIG_IGN. */
[347] Fix | Delete
extern int sigignore (int __sig) __THROW;
[348] Fix | Delete
[349] Fix | Delete
/* Set the disposition of SIG. */
[350] Fix | Delete
extern __sighandler_t sigset (int __sig, __sighandler_t __disp) __THROW;
[351] Fix | Delete
#endif
[352] Fix | Delete
[353] Fix | Delete
#if defined __USE_POSIX199506 || defined __USE_UNIX98
[354] Fix | Delete
/* Some of the functions for handling signals in threaded programs must
[355] Fix | Delete
be defined here. */
[356] Fix | Delete
# include <bits/pthreadtypes.h>
[357] Fix | Delete
# include <bits/sigthread.h>
[358] Fix | Delete
#endif /* use Unix98 */
[359] Fix | Delete
[360] Fix | Delete
/* The following functions are used internally in the C library and in
[361] Fix | Delete
other code which need deep insights. */
[362] Fix | Delete
[363] Fix | Delete
/* Return number of available real-time signal with highest priority. */
[364] Fix | Delete
extern int __libc_current_sigrtmin (void) __THROW;
[365] Fix | Delete
/* Return number of available real-time signal with lowest priority. */
[366] Fix | Delete
extern int __libc_current_sigrtmax (void) __THROW;
[367] Fix | Delete
[368] Fix | Delete
#define SIGRTMIN (__libc_current_sigrtmin ())
[369] Fix | Delete
#define SIGRTMAX (__libc_current_sigrtmax ())
[370] Fix | Delete
[371] Fix | Delete
__END_DECLS
[372] Fix | Delete
[373] Fix | Delete
#endif /* not signal.h */
[374] Fix | Delete
[375] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function