From owner-freebsd-current Sat Jun 20 12:49:23 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id MAA29089 for freebsd-current-outgoing; Sat, 20 Jun 1998 12:49:23 -0700 (PDT) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from mail.camalott.com (root@mail.camalott.com [208.203.140.2]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id MAA29067 for ; Sat, 20 Jun 1998 12:49:17 -0700 (PDT) (envelope-from joelh@gnu.org) Received: from detlev.UUCP (tex-72.camalott.com [208.229.74.72] (may be forged)) by mail.camalott.com (8.8.7/8.8.5) with ESMTP id OAA31028; Sat, 20 Jun 1998 14:48:38 -0500 Received: (from joelh@localhost) by detlev.UUCP (8.8.8/8.8.8) id OAA17700; Sat, 20 Jun 1998 14:49:02 -0500 (CDT) (envelope-from joelh) Date: Sat, 20 Jun 1998 14:49:02 -0500 (CDT) Message-Id: <199806201949.OAA17700@detlev.UUCP> To: tlambert@primenet.com CC: fenner@parc.xerox.com, tlambert@primenet.com, fenner@parc.xerox.com, peter@netplex.com.au, current@FreeBSD.ORG In-reply-to: <199806192152.OAA23766@usr08.primenet.com> (message from Terry Lambert on Fri, 19 Jun 1998 21:52:47 +0000 (GMT)) Subject: Re: Bogus errno twiddling by lstat... From: Joel Ray Holveck Reply-to: joelh@gnu.org References: <199806192152.OAA23766@usr08.primenet.com> Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG >> However, normal library >> functions are explicitly allowed to modify errno even if no error >> occurs. > Allowed to. > Should they, however? > I think "no". Whether it's a good idea or not, portable programs should be written to check errno only on errors. Our platform is not the only one that does this; some will set errno=ENOTTY when you don't write to a tty, etc, etc. If, however, you don't like our malloc's current implementation, and think that errno should be saved and restored across a successful call, and that the lost cycles would be worthwhile, then diffs would be perfectly welcome, I'm sure. I won't write them, because I think it's unnecessary, and have other things to do. Happy hacking, joelh -- Joel Ray Holveck - joelh@gnu.org - http://www.wp.com/piquan Fourth law of programming: Anything that can go wrong wi sendmail: segmentation violation - core dumped To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message