From owner-freebsd-arch@FreeBSD.ORG Tue Jan 6 20:03:40 2015 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EF89B9ED; Tue, 6 Jan 2015 20:03:40 +0000 (UTC) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id F3FFC2CEA; Tue, 6 Jan 2015 18:30:47 +0000 (UTC) Received: from [10.0.1.110] (c-76-21-10-192.hsd1.ca.comcast.net [76.21.10.192]) by elvis.mu.org (Postfix) with ESMTPSA id DBDFD341F894; Tue, 6 Jan 2015 10:30:46 -0800 (PST) Subject: Re: Libxo bugs and fixes. Mime-Version: 1.0 (Apple Message framework v1283) From: Alfred Perlstein In-Reply-To: <7F04AD6C-6D07-40C1-9753-D37A82B1CC85@xcllnt.net> Date: Tue, 6 Jan 2015 10:34:33 -0800 Message-Id: References: <201408141640.s7EGe422096656@idle.juniper.net> <53ED57F2.5020808@mu.org> <20140815053604.9E40B580A2@chaos.jnpr.net> <53EDB0EF.6090902@mu.org> <20140815173830.93832580A2@chaos.jnpr.net> <53EEA74B.9070107@mu.org> <20140816045254.5F47E580A2@chaos.jnpr.net> <549BA675.9070107@freebsd.org> <29784.1419492726@chaos> <26E73A9E-6EA4-4698-885D-BD91906D32D2@mu.org> <18276.1419528679@chaos> <549C50FB.6050908@mu.org> <23687.1419546234@chaos> <549F742D.3000802@mu.org> <7F04AD6C-6D07-40C1-9753-D37A82B1CC85@xcllnt.net> To: Marcel Moolenaar X-Mailer: Apple Mail (2.1283) Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: Marcel Moolenaar , Phil Shafer , John-Mark Gurney , "Simon J. Gerraty" , "arch@freebsd.org" , Poul-Henning Kamp , freebsd-arch , Konstantin Belousov X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Jan 2015 20:03:41 -0000 On Jan 6, 2015, at 9:27 AM, Marcel Moolenaar wrote: >=20 >> On Dec 27, 2014, at 7:08 PM, Alfred Perlstein wrote: >>=20 >>>=20 >> OK, so I've updated https://reviews.freebsd.org/D1379 to include code = to handle this. >>=20 >> Solaris and glibc have a private libc function to check if a stream = is line buffered called int __flbf (FILE *stream) which returns = true/false if the stream if line buffered or not. >=20 > I'm still unclear on the need or importance of adding __flbf(). > What's wrong with just calling fflush()? > What is to be gained by only calling fflush() when the stream is > line-buffered? Why not call fflush() when the stream is not line > buffered? >=20 > Put differently: we have 618 instance of fflush() in the source > tree and there has been no demand for something like __flbf() > before that I know of. Why now? And why specifically for libxo? >=20 > If __flbf() is really important, then I'd rather see someone go > over the source tree to add calls to it for most of those 618 > instances of fflush() at the time of its introduction. Not have > it introduced as a side-effect of something else when it's not > at all obvious that the side-effect was warranted. >=20 > Can you elaborate? Nope. the code is up, figure it out yourself. https://github.com/splbio/freebsd/tree/ap_libxo_master/contrib/libxo -Alfred