C Standard Library - <errno.h>


Introduction

The errno.h header file of the C standard library defines the integer variable errno, which is set through a system call. In the error Certain library functions in the event indicate what went wrong. This macro expands to a mutable lvalue of type int so that it can be read and modified by a program.

errno is set to zero when the program starts, and certain functions in the C standard library modify its value to some non-zero value to indicate certain types of errors. You can also modify its value or reset it to zero when appropriate.

errno.h The header file also supports a series of macros representing different error codes. These macros should be expanded to integer constant expressions of type int.

Library macros

The macros defined in the header file errno.h are listed below:

Serial number Macro & Description
1extern int errno
This is a macro set via a system call, and certain library functions in the error event indicate what happened error.
2EDOM Domain Error
This macro indicates a domain error, which occurs when the input parameters exceed the domain defined by the mathematical function, errno is set to EDOM .
3ERANGE Range Error
This macro represents a range error, which occurs when the input parameters exceed the range defined by the mathematical function, errno is set to ERANGE .