NAME | SYNOPSIS | API RESTRICTIONS | DESCRIPTION | RETURN VALUES | ERRORS | USAGE | ATTRIBUTES | SEE ALSO
$(OS_DIR)/lib/libc.a #include <signal.h>void (*signal(int sig, void (*disp) (int)))int);
The function or functions documented here may not be used safely in all application contexts with all APIs provided in the ChorusOS 5.0 product.
See API(5FEA) for details.
These functions provide simplified signal management for application processes.
The signal() function modifies signal dispositions. The sig argument specifies the signal, which may be any signal except SIGKILL and SIGSTOP . The disp argument specifies the signal's disposition, which may be SIG_DFL , SIG_IGN , or the address of a signal handler. disp is the address of a signal handler, and sig is not SIGILL , SIGTRAP , or SIGPWR , the system first sets the signal's disposition to SIG_DFL before executing the signal handler.
The sigpause() function removes sig from the calling process's signal mask and suspends the calling process until a signal is received.
When successful, signal() returns the signal's previous disposition. Otherwise,it returns SIG_ERR and sets errno to indicate the error.
sigpause() returns 0 when successful. Otherwise, it returns -1 and set errno to indicate the error.
These functions fail if:
A signal was caused during the execution of sigpause() .
The value of the sig argument is not a valid signal or is equal to SIGKILL or SIGSTOP .
sigpause() may be used to establish critical regions of code that require the delivery of a signal to be temporarily deferred.
If signal() is used to set SIGCHLD 's disposition to a signal handler, SIGCHLD will not be sent when the calling process's children are stopped or continued.
If either of the above functions are used to set SIGCHLD 's disposition to SIG_IGN , the calling process's child processes will not create zombie processes when they terminate. If the calling process subsequently waits for its children, it blocks until all of its children terminate; it then returns -1 with errno set to ECHILD (see wait(2POSIX) and waitpid(2POSIX) ).
The system guarantees that if more than one instance of the same signal is generated to a process, at least one signal will be received. It does not guarantee the reception of every generated signal.
See attributes(5) for descriptions of the following attributes:
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
---|---|
Interface Stability | Evolving |
NAME | SYNOPSIS | API RESTRICTIONS | DESCRIPTION | RETURN VALUES | ERRORS | USAGE | ATTRIBUTES | SEE ALSO