summaryrefslogtreecommitdiffstats
path: root/lib/libc/sys
diff options
context:
space:
mode:
authorjb <jb@FreeBSD.org>1998-04-30 09:49:59 +0000
committerjb <jb@FreeBSD.org>1998-04-30 09:49:59 +0000
commit3a6394e02b74d2316f026b941b2634d7ed09fd55 (patch)
treee1e11c1e8fe4051d12d007c427992c2fbfc27e9a /lib/libc/sys
parent0e07a10674d32f8462443fd28f02ca71927dca4d (diff)
downloadFreeBSD-src-3a6394e02b74d2316f026b941b2634d7ed09fd55.zip
FreeBSD-src-3a6394e02b74d2316f026b941b2634d7ed09fd55.tar.gz
Change the description of errno to match the thread-aware implementation
from 3.0 on. With 3.0 being a major release, now is a good time to do this.
Diffstat (limited to 'lib/libc/sys')
-rw-r--r--lib/libc/sys/intro.238
1 files changed, 6 insertions, 32 deletions
diff --git a/lib/libc/sys/intro.2 b/lib/libc/sys/intro.2
index e841593..6443d20 100644
--- a/lib/libc/sys/intro.2
+++ b/lib/libc/sys/intro.2
@@ -50,46 +50,20 @@ their error returns, and other common definitions and concepts.
Nearly all of the system calls provide an error number referenced via
the external identifier errno. This identifier is defined in
.Aq Pa sys/errno.h
-for non-threaded programs as:
-.Pp
-.Dl extern int errno;
-.Pp
-and for threaded programs as:
+as
.Pp
.Dl extern int * __error();
.Dl #define errno (* __error())
.Pp
-A threaded program must be compiled with
-.Va _THREAD_SAFE
-defined so that the preprocessor will output the appropriate errno
-definition to the compiler. Failure to do so will mean that error
-variables will not be thread specific.
-.Pp
-The threaded library implementation of
+The
.Va __error()
-returns a pointer to a field in the thread specific structure for
-threads other than the initial thread. For the initial thread,
+function returns a pointer to a field in the thread specific structure for
+threads other than the initial thread. For the initial thread and
+non-threaded processes,
.Va __error()
returns a pointer to a global
.Va errno
-variable that is compatible with that used by non-threaded programs.
-This allows the initial thread to call functions in libraries which have
-not been compiled with
-.Va _THREAD_SAFE .
-Programmers should ensure that threads other than the initial thread only
-call functions in libraries that have been compiled with
-.Va _THREAD_SAFE .
-.Pp
-Programmers should include
-.Aq Pa sys/errno.h
-to obtain the definition of
-.Va errno
-rather than coding the definition as an external reference directly. It is
-planned that the
-.Va extern int errno
-definition will eventually be replaced by the threaded definition so that
-all libraries will have a thread-aware treatment of
-.Va errno .
+variable that is compatible with the previous definition.
.Pp
When a system call detects an error,
it returns an integer value
OpenPOWER on IntegriCloud