- C Library - <time.h>
- C Library - <string.h>
- C Library - <stdlib.h>
- C Library - <stdio.h>
- C Library - <stddef.h>
- C Library - <stdarg.h>
- C Library - <signal.h>
- C Library - <setjmp.h>
- C Library - <math.h>
- C Library - <locale.h>
- C Library - <limits.h>
- C Library - <float.h>
- C Library - <errno.h>
- C Library - <ctype.h>
- C Library - <assert.h>
- C Library - Home
C Standard Library Resources
C Programming Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
C Library - <signal.h>
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 Variables
Following is the variable type defined in the header signal.h −
Sr.No. | Variable & Description |
---|---|
1 |
sig_atomic_t This is of int type and is used as a variable in a signal handler. This is an integral type of an object that can be accessed as an atomic entity, even in the presence of asynchronous signals. |
Library Macros
Following are the macros defined in the header signal.h and these macros will be used in two functions psted below. The SIG_ macros are used with the signal function to define signal functions.
Sr.No. | Macro & Description |
---|---|
1 |
SIG_DFL Default signal handler. |
2 |
SIG_ERR Represents a signal error. |
3 |
SIG_IGN Signal ignore. |
The SIG macros are used to represent a signal number in the following conditions −
Sr.No. | Macro & Description |
---|---|
1 |
SIGABRT Abnormal program termination. |
2 |
SIGFPE Floating-point error pke spanision by zero. |
3 |
SIGILL Illegal operation. |
4 |
SIGINT Interrupt signal such as ctrl-C. |
5 |
SIGSEGV Invapd access to storage pke segment violation. |
6 |
SIGTERM Termination request. |
Library Functions
Following are the functions defined in the header signal.h −
Sr.No. | Function & Description |
---|---|
1 |
This function sets a function to handle signal i.e. a signal handler. |
2 |
This function causes signal sig to be generated. The sig argument is compatible with the SIG macros. |