From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from euclid.skiles.gatech.edu (list@euclid.skiles.gatech.edu [130.207.146.50]) by melb.werple.net.au (8.7.4/8.7.3) with ESMTP id LAA01840 for ; Wed, 13 Mar 1996 11:34:43 +1100 (EST) Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id TAA15799; Tue, 12 Mar 1996 19:16:50 -0500 (EST) Resent-Date: Tue, 12 Mar 1996 19:16:50 -0500 (EST) Sender: steve@miranova.com To: zsh-workers@math.gatech.edu Subject: Re: Buffered stderr on Linux X-Url: http://www.miranova.com/%7Esteve/ Mail-Copies-To: never References: <199603122317.AAA10871@bolyai.cs.elte.hu> From: Steven L Baur Date: 12 Mar 1996 16:16:53 -0800 In-Reply-To: Zoltan Hidvegi's message of 12 Mar 1996 15:17:17 -0800 Message-ID: Organization: Miranova Systems, Inc. X-Mailer: September Gnus v0.52/XEmacs 19.13 Mime-Version: 1.0 (generated by tm-edit 7.46) Content-Type: text/plain; charset=US-ASCII Resent-Message-ID: <"Xt2IF3.0.ns3.nFXHn"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/819 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu >>>>> "Zoltan" == Zoltan Hidvegi writes: Zoltan> Bart Schaefer wrote: >> >> Stdio will call free() on the buffer at fclose(). That means you should >> always pass malloc'd buffers, and never call free() yourself on a buffer >> that's been passed to any of the setbuf() variants! Zoltan> Well I've just checked it on Solaris and Linux and it seems Zoltan> that you are wrong. ... Zoltan> It means that static buffer can be used with setvbuf. I checked the source code to Linux libc 5.2.18 && libc 5.3.5 and Zoltan is correct -- a buffer set by setvbuf is not freed upon fclose(). What does the standard say? My copy of IEEE 1003.1 mentions setvbuf but doesn't assign any specific details to it. -- steve@miranova.com baur Unsolicited commercial e-mail will be proofread for $250/hour. Andrea Seastrand: For your vote on the Telecom bill, I will vote for anyone except you in November.