From owner-freebsd-current@FreeBSD.ORG Thu May 14 15:08:41 2015 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 21974A7B; Thu, 14 May 2015 15:08:41 +0000 (UTC) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) by mx1.freebsd.org (Postfix) with ESMTP id CECC416D2; Thu, 14 May 2015 15:08:40 +0000 (UTC) Received: from critter.freebsd.dk (unknown [192.168.48.2]) by phk.freebsd.dk (Postfix) with ESMTP id 29BFC3BB88; Thu, 14 May 2015 15:08:39 +0000 (UTC) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.14.9/8.14.9) with ESMTP id t4EF8cRO048340; Thu, 14 May 2015 15:08:38 GMT (envelope-from phk@phk.freebsd.dk) To: Ian Lepore cc: John-Mark Gurney , Adrian Chadd , Hans Petter Selasky , David Chisnall , Baptiste Daroussin , "current@freebsd.org" Subject: Re: Increase BUFSIZ to 8192 In-reply-to: <1431615185.1221.57.camel@freebsd.org> From: "Poul-Henning Kamp" References: <20150511230635.GA46991@ivaldir.etoilebsd.net> <20150512032307.GP37063@funkthat.com> <14994.1431412293@critter.freebsd.dk> <20150513080342.GE37063@funkthat.com> <55530CC3.1090204@selasky.org> <1431528249.1221.15.camel@freebsd.org> <20150513181347.GM37063@funkthat.com> <1431542835.1221.30.camel@freebsd.org> <20150514072155.GT37063@funkthat.com> <62511.1431589335@critter.freebsd.dk> <1431615185.1221.57.camel@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <48338.1431616118.1@critter.freebsd.dk> Date: Thu, 14 May 2015 15:08:38 +0000 Message-ID: <48339.1431616118@critter.freebsd.dk> X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 May 2015 15:08:41 -0000 -------- In message <1431615185.1221.57.camel@freebsd.org>, Ian Lepore writes: >I think we've got differing interpretations of what BUFSIZ is for. > >IMO, the one correct use of BUFSIZ outside of libc is "if you are going >to call setbuf() the buffer you pass must be BUFSIZ bytes long." > >Over the years, it seems that many people have somehow gotten the >impression that the intent was "BUFSIZ is the right/ideal/whatever size >to allocate general purpose IO buffers in any program" I don't know when you started, but when I started, on sys-III and v7 in the mid 1980ies, that was exactly what people told you: "Do disk-I/O in BUFSIZ units". I did a quick sampling of src and that seems to be exactly how it is being used in most of the cases I looked at, including libmd where I put it there on exactly that reason back in 1994 (5?) -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence.