~ubuntu-branches/ubuntu/precise/manpages-posix/precise

1 by Francesco Paolo Lovergine
rules: linking manpages-posix not manpages.
1
.\" Copyright (c) 2001-2003 The Open Group, All Rights Reserved 
2 by Francesco Paolo Lovergine
* Alligned to linux main manpages edition.
2
.TH "ERRNO" P 2003 "IEEE/The Open Group" "POSIX Programmer's Manual"
1 by Francesco Paolo Lovergine
rules: linking manpages-posix not manpages.
3
.\" errno 
4
.SH NAME
5
errno \- error return value
6
.SH SYNOPSIS
7
.LP
8
\fB#include <errno.h>\fP
9
.SH DESCRIPTION
10
.LP
11
The lvalue \fIerrno\fP is used by many functions to return error values.
12
.LP
13
Many functions provide an error number in \fIerrno\fP, which has type
14
\fBint\fP and is defined in \fI<errno.h>\fP. The value of \fIerrno\fP
15
shall be defined only after a call to a function
16
for which it is explicitly stated to be set and until it is changed
17
by the next function call or if the application assigns it a
18
value. The value of \fIerrno\fP should only be examined when it is
19
indicated to be valid by a function's return value.
20
Applications shall obtain the definition of \fIerrno\fP by the inclusion
21
of \fI<errno.h>\fP. No function in this volume of IEEE\ Std\ 1003.1-2001
22
shall set
23
\fIerrno\fP to 0.
24
.LP
25
It is unspecified whether \fIerrno\fP is a macro or an identifier
26
declared with external linkage. If a macro definition is
27
suppressed in order to access an actual object, or a program defines
28
an identifier with the name \fIerrno\fP, the behavior is
29
undefined.
30
.LP
31
The symbolic values stored in \fIerrno\fP are documented in the ERRORS
32
sections on all relevant pages.
33
.SH RETURN VALUE
34
.LP
35
None.
36
.SH ERRORS
37
.LP
38
None.
39
.LP
40
\fIThe following sections are informative.\fP
41
.SH EXAMPLES
42
.LP
43
None.
44
.SH APPLICATION USAGE
45
.LP
46
Previously both POSIX and X/Open documents were more restrictive than
47
the ISO\ C standard in that they required \fIerrno\fP
48
to be defined as an external variable, whereas the ISO\ C standard
49
required only that \fIerrno\fP be defined as a modifiable
50
lvalue with type \fBint\fP.
51
.LP
52
An application that needs to examine the value of \fIerrno\fP to determine
53
the error should set it to 0 before a function call,
54
then inspect it before a subsequent function call.
55
.SH RATIONALE
56
.LP
57
None.
58
.SH FUTURE DIRECTIONS
59
.LP
60
None.
61
.SH SEE ALSO
62
.LP
63
\fIError Numbers\fP , the Base Definitions volume of IEEE\ Std\ 1003.1-2001,
64
\fI<errno.h>\fP
65
.SH COPYRIGHT
66
Portions of this text are reprinted and reproduced in electronic form
67
from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
68
-- Portable Operating System Interface (POSIX), The Open Group Base
69
Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of
70
Electrical and Electronics Engineers, Inc and The Open Group. In the
71
event of any discrepancy between this version and the original IEEE and
72
The Open Group Standard, the original IEEE and The Open Group Standard
73
is the referee document. The original Standard can be obtained online at
74
http://www.opengroup.org/unix/online.html .