From owner-freebsd-current Sun Jun 21 00:33:55 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id AAA16610 for freebsd-current-outgoing; Sun, 21 Jun 1998 00:33:55 -0700 (PDT) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from spinner.netplex.com.au (spinner.netplex.com.au [202.12.86.3]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id AAA16605 for ; Sun, 21 Jun 1998 00:33:50 -0700 (PDT) (envelope-from peter@netplex.com.au) Received: from spinner.netplex.com.au (localhost [127.0.0.1]) by spinner.netplex.com.au (8.8.8/8.8.8/Spinner) with ESMTP id PAA27299; Sun, 21 Jun 1998 15:33:16 +0800 (WST) (envelope-from peter@spinner.netplex.com.au) Message-Id: <199806210733.PAA27299@spinner.netplex.com.au> X-Mailer: exmh version 2.0.2 2/24/98 To: Garance A Drosihn cc: current@FreeBSD.ORG Subject: Re: Bogus errno twiddling by lstat... In-reply-to: Your message of "Fri, 19 Jun 1998 18:08:54 -0400." Date: Sun, 21 Jun 1998 15:33:15 +0800 From: Peter Wemm Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Garance A Drosihn wrote: > One question I have is: > > Is there any reason that we must let lstat clobber the value of > errno? Could we just add a few-line update somewhere which > saves the value of errno on entry to lstat, and *if* no error > occurs then reset errno before returning to the caller of lstat? > > Or does this start us down a path of having all kinds of system > routines saving copies of errno? > > Note that I'm not really interested in whether lstat has the > "right" to clobber errno. I'm just wondering what advantage > there is in having it continue to clobber errno. Don't worry, lstat() isn't clobbering errno, it never has and never will. The "problem" was that the person reporting it was misinterpreting his results and using a bogus test program. malloc() (called by printf() in the test program) has been patched so that it will not change errno when starting up for the first time, even though it's perfectly allowed to. Cheers, -Peter -- Peter Wemm Netplex Consulting To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message