from small one page howto to huge articles all in one place

search text in:

Which kernel version do you use?

poll results

Last additions:
using iotop to find disk usage hogs

using iotop to find disk usage hogs






average rating: 1.7 (102 votes) (1=very good 6=terrible)

May 25th. 2007:




why adblockers are bad

Workaround and fixes for the current Core Dump Handling vulnerability affected kernels

Workaround and fixes for the current Core Dump Handling vulnerability affected kernels






average rating: 1.4 (42 votes) (1=very good 6=terrible)

April, 26th. 2006:

You are here: manpages


Section: POSIX Programmer's Manual (0P)
Updated: 2013
Index Return to Main Contents


This manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ (consult the corresponding Linux manual page for details of Linux behavior), or the interface may not be implemented on Linux.



signal.h --- signals  


#include <signal.h>


Some of the functionality described on this reference page extends the ISO C standard. Applications shall define the appropriate feature test macro (see the System Interfaces volume of POSIX.1-2008, Section 2.2, The Compilation Environment) to enable the visibility of these symbols in this header. The <signal.h> header shall define the following macros, which shall expand to constant expressions with distinct values that have a type compatible with the second argument to, and the return value of, the signal() function, and whose values shall compare unequal to the address of any declarable function.
Request for default signal handling.
Return value from signal() in case of error.
Request that signal be held.
Request that signal be ignored. The <signal.h> header shall define the pthread_t, size_t, and uid_t types as described in <sys/types.h>. The <signal.h> header shall define the timespec structure as described in <time.h>. The <signal.h> header shall define the following data types:
Possibly volatile-qualified integer type of an object that can be accessed as an atomic entity, even in the presence of asynchronous interrupts.
Integer or structure type of an object used to represent sets of signals.
As described in <sys/types.h>. The <signal.h> header shall define the pthread_attr_t type as described in <sys/types.h>. The <signal.h> header shall define the sigevent structure, which shall include at least the following members:

int              sigev_notify            Notification type.
int              sigev_signo             Signal number.
union sigval     sigev_value             Signal value.
void           (*sigev_notify_function)(union sigval)
                                         Notification function.
pthread_attr_t *sigev_notify_attributes  Notification attributes.
The <signal.h> header shall define the following symbolic constants for the values of sigev_notify:
No asynchronous notification is delivered when the event of interest occurs.
A queued signal, with an application-defined value, is generated when the event of interest occurs.
A notification function is called to perform notification.
The sigval union shall be defined as:

int    sival_int    Integer signal value.
void  *sival_ptr    Pointer signal value.
The <signal.h> header shall declare the SIGRTMIN and SIGRTMAX macros, which shall expand to positive integer expressions with type int, but which need not be constant expressions. These macros specify a range of signal numbers that are reserved for application use and for which the realtime signal behavior specified in this volume of POSIX.1-2008 is supported. The signal numbers in this range do not overlap any of the signals specified in the following table. The range SIGRTMIN through SIGRTMAX inclusive shall include at least {RTSIG_MAX} signal numbers. It is implementation-defined whether realtime signal behavior is supported for other signals. The <signal.h> header shall define the following macros that are used to refer to the signals that occur in the system. Signals defined here begin with the letters SIG followed by an uppercase letter. The macros shall expand to positive integer constant expressions with type int and distinct values. The value 0 is reserved for use as the null signal (see kill()). Additional implementation-defined signals may occur in the system. The ISO C standard only requires the signal names SIGABRT, SIGFPE, SIGILL, SIGINT, SIGSEGV, and SIGTERM to be defined. The following signals shall be supported on all implementations (default actions are explained below the table):
SignalDefault ActionDescription

SIGABRTA    Process abort signal.
SIGALRMT    Alarm clock.
SIGBUSA    Access to an undefined portion of a memory object.
SIGCHLDI    Child process terminated, stopped,
    or continued.
SIGCONTC    Continue executing, if stopped.
SIGFPEA    Erroneous arithmetic operation.
SIGHUPT    Hangup.
SIGILLA    Illegal instruction.
SIGINTT    Terminal interrupt signal.
SIGKILLT    Kill (cannot be caught or ignored).
SIGPIPET    Write on a pipe with no one to read it.
SIGQUITA    Terminal quit signal.
SIGSEGVA    Invalid memory reference.
SIGSTOPS    Stop executing (cannot be caught or ignored).
SIGTERMT    Termination signal.
SIGTSTPS    Terminal stop signal.
SIGTTINS    Background process attempting read.
SIGTTOUS    Background process attempting write.
SIGUSR1T    User-defined signal 1.
SIGUSR2T    User-defined signal 2.
SIGPOLLT    Pollable event.
SIGPROFT    Profiling timer expired.
SIGSYSA    Bad system call.
SIGTRAPA    Trace/breakpoint trap.
SIGURGI    High bandwidth data is available at a socket.
SIGVTALRMT    Virtual timer expired.
SIGXCPUA    CPU time limit exceeded.
SIGXFSZA    File size limit exceeded.

The default actions are as follows:
Abnormal termination of the process.
Abnormal termination of the process with additional actions.
Ignore the signal.
Stop the process.
Continue the process, if it is stopped; otherwise, ignore the signal. The effects on the process in each case are described in the System Interfaces volume of POSIX.1-2008, Section 2.4.3, Signal Actions. The <signal.h> header shall declare the sigaction structure, which shall include at least the following members:

void   (*sa_handler)(int)  Pointer to a signal-catching function
                           or one of the SIG_IGN or SIG_DFL.
sigset_t sa_mask           Set of signals to be blocked during execution
                           of the signal handling function.
int      sa_flags          Special flags.
void   (*sa_sigaction)(int, siginfo_t *, void *)
                           Pointer to a signal-catching function.
The storage occupied by sa_handler and sa_sigaction may overlap, and a conforming application shall not use both simultaneously. The <signal.h> header shall define the following macros which shall expand to integer constant expressions that need not be usable in #if preprocessing directives:
The resulting set is the union of the current set and the signal set pointed to by the argument set.
The resulting set is the intersection of the current set and the complement of the signal set pointed to by the argument set.
The resulting set is the signal set pointed to by the argument set. The <signal.h> header shall also define the following symbolic constants:
Do not generate SIGCHLD when children stop
or stopped children continue.
Causes signal delivery to occur on an alternate stack.
Causes signal dispositions to be set to SIG_DFL on entry to signal handlers.
Causes certain functions to become restartable.
Causes extra information to be passed to signal handlers at the time of receipt of a signal.
Causes implementations not to create zombie processes on child death.
Causes signal not to be automatically blocked on entry to signal handler.
Process is executing on an alternate signal stack.
Alternate signal stack is disabled.
Minimum stack size for a signal handler.
Default size in bytes for the alternate signal stack. The <signal.h> header shall define the mcontext_t type through typedef. The <signal.h> header shall define the ucontext_t type as a structure that shall include at least the following members:

ucontext_t *uc_link     Pointer to the context that is resumed
                        when this context returns.
sigset_t    uc_sigmask  The set of signals that are blocked when this
                        context is active.
stack_t     uc_stack    The stack used by this context.
mcontext_t  uc_mcontext A machine-specific representation of the saved
The <signal.h> header shall define the stack_t type as a structure, which shall include at least the following members:

void     *ss_sp       Stack base or pointer.
size_t    ss_size     Stack size.
int       ss_flags    Flags.
The <signal.h> header shall define the siginfo_t type as a structure, which shall include at least the following members:

int           si_signo  Signal number.
int           si_code   Signal code.
int           si_errno  If non-zero, an errno value associated with
                        this signal, as described in <errno.h>.
pid_t         si_pid    Sending process ID.
uid_t         si_uid    Real user ID of sending process.
void         *si_addr   Address of faulting instruction.
int           si_status Exit value or signal.
long          si_band   Band event for SIGPOLL.
union sigval  si_value  Signal value.
The <signal.h> header shall define the symbolic constants in the Code column of the following table for use as values of si_code that are signal-specific or non-signal-specific reasons why the signal was generated.

SIGILL ILL_ILLOPC Illegal opcode.
 ILL_ILLOPN Illegal operand.
 ILL_ILLADR Illegal addressing mode.
 ILL_ILLTRP Illegal trap.
 ILL_PRVOPC Privileged opcode.
 ILL_PRVREG Privileged register.
 ILL_COPROC Coprocessor error.
 ILL_BADSTK Internal stack error.

SIGFPE FPE_INTDIV Integer divide by zero.
 FPE_INTOVF Integer overflow.
 FPE_FLTDIV Floating-point divide by zero.
 FPE_FLTOVF Floating-point overflow.
 FPE_FLTUND Floating-point underflow.
 FPE_FLTRES Floating-point inexact result.
 FPE_FLTINV Invalid floating-point operation.
 FPE_FLTSUB Subscript out of range.

SIGSEGV SEGV_MAPERR Address not mapped to object.
 SEGV_ACCERR Invalid permissions for mapped object.

SIGBUS BUS_ADRALN Invalid address alignment.
 BUS_ADRERR Nonexistent physical address.
 BUS_OBJERR Object-specific hardware error.

SIGTRAP TRAP_BRKPT Process breakpoint.
 TRAP_TRACE Process trace trap.

SIGCHLD CLD_EXITED Child has exited.
 CLD_KILLED Child has terminated abnormally and did not create a core file.
 CLD_DUMPED Child has terminated abnormally and created a core file.
 CLD_TRAPPED Traced child has trapped.
 CLD_STOPPED Child has stopped.
 CLD_CONTINUED Stopped child has continued.

SIGPOLL POLL_IN Data input available.
 POLL_OUT Output buffers available.
 POLL_MSG Input message available.
 POLL_ERR I/O error.
 POLL_PRI High priority input available.
 POLL_HUP Device disconnected.

Any SI_USER Signal sent by kill().
 SI_QUEUE Signal sent by sigqueue().
 SI_TIMER Signal generated by expiration of a timer set by timer_settime().
 SI_ASYNCIO Signal generated by completion of an asynchronous I/O
 SI_MESGQ Signal generated by arrival of a message on an empty message
Implementations may support additional si_code values not included in this list, may generate values included in this list under circumstances other than those described in this list, and may contain extensions or limitations that prevent some values from being generated. Implementations do not generate a different value from the ones described in this list for circumstances described in this list.
In addition, the following signal-specific information shall be available:

SIGILLvoid * si_addrAddress of faulting instruction.

SIGSEGVvoid * si_addrAddress of faulting memory reference.

SIGCHLDpid_t si_pidChild process ID.
int si_statusExit value or signal.
uid_t si_uidReal user ID of the process that sent the signal.

SIGPOLLlong si_bandBand event for POLL_IN, POLL_OUT, or POLL_MSG.
For some implementations, the value of si_addr may be inaccurate. The following shall be declared as functions and may also be defined as macros. Function prototypes shall be provided.

int    kill(pid_t, int);
int    killpg(pid_t, int);
void   psiginfo(const siginfo_t *, const char *);
void   psignal(int, const char *);
int    pthread_kill(pthread_t, int);
int    pthread_sigmask(int, const sigset_t *restrict,
           sigset_t *restrict);
int    raise(int);
int    sigaction(int, const struct sigaction *restrict,
           struct sigaction *restrict);
int    sigaddset(sigset_t *, int);
int    sigaltstack(const stack_t *restrict, stack_t *restrict);
int    sigdelset(sigset_t *, int);
int    sigemptyset(sigset_t *);
int    sigfillset(sigset_t *);
int    sighold(int);
int    sigignore(int);
int    siginterrupt(int, int);
int    sigismember(const sigset_t *, int);
void (*signal(int, void (*)(int)))(int);
int    sigpause(int);
int    sigpending(sigset_t *);
int    sigprocmask(int, const sigset_t *restrict, sigset_t *restrict);
int    sigqueue(pid_t, int, const union sigval);
int    sigrelse(int);
void (*sigset(int, void (*)(int)))(int);
int    sigsuspend(const sigset_t *);
int    sigtimedwait(const sigset_t *restrict, siginfo_t *restrict,
           const struct timespec *restrict);
int    sigwait(const sigset_t *restrict, int *restrict);
int    sigwaitinfo(const sigset_t *restrict, siginfo_t *restrict);
Inclusion of the <signal.h> header may make visible all symbols from the <time.h> header.

The following sections are informative.  


On systems not supporting the XSI option, the si_pid and si_uid members of siginfo_t are only required to be valid when si_code is SI_USER or SI_QUEUE. On XSI-conforming systems, they are also valid for all si_code values less than or equal to 0; however, it is unspecified whether SI_USER and SI_QUEUE have values less than or equal to zero, and therefore XSI applications should check whether si_code has the value SI_USER or SI_QUEUE or is less than or equal to 0 to tell whether si_pid and si_uid are valid.  




The SIGPOLL and SIGPROF signals may be removed in a future version.  


<errno.h>, <stropts.h>, <sys_types.h>, <time.h> The System Interfaces volume of POSIX.1-2008, Section 2.2, The Compilation Environment, alarm(), ioctl(), kill(), killpg(), psiginfo(), pthread_kill(), pthread_sigmask(), raise(), sigaction(), sigaddset(), sigaltstack(), sigdelset(), sigemptyset(), sigfillset(), sighold(), siginterrupt(), sigismember(), signal(), sigpending(), sigqueue(), sigsuspend(), sigtimedwait(), sigwait(), timer_create(), wait(), waitid()  


Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1, 2013 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, Copyright (C) 2013 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. (This is POSIX.1-2008 with the 2013 Technical Corrigendum 1 applied.) In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at .

Any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format. To report such errors, see .




Support us on Content Nation
rdf newsfeed | rss newsfeed | Atom newsfeed
- Powered by LeopardCMS - Running on Gentoo -
Copyright 2004-2020 Sascha Nitsch Unternehmensberatung GmbH
Valid XHTML1.1 : Valid CSS : buttonmaker
- Level Triple-A Conformance to Web Content Accessibility Guidelines 1.0 -
- Copyright and legal notices -
Time to create this page: 15.0 ms