Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 17 Jun 1998 17:42:32 -0600
From:      Warner Losh <imp@village.org>
To:        Richard Tobin <richard@cogsci.ed.ac.uk>
Cc:        Terry Lambert <tlambert@primenet.com>, current@FreeBSD.ORG
Subject:   Re: Bogus errno twiddling by lstat... 
Message-ID:  <199806172342.RAA28599@harmony.village.org>
In-Reply-To: Your message of "Thu, 18 Jun 1998 00:13:05 BST." <22587.199806172313@cockburn.cogsci.ed.ac.uk> 
References:  <22587.199806172313@cockburn.cogsci.ed.ac.uk>  

next in thread | previous in thread | raw e-mail | index | archive | help
In message <22587.199806172313@cockburn.cogsci.ed.ac.uk> Richard Tobin writes:
: No!  A successful system call leaves it *unchanged*.  From intro(2):
: 
:      Successful calls never set errno; once set, it remains
:      until another error occurs.
: 
: I believe ANSI C has a similar requirement.

from lstat(2):

RETURN VALUES
     Upon successful completion a value of 0 is returned.  Otherwise, a value
     of -1 is returned and errno is set to indicate the error.

A reading of this could mean that errno is undefined when 0 is
returned.  However, that is a big stretch for most people :-)

Another poster hit the nail on the head.  printf(3) was called, which
means that errno will be undefined after that call, since it is
undefined how printf is implemented.  Note that printf(3) doesn't
define what happens to errno after the call, at least in the FreeBSD
man pages.

Warner

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?199806172342.RAA28599>