|
Packit |
7cfc04 |
'\" et
|
|
Packit |
7cfc04 |
.TH ERRNO "3P" 2013 "IEEE/The Open Group" "POSIX Programmer's Manual"
|
|
Packit |
7cfc04 |
.SH PROLOG
|
|
Packit |
7cfc04 |
This manual page is part of the POSIX Programmer's Manual.
|
|
Packit |
7cfc04 |
The Linux implementation of this interface may differ (consult
|
|
Packit |
7cfc04 |
the corresponding Linux manual page for details of Linux behavior),
|
|
Packit |
7cfc04 |
or the interface may not be implemented on Linux.
|
|
Packit |
7cfc04 |
|
|
Packit |
7cfc04 |
.SH NAME
|
|
Packit |
7cfc04 |
errno
|
|
Packit |
7cfc04 |
\(em error return value
|
|
Packit |
7cfc04 |
.SH SYNOPSIS
|
|
Packit |
7cfc04 |
.LP
|
|
Packit |
7cfc04 |
.nf
|
|
Packit |
7cfc04 |
#include <errno.h>
|
|
Packit |
7cfc04 |
.fi
|
|
Packit |
7cfc04 |
.SH DESCRIPTION
|
|
Packit |
7cfc04 |
The lvalue
|
|
Packit |
7cfc04 |
.IR errno
|
|
Packit |
7cfc04 |
is used by many functions to return error values.
|
|
Packit |
7cfc04 |
.P
|
|
Packit |
7cfc04 |
Many functions provide an error number in
|
|
Packit |
7cfc04 |
.IR errno ,
|
|
Packit |
7cfc04 |
which has type
|
|
Packit |
7cfc04 |
.BR int
|
|
Packit |
7cfc04 |
and is defined in
|
|
Packit |
7cfc04 |
.IR <errno.h> .
|
|
Packit |
7cfc04 |
The value of
|
|
Packit |
7cfc04 |
.IR errno
|
|
Packit |
7cfc04 |
shall be defined only after a call to a function for which it is
|
|
Packit |
7cfc04 |
explicitly stated to be set and until it is changed by the next
|
|
Packit |
7cfc04 |
function call or if the application assigns it a value. The value of
|
|
Packit |
7cfc04 |
.IR errno
|
|
Packit |
7cfc04 |
should only be examined when it is indicated to be valid by a
|
|
Packit |
7cfc04 |
function's return value. Applications shall obtain the definition of
|
|
Packit |
7cfc04 |
.IR errno
|
|
Packit |
7cfc04 |
by the inclusion of
|
|
Packit |
7cfc04 |
.IR <errno.h> .
|
|
Packit |
7cfc04 |
No function in this volume of POSIX.1\(hy2008 shall set
|
|
Packit |
7cfc04 |
.IR errno
|
|
Packit |
7cfc04 |
to 0. The setting of
|
|
Packit |
7cfc04 |
.IR errno
|
|
Packit |
7cfc04 |
after a successful call to a function is unspecified unless the
|
|
Packit |
7cfc04 |
description of that function specifies that
|
|
Packit |
7cfc04 |
.IR errno
|
|
Packit |
7cfc04 |
shall not be modified.
|
|
Packit |
7cfc04 |
.P
|
|
Packit |
7cfc04 |
It is unspecified whether
|
|
Packit |
7cfc04 |
.IR errno
|
|
Packit |
7cfc04 |
is a macro or an identifier declared with external linkage. If a macro
|
|
Packit |
7cfc04 |
definition is suppressed in order to access an actual object, or a
|
|
Packit |
7cfc04 |
program defines an identifier with the name
|
|
Packit |
7cfc04 |
.IR errno ,
|
|
Packit |
7cfc04 |
the behavior is undefined.
|
|
Packit |
7cfc04 |
.P
|
|
Packit |
7cfc04 |
The symbolic values stored in
|
|
Packit |
7cfc04 |
.IR errno
|
|
Packit |
7cfc04 |
are documented in the ERRORS sections on all relevant pages.
|
|
Packit |
7cfc04 |
.SH "RETURN VALUE"
|
|
Packit |
7cfc04 |
None.
|
|
Packit |
7cfc04 |
.SH ERRORS
|
|
Packit |
7cfc04 |
None.
|
|
Packit |
7cfc04 |
.LP
|
|
Packit |
7cfc04 |
.IR "The following sections are informative."
|
|
Packit |
7cfc04 |
.SH EXAMPLES
|
|
Packit |
7cfc04 |
None.
|
|
Packit |
7cfc04 |
.SH "APPLICATION USAGE"
|
|
Packit |
7cfc04 |
Previously both POSIX and X/Open documents were more restrictive than
|
|
Packit |
7cfc04 |
the ISO\ C standard in that they required
|
|
Packit |
7cfc04 |
.IR errno
|
|
Packit |
7cfc04 |
to be defined as an external variable, whereas the ISO\ C standard required only
|
|
Packit |
7cfc04 |
that
|
|
Packit |
7cfc04 |
.IR errno
|
|
Packit |
7cfc04 |
be defined as a modifiable lvalue with type
|
|
Packit |
7cfc04 |
.BR int .
|
|
Packit |
7cfc04 |
.P
|
|
Packit |
7cfc04 |
An application that needs to examine the value of
|
|
Packit |
7cfc04 |
.IR errno
|
|
Packit |
7cfc04 |
to determine the error should set it to 0 before a function call, then
|
|
Packit |
7cfc04 |
inspect it before a subsequent function call.
|
|
Packit |
7cfc04 |
.SH RATIONALE
|
|
Packit |
7cfc04 |
None.
|
|
Packit |
7cfc04 |
.SH "FUTURE DIRECTIONS"
|
|
Packit |
7cfc04 |
None.
|
|
Packit |
7cfc04 |
.SH "SEE ALSO"
|
|
Packit |
7cfc04 |
.IR "Section 2.3" ", " "Error Numbers"
|
|
Packit |
7cfc04 |
.P
|
|
Packit |
7cfc04 |
The Base Definitions volume of POSIX.1\(hy2008,
|
|
Packit |
7cfc04 |
.IR "\fB<errno.h>\fP"
|
|
Packit |
7cfc04 |
.SH COPYRIGHT
|
|
Packit |
7cfc04 |
Portions of this text are reprinted and reproduced in electronic form
|
|
Packit |
7cfc04 |
from IEEE Std 1003.1, 2013 Edition, Standard for Information Technology
|
|
Packit |
7cfc04 |
-- Portable Operating System Interface (POSIX), The Open Group Base
|
|
Packit |
7cfc04 |
Specifications Issue 7, Copyright (C) 2013 by the Institute of
|
|
Packit |
7cfc04 |
Electrical and Electronics Engineers, Inc and The Open Group.
|
|
Packit |
7cfc04 |
(This is POSIX.1-2008 with the 2013 Technical Corrigendum 1 applied.) In the
|
|
Packit |
7cfc04 |
event of any discrepancy between this version and the original IEEE and
|
|
Packit |
7cfc04 |
The Open Group Standard, the original IEEE and The Open Group Standard
|
|
Packit |
7cfc04 |
is the referee document. The original Standard can be obtained online at
|
|
Packit |
7cfc04 |
http://www.unix.org/online.html .
|
|
Packit |
7cfc04 |
|
|
Packit |
7cfc04 |
Any typographical or formatting errors that appear
|
|
Packit |
7cfc04 |
in this page are most likely
|
|
Packit |
7cfc04 |
to have been introduced during the conversion of the source files to
|
|
Packit |
7cfc04 |
man page format. To report such errors, see
|
|
Packit |
7cfc04 |
https://www.kernel.org/doc/man-pages/reporting_bugs.html .
|