Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 22 Jun 1998 22:20:02 PDT
From:      Bill Fenner <fenner@parc.xerox.com>
To:        Terry Lambert <tlambert@primenet.com>
Cc:        peter@netplex.com.au (Peter Wemm), joelh@gnu.org, fenner@parc.xerox.com, current@FreeBSD.ORG
Subject:   Re: Bogus errno twiddling by lstat... 
Message-ID:  <199806230520.WAA03529@mango.parc.xerox.com>
In-Reply-To: Your message of "Mon, 22 Jun 1998 10:36:44 PDT." <199806221736.KAA11829@usr06.primenet.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
In message <199806221736.KAA11829@usr06.primenet.com> Terry wrote:
>Please don't quote the C standard to me; quote instead ... the
>Single UNIX Specification.

Ok.  Under "Errors", The Single UNIX ® Specification, Version 2,
Copyright © 1997 The Open Group says:

Some functions provide the error number in a variable accessed
through the symbol errno.
...
The value of errno should only be examined when it is indicated to
be valid by a function's return value.

(I don't know where this is in the printed edition; it's
susv2/xsh/errors.html in the HTML online edition)

>This is *far* differrent than stating that the value is indeterminate
>in the success case, which is what people are claiming.

I didn't find your quote in the SUS, but the one I did find made
it pretty clear that the value of errno may be indeterminate in
the success case (since you're instructed not to inspect it unless
you know an error has occurred).

You might find it interesting to read the chapter on errno.h in
P.J. Plauger's *The Standard C Library*.  He makes it clear how
little he (or, apparently, anyone involved with ANSI C) likes the
errno interface.

> 22622 ktrace   NAMI  "/etc/malloc.conf"
>*******^^^^^^***************************
> 22622 fum      NAMI  "/etc/malloc.conf"
>*******^^^******************************

malloc.conf is being readlink()'d by *two*different*programs*...

  Bill

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199806230520.WAA03529>