| C standard library |
errno.h is a header file in the standard library of C programming language. It defines macros to report error conditions through error codes.
The errno macro expands to an lvalue with type int, containing the last error code generated in any function using the errno facility.
Three macros expand to integer constants which represent the error codes:
EDOMresults from a parameter outside a function's domain, for examplesqrt(-1)ERANGEresults from a result outside a function's range, for examplestrtol("0xfffffffff",NULL,0)EILSEQresults from an illegal character sequence, for examplewcstombs(str, L"\xffff", 2)
POSIX compliant operating systems like UNIX or Linux may include other macros to represent other operating system error code numbers.
On December 19, 2003 the SCO Group issued DMCA notices to selected Fortune 1000 companies, alleging the errno.h file was copied from UNIX into Linux without authorization. Linus Torvalds, the creator and trademark holder of Linux, has denied SCO's claim, saying he wrote the code for Linux's version himself. See Error codes in Linux for standard error codes in Linux.
See also
External links
- : system error numbers – Base Definitions Reference, The Single UNIX® Specification, Issue 7 from The Open Group
- Linus Torvalds's commentary on errno.h
- Commentary on the SCO Dec 2003 ABI Files letter, including a detailed analysis of the history of errno.h
- Warren Toomey, of the UNIX Heritage Society, traces the history of errno.h in Unix and Linux
- Lists of errno values, both numeric and symbolic
- A program to display errno values
This entry is from Wikipedia, the leading user-contributed encyclopedia. It may not have been reviewed by professional editors (see full disclaimer)




