The signal.h header defines a variable type sig_atomic_t, two function calls, and several macros to handle different signals reported during a program's execution.
Library Macros
The SIG_ macros are used with the signal function to define signal functions.
SIG_DFL
Default signal handler.
SIG_ERR
Represents a signal error.
SIG_IGN
Signal ignore.
The SIG macros are used to represent a signal number in the following conditions −
SIGABRT
Abnormal program termination.
SIGFPE
Floating-point error like division by zero.
SIGILL
Illegal operation.
SIGINT
Interrupt signal such as ctrl-C.
SIGSEGV
Invalid access to storage like segment violation.
SIGTERM
Termination request.
Library Functions
This function sets a function to handle signal i.e. a signal handler.
This function causes signal sig to be generated. The sig argument is compatible with the SIG macros.
Không có nhận xét nào:
Đăng nhận xét