From owner-freebsd-current Thu Jun 18 01:09:13 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id BAA13226 for freebsd-current-outgoing; Thu, 18 Jun 1998 01:09:13 -0700 (PDT) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from RVC1.Informatik.BA-Stuttgart.DE (rvc1.informatik.ba-stuttgart.de [141.31.112.22]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id BAA13220 for ; Thu, 18 Jun 1998 01:09:11 -0700 (PDT) (envelope-from helbig@RVC1.Informatik.BA-Stuttgart.DE) Received: (from helbig@localhost) by RVC1.Informatik.BA-Stuttgart.DE (8.8.8/8.8.8) id KAA05630; Thu, 18 Jun 1998 10:10:00 +0200 (CEST) Date: Thu, 18 Jun 1998 10:10:00 +0200 (CEST) From: Wolfgang Helbig Message-Id: <199806180810.KAA05630@RVC1.Informatik.BA-Stuttgart.DE> To: imp@village.org, richard@cogsci.ed.ac.uk, tlambert@primenet.com Subject: Re: Bogus errno twiddling by lstat... Cc: current@FreeBSD.ORG Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > > No. When a system call returns success, the value of errno is > > undefined. > > No! A successful system call leaves it *unchanged*. From intro(2): > > Successful calls never set errno; once set, it remains > until another error occurs. The wording in intro(2) is misleading. It should be: Successful calls never set errno to zero; > I believe ANSI C has a similar requirement. No, from the standard: The value of errno my be set to nonzero by a library function call whether or not there is an error ... > You should only examine errno after an error, but you are allowed to have > had intervening successful system calls. This would be nice, but a program that depends on this behaviour is not portable. Wolfgang To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message