summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2015-01-19 21:29:39 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2015-01-19 21:29:39 +0000
commitc70217421cb38ee534fc8eb9a10cc7d9e2a07702 (patch)
tree3976739c89aea4a14ecad125a82730b684a63f6d
parent99c463b89855c8ed587230bbf7fa53369e610a99 (diff)
Talk about thread-local errno and do not mention "extern int errno".
Also correct the string version of error 0. OK guenther@
-rw-r--r--lib/libc/sys/intro.225
1 files changed, 13 insertions, 12 deletions
diff --git a/lib/libc/sys/intro.2 b/lib/libc/sys/intro.2
index 803bf811e1a..21bd61a0360 100644
--- a/lib/libc/sys/intro.2
+++ b/lib/libc/sys/intro.2
@@ -1,4 +1,4 @@
-.\" $OpenBSD: intro.2,v 1.57 2015/01/19 13:59:16 millert Exp $
+.\" $OpenBSD: intro.2,v 1.58 2015/01/19 21:29:38 millert Exp $
.\" $NetBSD: intro.2,v 1.6 1995/02/27 12:33:41 cgd Exp $
.\"
.\" Copyright (c) 1980, 1983, 1986, 1991, 1993
@@ -46,18 +46,19 @@ their error returns, and other common definitions and concepts.
.\".Pp
.\"<more later...>
.Sh DIAGNOSTICS
-Nearly all of the system calls provide an error number in the external
-variable
-.Va errno ,
-which is currently defined as:
-.Pp
-.Dl extern int errno;
-.Pp
-Portable applications must not depend on this definition, and should only
-use
+Nearly all of the system calls provide an error number via the identifier
+.Dv errno ,
+which expands to an addressable location of type
+.Vt int .
+The address of
+.Va errno
+in each thread is guaranteed to be unique for the lifetime of the thread.
+Applications must use
.Va errno
as defined in
-.In errno.h .
+.In errno.h
+and not attempt to use a custom definition.
+.Pp
When a system call detects an error, it returns an integer value
indicating failure (usually \-1) and sets the variable
.Va errno
@@ -76,7 +77,7 @@ The following is a complete list of the errors and their
names as given in
.In sys/errno.h .
.Bl -hang -width Ds
-.It Er 0 Em "Error 0" .
+.It Er 0 Em "Undefined error: 0" .
Not used.
.It Er 1 EPERM Em "Operation not permitted" .
An attempt was made to perform an operation limited to processes