Module Name:    src
Committed By:   dholland
Date:           Thu Jul 23 02:31:56 UTC 2009

Modified Files:
        src/lib/libc/sys: intro.2

Log Message:
Mention, along with the behavior of succeeding system calls, the
normal behavior of succeeding library functions regarding errno.
(That is, they may leave arbitrary nonzero values in errno.)

Ok kleink@; related to PR lib/41567 as well as a recent thread on
tech-userlevel.


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/lib/libc/sys/intro.2

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/sys/intro.2
diff -u src/lib/libc/sys/intro.2:1.52 src/lib/libc/sys/intro.2:1.53
--- src/lib/libc/sys/intro.2:1.52	Tue Jun  2 13:15:41 2009
+++ src/lib/libc/sys/intro.2	Thu Jul 23 02:31:56 2009
@@ -1,4 +1,4 @@
-.\"	$NetBSD: intro.2,v 1.52 2009/06/02 13:15:41 pooka Exp $
+.\"	$NetBSD: intro.2,v 1.53 2009/07/23 02:31:56 dholland Exp $
 .\"
 .\" Copyright (c) 1980, 1983, 1986, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -64,10 +64,17 @@
 Successful calls never set
 .Va errno ;
 once set, it remains until another error occurs.
-It should only be examined after an error.
-Note that a number of system calls overload the meanings of these
-error numbers, and that the meanings must be interpreted according
-to the type and circumstances of the call.
+It should only be examined after an error has been reported, because
+otherwise a leftover value from some previous error may be found
+instead.
+.Po
+Many library functions that are not system calls also set
+.Va errno
+on return, in the same fashion.
+In these cases a nonzero value may be left in
+.Va errno
+even upon successful return if some internal action failed.
+.Pc
 .Pp
 The manual page for each system call will list some of the common
 errno codes that system call can return, but that should not be
@@ -78,6 +85,10 @@
 a more specification-like manner would take more resources than
 this project has available.
 .Pp
+Note also that a number of system calls overload the meanings of these
+error numbers, and that in these cases the meanings must be
+interpreted according to the type and circumstances of the call.
+.Pp
 The following is a complete list of the errors and their
 names as given in
 .Aq Pa errno.h .

Reply via email to