From owner-freebsd-arch@FreeBSD.ORG Thu Jun 10 02:14:04 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8451F16A4D0 for ; Thu, 10 Jun 2004 02:14:04 +0000 (GMT) Received: from VARK.homeunix.com (ar59.lsanca2-4.27.98.47.lsanca2.dsl-verizon.net [4.27.98.47]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4795243D2D for ; Thu, 10 Jun 2004 02:14:04 +0000 (GMT) (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 i5A2DuiT005997 for ; Wed, 9 Jun 2004 19:13:56 -0700 (PDT) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by VARK.homeunix.com (8.12.11/8.12.10/Submit) id i5A2DuDD005996 for freebsd-arch@freebsd.org; Wed, 9 Jun 2004 19:13:56 -0700 (PDT) (envelope-from das@FreeBSD.ORG) Date: Wed, 9 Jun 2004 19:13:56 -0700 From: David Schultz To: freebsd-arch@FreeBSD.ORG Message-ID: <20040610021356.GA4990@VARK.homeunix.com> Mail-Followup-To: freebsd-arch@freebsd.org References: <20040609154040.GA26229@asura.bsd> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040609154040.GA26229@asura.bsd> Subject: Re: fflush() on readonly files X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2004 02:14:04 -0000 On Wed, Jun 09, 2004, Radim Kolar wrote: > I have submitted pr http://www.freebsd.org/cgi/query-pr.cgi?pr=65402 with patch > which makes fflush() on read only descriptors do not return error code. > > Reasons for this patch: > 1 - Do not breaks ISO C standard > 2 - Makes FreeBSD undefined behavior compatible with other operation systems > 3 - Correct some programs depending on this Are there any such programs? > 4 - Makes fflush() and fsync() behavior identical - avoids programmer's confusion. > 5 - If there are no data to flush() then flush operation (dummy) succeeds, not failed. > > Against this patch: > Programs which rely upon fflush() not returning an error > when passed a file which is opened read-only are broken, > and should be fixed. > > Colin Percival I don't see how that's an argument against it. Programs that call fflush() on a read-only stream are broken either way. > Are there any other reasons for non commiting it? I think that in this case > pro > cons. Well, I think all those other operating systems (Solaris, HP-UX, Linux, etc.) are wrong in this case, but it would probably behoove us to conform to the /de facto/ standard.