From owner-freebsd-current Wed Jun 17 16:42:33 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id QAA04970 for freebsd-current-outgoing; Wed, 17 Jun 1998 16:42:33 -0700 (PDT) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from rover.village.org (rover.village.org [204.144.255.49]) by hub.freebsd.org (8.8.8/8.8.8) with SMTP id QAA04896 for ; Wed, 17 Jun 1998 16:42:23 -0700 (PDT) (envelope-from imp@village.org) Received: from harmony [10.0.0.6] by rover.village.org with esmtp (Exim 1.71 #1) id 0ymRq8-0004s2-00; Wed, 17 Jun 1998 17:42:04 -0600 Received: from harmony.village.org (localhost [127.0.0.1]) by harmony.village.org (8.8.8/8.8.3) with ESMTP id RAA28599; Wed, 17 Jun 1998 17:42:32 -0600 (MDT) Message-Id: <199806172342.RAA28599@harmony.village.org> To: Richard Tobin Subject: Re: Bogus errno twiddling by lstat... Cc: Terry Lambert , current@FreeBSD.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> Date: Wed, 17 Jun 1998 17:42:32 -0600 From: Warner Losh Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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