From owner-freebsd-hackers Wed Nov 22 10:39:33 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from mail.rpi.edu (mail.rpi.edu [128.113.100.7]) by hub.freebsd.org (Postfix) with ESMTP id 9252B37B479 for ; Wed, 22 Nov 2000 10:39:30 -0800 (PST) Received: from [128.113.24.47] (gilead.acs.rpi.edu [128.113.24.47]) by mail.rpi.edu (8.9.3/8.9.3) with ESMTP id NAA604312; Wed, 22 Nov 2000 13:39:17 -0500 Mime-Version: 1.0 X-Sender: drosih@mail.rpi.edu Message-Id: In-Reply-To: <200011221736.eAMHaBK13156@earth.backplane.com> References: <200011221225.OAA04292@siri.nordier.com> <200011221736.eAMHaBK13156@earth.backplane.com> Date: Wed, 22 Nov 2000 13:39:15 -0500 To: Matt Dillon , Robert Nordier From: Garance A Drosihn Subject: Re: fclose vs ferror (from libc/getcap) Cc: dcs@newsguy.com (Daniel C. Sobral), hackers@FreeBSD.ORG Content-Type: text/plain; charset="us-ascii" ; format="flowed" Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG At 9:36 AM -0800 11/22/00, Matt Dillon wrote: > [...] When you fclose() something or otherwise terminate a > structure, it's gone. Anything else is illegal. *internally* > our libc assumes that ferror() is legal after an fclose() > because, well, it's true... but only for internal library > functions. Nobody outside the library can legally make that > assumption and it could also be argued that even within the > library those types of assumptions should not be made unless > absolutely necessary. Hmm. That does bring up an important point. The code with the fclose/ferror combination *is* something I was taking directly out of libc. So, it would have more right than most code to make explicit assumptions about the implementation of other libc routines. I had not thought of it in that way, mainly because I pulled it out of libc at least five years ago, and it didn't cause me any trouble until this month. > There isn't much we can do about the issue except fix the > instances of mis-programming as they show up. Yep. Oh well. On to the next tempest, please pass the tea. -- --- Garance Alistair Drosehn = gad@eclipse.acs.rpi.edu Senior Systems Programmer or gad@freebsd.org Rensselaer Polytechnic Institute or drosih@rpi.edu To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message