Module Name:    src
Committed By:   snj
Date:           Sun Jul 26 18:35:50 UTC 2009

Modified Files:
        src/lib/libc/sys [netbsd-5-0]: intro.2

Log Message:
Pull up following revision(s) (requested by dholland in ticket #867):
        lib/libc/sys/intro.2: revisions 1.53, 1.54
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.49 -r1.49.14.1 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.49 src/lib/libc/sys/intro.2:1.49.14.1
--- src/lib/libc/sys/intro.2:1.49	Wed Feb 13 10:48:18 2008
+++ src/lib/libc/sys/intro.2	Sun Jul 26 18:35:50 2009
@@ -1,4 +1,4 @@
-.\"	$NetBSD: intro.2,v 1.49 2008/02/13 10:48:18 rillig Exp $
+.\"	$NetBSD: intro.2,v 1.49.14.1 2009/07/26 18:35:50 snj Exp $
 .\"
 .\" Copyright (c) 1980, 1983, 1986, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\"
 .\"     @(#)intro.2	8.5 (Berkeley) 2/27/95
 .\"
-.Dd November 4, 2007
+.Dd July 23, 2009
 .Dt INTRO 2
 .Os
 .Sh NAME
@@ -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