aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJohn Birrell <jb@FreeBSD.org>1998-04-30 09:49:59 +0000
committerJohn Birrell <jb@FreeBSD.org>1998-04-30 09:49:59 +0000
commit26dac9064894e84bb8bafe0c2af09d840e369181 (patch)
tree6de67266d759c458bd6a32058be2a804d5b71727 /lib
parent1b46cb523df32c4d1d4aaab1168b8f7f808206c1 (diff)
Notes
Diffstat (limited to 'lib')
-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 e8415938020d..6443d200c01e 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