| Program termination | |||||||||||||||||||||
| |||||||||||||||||||||
| Unreachable control flow | |||||||||||||||||||||
(C23) | |||||||||||||||||||||
| Communicating with the environment | |||||||||||||||||||||
| |||||||||||||||||||||
| Memory alignment query | |||||||||||||||||||||
(C23) | |||||||||||||||||||||
| Signals | |||||||||||||||||||||
| Signal types | |||||||||||||||||||||
| Non-local jumps | |||||||||||||||||||||
| Types | |||||||||||||||||||||
Defined in header <signal.h> | ||
typedef/* unspecified */ sig_atomic_t; | ||
An integer type which can be accessed as an atomic entity even in the presence of asynchronous interrupts made by signals.
#include <signal.h>#include <stdio.h> volatile sig_atomic_t gSignalStatus=0; void signal_handler(int status){ gSignalStatus= status;} int main(void){/* Install a signal handler. */signal(SIGINT, signal_handler); printf("SignalValue: %d\n", gSignalStatus);printf("Sending signal: %d\n",SIGINT);raise(SIGINT);printf("SignalValue: %d\n", gSignalStatus);}
Possible output:
SignalValue: 0Sending signal: 2SignalValue: 2
| sets a signal handler for particular signal (function)[edit] | |
C++ documentation forsig_atomic_t | |