<s>
errno.h	B-Error_Name
is	O
a	O
header	B-Language
file	I-Language
in	O
the	O
standard	B-Language
library	I-Language
of	O
the	O
C	B-Language
programming	I-Language
language	I-Language
.	O
</s>
<s>
It	O
defines	O
macros	O
for	O
reporting	O
and	O
retrieving	O
error	O
conditions	O
using	O
the	O
symbol	O
errno	B-Error_Name
(	O
short	O
for	O
"	O
error	O
number	O
"	O
)	O
.	O
</s>
<s>
errno	B-Error_Name
acts	O
like	O
an	O
integer	O
variable	O
.	O
</s>
<s>
A	O
value	O
(	O
the	O
error	O
number	O
)	O
is	O
stored	O
in	O
errno	B-Error_Name
by	O
certain	O
library	B-Library
functions	I-Library
when	O
they	O
detect	O
errors	O
.	O
</s>
<s>
Library	B-Library
functions	I-Library
store	O
only	O
values	O
greater	O
than	O
zero	O
.	O
</s>
<s>
Any	O
library	B-Library
function	I-Library
can	O
alter	O
the	O
value	O
stored	O
before	O
return	O
,	O
whether	O
or	O
not	O
they	O
detect	O
errors	O
.	O
</s>
<s>
A	O
few	O
functions	O
require	O
the	O
caller	O
to	O
preset	O
errno	B-Error_Name
to	O
zero	O
and	O
test	O
it	O
afterwards	O
to	O
see	O
if	O
an	O
error	O
was	O
detected	O
.	O
</s>
<s>
The	O
errno	B-Error_Name
macro	O
expands	O
to	O
an	O
lvalue	O
with	O
type	O
int	O
,	O
sometimes	O
with	O
the	O
extern	O
and/or	O
volatile	O
type	O
specifiers	O
depending	O
upon	O
the	O
platform	O
.	O
</s>
<s>
Originally	O
this	O
was	O
a	O
static	O
memory	O
location	O
,	O
but	O
macros	O
are	O
almost	O
always	O
used	O
today	O
to	O
allow	O
for	O
multi-threading	B-Operating_System
,	O
so	O
that	O
each	O
thread	B-Operating_System
will	O
see	O
its	O
own	O
thread-local	O
error	O
number	O
.	O
</s>
<s>
The	O
header	B-Language
file	I-Language
also	O
defines	O
macros	O
that	O
expand	O
to	O
integer	O
constants	O
that	O
represent	O
the	O
error	O
codes	O
.	O
</s>
<s>
The	B-Language
C	I-Language
standard	I-Language
library	I-Language
only	O
requires	O
three	O
to	O
be	O
defined	O
:	O
</s>
<s>
POSIX	O
compliant	O
operating	B-General_Concept
systems	I-General_Concept
like	O
AIX	B-Application
,	O
Linux	B-Application
or	O
Solaris	B-Application
include	O
many	O
other	O
error	O
values	O
,	O
many	O
of	O
which	O
are	O
used	O
much	O
more	O
often	O
than	O
the	O
above	O
ones	O
,	O
such	O
as	O
EACCES	O
for	O
when	O
a	O
file	O
cannot	O
be	O
opened	O
for	O
reading	O
.	O
</s>
<s>
C++11	B-Language
additionally	O
defines	O
many	O
of	O
the	O
same	O
values	O
found	O
within	O
the	O
POSIX	O
specification	O
.	O
</s>
<s>
Traditionally	O
,	O
the	O
first	O
page	O
of	O
Unix	B-Protocol
system	I-Protocol
manuals	I-Protocol
,	O
named	O
intro(2 )	O
,	O
lists	O
all	O
errno.h	B-Error_Name
macros	O
,	O
but	O
this	O
is	O
not	O
the	O
case	O
with	O
Linux	B-Application
,	O
where	O
these	O
macros	O
are	O
instead	O
listed	O
in	O
the	O
errno(3 )	O
.	O
</s>
<s>
An	O
can	O
be	O
translated	O
to	O
a	O
descriptive	O
string	O
using	O
strerror	O
(	O
defined	O
in	O
string.h	B-Language
)	O
or	O
a	O
BSD	O
extension	O
called	O
.	O
</s>
<s>
The	O
translation	O
can	O
be	O
printed	O
directly	O
to	O
the	O
standard	O
error	O
stream	O
using	O
perror	O
(	O
defined	O
in	O
stdio.h	B-Language
)	O
.	O
</s>
<s>
As	O
in	O
many	O
Unix-like	O
systems	O
is	O
not	O
thread-safe	O
,	O
a	O
thread-safe	O
version	O
is	O
used	O
,	O
but	O
conflicting	O
definitions	O
from	O
POSIX	O
and	O
GNU	O
makes	O
it	O
even	O
less	O
portable	O
than	O
the	O
table	O
.	O
</s>
