From owner-freebsd-arch@FreeBSD.ORG Wed Jun 9 16:43:35 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 EE01716A4DC for ; Wed, 9 Jun 2004 16:43:34 +0000 (GMT) Received: from mail.tiscali.cz (stateless2.tiscali.cz [213.235.135.71]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4FB3D43D46 for ; Wed, 9 Jun 2004 16:43:34 +0000 (GMT) (envelope-from hsn@netmag.cz) Received: from asura.bsd (212.11.96.191) by mail.tiscali.cz (6.7.021) id 40B1F786006F6FEC for freebsd-arch@freebsd.org; Wed, 9 Jun 2004 18:43:33 +0200 Received: from hsn@localhost by asura.bsd (Exim 4.33_1 FreeBSD) id 1BY5Bw-000G5i-6y for ; Wed, 09 Jun 2004 17:40:40 +0200 Date: Wed, 9 Jun 2004 17:40:40 +0200 From: Radim Kolar To: freebsd-arch@freebsd.org Message-ID: <20040609154040.GA26229@asura.bsd> Mail-Followup-To: freebsd-arch@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.6i Subject: 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: Wed, 09 Jun 2004 16:43:35 -0000 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 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 Are there any other reasons for non commiting it? I think that in this case pro > cons.