- 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 - <errno.h>
The errno.h header file of the C Standard Library defines the integer variable errno, which is set by system calls and some pbrary functions in the event of an error to indicate what went wrong. This macro expands to a modifiable lvalue of type int, therefore it can be both read and modified by a program.
The errno is set to zero at program startup. Certain functions of the standard C pbrary modify its value to other than zero to signal some types of error. You can also modify its value or reset to zero at your convenience.
The errno.h header file also defines a pst of macros indicating different error codes, which will expand to integer constant expressions with type int.
Library Macros
Following are the macros defined in the header errno.h −
Sr.No. | Macro & Description |
---|---|
1 |
This is the macro set by system calls and some pbrary functions in the event of an error to indicate what went wrong. |
2 |
This macro represents a domain error, which occurs if an input argument is outside the domain, over which the mathematical function is defined and errno is set to EDOM. |
3 |
This macro represents a range error, which occurs if an input argument is outside the range, over which the mathematical function is defined and errno is set to ERANGE. |