From owner-freebsd-current Tue Jun 16 16:55:46 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id QAA22618 for freebsd-current-outgoing; Tue, 16 Jun 1998 16:55:46 -0700 (PDT) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from smtp03.primenet.com (daemon@smtp03.primenet.com [206.165.6.133]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id QAA22613 for ; Tue, 16 Jun 1998 16:55:43 -0700 (PDT) (envelope-from tlambert@usr02.primenet.com) Received: (from daemon@localhost) by smtp03.primenet.com (8.8.8/8.8.8) id QAA25180 for ; Tue, 16 Jun 1998 16:55:40 -0700 (MST) Received: from usr02.primenet.com(206.165.6.202) via SMTP by smtp03.primenet.com, id smtpd025150; Tue Jun 16 16:55:33 1998 Received: (from tlambert@localhost) by usr02.primenet.com (8.8.5/8.8.5) id QAA06852 for current@freebsd.org; Tue, 16 Jun 1998 16:55:32 -0700 (MST) From: Terry Lambert Message-Id: <199806162355.QAA06852@usr02.primenet.com> Subject: Bogus errno twiddling by lstat... To: current@FreeBSD.ORG Date: Tue, 16 Jun 1998 23:55:32 +0000 (GMT) X-Mailer: ELM [version 2.4 PL25] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Try the following program: #include #include #include main() { struct stat sb; errno = 0; printf( "lstat(fred) = %d\n", lstat( "fred", &sb)); perror( "lstat"); } If "fred" exists in the current directory, you would expect that errno would not have been modified, and the output will be: lstat(fred) = 0 lstat: Undefined error: 0 However, what comes out instead is: lstat(fred) = 0 lstat: No such file or directory Indicating that lstat is diddling errno when it shouldn't be. 8-(. Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message