From owner-freebsd-current@FreeBSD.ORG Thu May 14 07:53:18 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 A8D4955F; Thu, 14 May 2015 07:53:18 +0000 (UTC) Received: from gold.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "gold.funkthat.com", Issuer "gold.funkthat.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 679981BC5; Thu, 14 May 2015 07:53:17 +0000 (UTC) Received: from gold.funkthat.com (localhost [127.0.0.1]) by gold.funkthat.com (8.14.5/8.14.5) with ESMTP id t4E7rGAc062344 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 14 May 2015 00:53:16 -0700 (PDT) (envelope-from jmg@gold.funkthat.com) Received: (from jmg@localhost) by gold.funkthat.com (8.14.5/8.14.5/Submit) id t4E7rGEA062343; Thu, 14 May 2015 00:53:16 -0700 (PDT) (envelope-from jmg) Date: Thu, 14 May 2015 00:53:16 -0700 From: John-Mark Gurney To: Poul-Henning Kamp Cc: Ian Lepore , Adrian Chadd , Hans Petter Selasky , David Chisnall , Baptiste Daroussin , "current@freebsd.org" Subject: Re: Increase BUFSIZ to 8192 Message-ID: <20150514075316.GY37063@funkthat.com> References: <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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <62511.1431589335@critter.freebsd.dk> X-Operating-System: FreeBSD 9.1-PRERELEASE amd64 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? User-Agent: Mutt/1.5.21 (2010-09-15) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7 (gold.funkthat.com [127.0.0.1]); Thu, 14 May 2015 00:53:17 -0700 (PDT) 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 07:53:18 -0000 Poul-Henning Kamp wrote this message on Thu, May 14, 2015 at 07:42 +0000: > -------- > In message <20150514072155.GT37063@funkthat.com>, John-Mark Gurney writes: > > >Since you apprently missed my original reply, I said that we shouldn't > >abuse BUFSIZ for this work, and that it should be changed in mdXhl.c... > > Say what ? > > BUFSIZ is used entirely appropriately in MDXFileChunk(): For reading > a file into an algorithm. Posix-2008: BUFSIZ: Size of buffers. This shall expand to a positive value. C99: BUFSIZ which expands to an integer constant expression that is the size of the buffer used by the setbuf function; In fact, posix-2008 references LINE_MAX because: Frequently, utility writers selected the UNIX system constant BUFSIZ to allocate these buffers; therefore, some utilities were limited to 512 bytes for I/O lines, while others achieved 4 096 bytes or greater. BUFSIZ was already recognized as to small to hold a single line, yet you're saying it's perfectly fine to use as a buffer for binary data? > If in stead of open(2), fopen(3) had been used, the exact same thing > would happen, but using malloc space rather than stack space. Plus extra overhead.. :) -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not."