errno.h(0P)
πΈ errno.h β system error numbers πΈ
okay bestie, welcome to the errno.h page from the POSIX Programmer's Manual β yes, the whole vibe is "here's every error number your code will ever dramatically sob about." grab a strawberry π and let's go.
β¨ PROLOG β¨
so, real talk: this manual page is part of the POSIX Programmer's Manual. the Linux implementation of this interface may differ (so go check the corresponding Linux manual page for the actual Linux behavior), or honestly the interface might not even be implemented on Linux at all. π
π NAME π
errno.h β system error numbers. that's it, that's the whole name, iconic.
π SYNOPSIS π
#include <errno.h>
π¦ DESCRIPTION π¦
Some of the functionality described on this reference page extends the ISO C standard. And if there's any conflict between the requirements described here and the ISO C standard? That conflict is unintentional, no cap. This volume of POSIX.1β2017 defers to the ISO C standard.
The ISO C standard only requires the symbols [EDOM], [EILSEQ], and [ERANGE] to be defined. that's the bare minimum, the rest is extra π
The <errno.h> header shall provide a declaration or definition for errno. The symbol errno shall expand to a modifiable lvalue of type int. Now β it is unspecified whether errno is a macro or an identifier declared with external linkage. And listen:
If a macro definition is suppressed in order to access an actual object, or a program defines an identifier with the name errno, the behavior is undefined. π don't do it, bestie.
The <errno.h> header shall define the following macros, which shall expand to integer constant expressions with type int, distinct positive values (except as noted below), and which shall be suitable for use in #if preprocessing directives. slay. here's the whole roster:
E2BIGβ argument list too long. it's giving too much, fr fr.EACCESβ permission denied. the bouncer said no.EADDRINUSEβ address in use.EADDRNOTAVAILβ address not available.EAFNOSUPPORTβ address family not supported.EAGAINβ resource unavailable, try again (may be the same value as[EWOULDBLOCK]).EALREADYβ connection already in progress.EBADFβ bad file descriptor.EBADMSGβ bad message.EBUSYβ device or resource busy.ECANCELEDβ operation canceled.ECHILDβ no child processes.ECONNABORTEDβ connection aborted.ECONNREFUSEDβ connection refused.ECONNRESETβ connection reset.EDEADLKβ resource deadlock would occur.EDESTADDRREQβ destination address required.EDOMβ mathematics argument out of domain of function.EDQUOTβ reserved.EEXISTβ file exists.EFAULTβ bad address.EFBIGβ file too large.EHOSTUNREACHβ host is unreachable.EIDRMβ identifier removed.EILSEQβ illegal byte sequence.EINPROGRESSβ operation in progress.EINTRβ interrupted function.EINVALβ invalid argument.EIOβ I/O error.EISCONNβ socket is connected.EISDIRβ is a directory.ELOOPβ too many levels of symbolic links.EMFILEβ file descriptor value too large.EMLINKβ too many links.EMSGSIZEβ message too large.EMULTIHOPβ reserved.ENAMETOOLONGβ filename too long.ENETDOWNβ network is down.ENETRESETβ connection aborted by network.ENETUNREACHβ network unreachable.ENFILEβ too many files open in system.ENOBUFSβ no buffer space available.ENODATAβ no message is available on the STREAM head read queue.ENODEVβ no such device.ENOENTβ no such file or directory.ENOEXECβ executable file format error.ENOLCKβ no locks available.ENOLINKβ reserved.ENOMEMβ not enough space.ENOMSGβ no message of the desired type.ENOPROTOOPTβ protocol not available.ENOSPCβ no space left on device.ENOSRβ no STREAM resources.ENOSTRβ not a STREAM.ENOSYSβ functionality not supported.ENOTCONNβ the socket is not connected.ENOTDIRβ not a directory or a symbolic link to a directory.ENOTEMPTYβ directory not empty.ENOTRECOVERABLEβ state not recoverable.ENOTSOCKβ not a socket.ENOTSUPβ not supported (may be the same value as[EOPNOTSUPP]).ENOTTYβ inappropriate I/O control operation.ENXIOβ no such device or address.EOPNOTSUPPβ operation not supported on socket (may be the same value as[ENOTSUP]).EOVERFLOWβ value too large to be stored in data type.EOWNERDEADβ previous owner died.EPERMβ operation not permitted.EPIPEβ broken pipe.EPROTOβ protocol error.EPROTONOSUPPORTβ protocol not supported.EPROTOTYPEβ protocol wrong type for socket.ERANGEβ result too large.EROFSβ read-only file system.ESPIPEβ invalid seek.ESRCHβ no such process.ESTALEβ reserved.ETIMEβ streamioctl()timeout.ETIMEDOUTβ connection timed out.ETXTBSYβ text file busy.EWOULDBLOCKβ operation would block (may be the same value as[EAGAIN]).EXDEVβ cross-device link.
The following sections are informative. (iykyk β informative means "nice to know," not "required, periodt.")
π APPLICATION USAGE π
Additional error numbers may be defined on conforming systems β so don't be shocked when you meet one you've never heard of. See the System Interfaces volume of POSIX.1β2017 for the tea. π«Ά
β RATIONALE β
None. literally none. the void. π
π§ FUTURE DIRECTIONS π§
None. also the void. π
π SEE ALSO π
- The System Interfaces volume of POSIX.1β2017, Section 2.3, Error Numbers
π COPYRIGHT π
Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1-2017, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html .
Any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format. To report such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html .
okay that's the whole thing, you made it to the end, main character energy fr fr π this was IEEE/The Open Group, 2017 β errno.h(0P) β signing off, mwah πππ¦
π¦ where this page comes from
- alpine 3.22: man-pages-posix 2017a-r0 Β· custom
- alpine 3.23: man-pages-posix 2017a-r0 Β· custom
- alpine 3.24: man-pages-posix 2017a-r0 Β· custom
- arch rolling: man-pages 6.19-1
- arch rolling: man-pages 6.20-1 Β· BSD-2-Clause AND BSD-3-Clause AND BSD-4.3TAHOE AND BSD-4-Clause-UC AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-3.0-linking-exception AND LGPL-3.0-or-later AND LicenseRef-Public-Domain AND LicenseRef-UltraPermissive AND Linux-man-pages-1-para AND Linux-man-pages-copyleft AND Linux-man-pages-copyleft-2-para AND Linux-man-pages-copyleft-var AND MIT AND Spencer-94
- nixpkgs unstable: man-pages-posix 2017a
- opensuse-leap 16.0: man-pages-posix 2017a-160000.4.1 Β· SUSE-IEEE
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms