From owner-freebsd-arch@FreeBSD.ORG Sat Jun 19 10:59:44 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 52FA216A4CE for ; Sat, 19 Jun 2004 10:59:44 +0000 (GMT) Received: from nagual.pp.ru (pobrecita.freebsd.ru [194.87.13.42]) by mx1.FreeBSD.org (Postfix) with ESMTP id 98CBD43D46 for ; Sat, 19 Jun 2004 10:59:43 +0000 (GMT) (envelope-from ache@pobrecita.freebsd.ru) Received: from pobrecita.freebsd.ru (ache@localhost [127.0.0.1]) by nagual.pp.ru (8.12.11/8.12.11) with ESMTP id i5JAxedG069632 for ; Sat, 19 Jun 2004 14:59:40 +0400 (MSD) (envelope-from ache@pobrecita.freebsd.ru) Received: (from ache@localhost) by pobrecita.freebsd.ru (8.12.11/8.12.11/Submit) id i5JAxdfE069631 for freebsd-arch@freebsd.org; Sat, 19 Jun 2004 14:59:39 +0400 (MSD) (envelope-from ache) Date: Sat, 19 Jun 2004 14:59:39 +0400 From: Andrey Chernov To: freebsd-arch@freebsd.org Message-ID: <20040619105938.GA69596@nagual.pp.ru> Mail-Followup-To: Andrey Chernov , freebsd-arch@freebsd.org References: <20040609154040.GA26229@asura.bsd> <20040610021356.GA4990@VARK.homeunix.com> <20040610025439.GA11655@cat.robbins.dropbear.id.au> <20040619095642.GA67130@sanatana.dharma> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040619095642.GA67130@sanatana.dharma> User-Agent: Mutt/1.5.6i X-AntiVirus: checked by AntiVir Milter 1.1-beta; AVE 6.25.0.62; VDF 6.25.0.102 (host: pobrecita.freebsd.ru) 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: Sat, 19 Jun 2004 10:59:44 -0000 On Sat, Jun 19, 2004 at 11:56:43AM +0200, Radim Kolar wrote: > Today I have stepped on another example: advancecomp (in ports): > 543 * Get the size of the file. > 544 */ > 545 long fzsize(adv_fz* f) > 546 { > 547 if (f->type == fz_file) { > 548 struct stat st; > 549 if (fflush(f->f) != 0) { > 550 return -1; > 551 } This program relies on undocumented behaviour and should be fixed in anycase. Besides of that the only reasonable approach we can take is to do what majority of systems does here. Since you are interested in the subject, please post specific table for all main systems in the form like: System readonly fflush() behaviour -- Andrey Chernov | http://ache.pp.ru/