From owner-freebsd-standards@FreeBSD.ORG Wed Mar 3 21:35:36 2004 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A495A16A4CE for ; Wed, 3 Mar 2004 21:35:36 -0800 (PST) Received: from VARK.homeunix.com (adsl-68-122-0-124.dsl.pltn13.pacbell.net [68.122.0.124]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7764343D1D for ; Wed, 3 Mar 2004 21:35:36 -0800 (PST) (envelope-from das@FreeBSD.ORG) Received: from VARK.homeunix.com (localhost [127.0.0.1]) by VARK.homeunix.com (8.12.11/8.12.10) with ESMTP id i245YgJQ030637; Wed, 3 Mar 2004 21:34:42 -0800 (PST) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by VARK.homeunix.com (8.12.11/8.12.10/Submit) id i245YgCG030636; Wed, 3 Mar 2004 21:34:42 -0800 (PST) (envelope-from das@FreeBSD.ORG) Date: Wed, 3 Mar 2004 21:34:42 -0800 From: David Schultz To: "Jordan K. Hubbard" Message-ID: <20040304053442.GA30305@VARK.homeunix.com> Mail-Followup-To: "Jordan K. Hubbard" , standards@FreeBSD.ORG, Bruce Evans References: <20040302165323.GA17665@VARK.homeunix.com> <20040303144451.T5253@gamplex.bde.org> <0805074F-6CC9-11D8-9000-000393BB9222@queasyweasel.com> <20040303195618.K1351@gamplex.bde.org> <20040303161532.GA27304@VARK.homeunix.com> <6759E5CE-6D50-11D8-9000-000393BB9222@queasyweasel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6759E5CE-6D50-11D8-9000-000393BB9222@queasyweasel.com> cc: standards@FreeBSD.ORG Subject: Re: Another conformance question... This time fputs(). X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Mar 2004 05:35:36 -0000 On Wed, Mar 03, 2004, Jordan K. Hubbard wrote: > > On Mar 3, 2004, at 8:15 AM, David Schultz wrote: > > >One could argue that EBADF is a perfectly reasonable error code to > >return in case (2) as well. It is consistent with the way other > >types of stdio streams work. Specifically, if the stream isn't > >writable (either because it was opened read-only and we don't have > >permission or because it was opened without a writefn and we don't > >support it) then we should get a single error code that reflects > >the fact that the stream isn't writable. The fputs(3) man page > >even says: > > > > [EBADF] The _stream_ argument is not a writable stream. > > > >It doesn't say anything about why the stream is not writable. > >Thus, there shouldn't be a problem with simply setting errno to > >EBADF in all failure cases in __swsetup(). > > I agree. Bruce doesn't seem to be happy with either this suggestion or the status quo, but he did point out that fclose(), fflush(), fpurge(), __fvwrite(), and __srefill() share this ``bug'' of setting errno to EBADF. > So, do you want to make the 2nd round of changes or shall I? I'd be happy to do it, but I'm going to be out of town a lot this month, so it might take me another three weeks if I can't find a big enough FreeBSD timeslice in my schedule next week. So if you want it done *soon*, you should probably do it. ;-)