From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/428 Path: news.gmane.org!not-for-mail From: Moritz Wilhelmy Newsgroups: gmane.linux.lib.musl.general Subject: Re: Anti-bloat side project Date: Tue, 16 Aug 2011 15:16:10 +0200 Message-ID: <20110816131610.GG26140@barfooze.de> References: <20110627211625.GC5036@port70.net> <20110627211909.GZ12592@brightrain.aerifal.cx> <20110627213805.GD5036@port70.net> <20110627213739.GA12592@brightrain.aerifal.cx> <20110627214300.GB12592@brightrain.aerifal.cx> <20110629141945.GL5036@port70.net> <20110629192736.GG12592@brightrain.aerifal.cx> <20110629200358.GN5036@port70.net> <20110816130350.GF26140@barfooze.de> <20110816130643.GQ132@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1313500593 25907 80.91.229.12 (16 Aug 2011 13:16:33 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 16 Aug 2011 13:16:33 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-429-gllmg-musl=m.gmane.org@lists.openwall.com Tue Aug 16 15:16:26 2011 Return-path: Envelope-to: gllmg-musl@lo.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by lo.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1QtJVK-0008R6-Bp for gllmg-musl@lo.gmane.org; Tue, 16 Aug 2011 15:16:26 +0200 Original-Received: (qmail 15362 invoked by uid 550); 16 Aug 2011 13:16:25 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 14330 invoked from network); 16 Aug 2011 13:16:25 -0000 Content-Disposition: inline In-Reply-To: <20110816130643.GQ132@brightrain.aerifal.cx> User-Agent: Mutt/1.5.21 (2010-09-15) Xref: news.gmane.org gmane.linux.lib.musl.general:428 Archived-At: On Tue, Aug 16, 2011 at 09:06:43 -0400, Rich Felker wrote: > Is it possibly implemented as a shell script? The way the shell "read" > command works, it's required to perform byte-at-a-time reads like > this. Otherwise, I'm guessing someone just foolishly turned off > buffering on the FILE... In fact, it really is a C program, and sadly, it seems they really implement it that way (by greping over the code for about 30 seconds); See src/mygetline.c on hg tip[1]: 41 while(1) { 42 res = read(fd, &ch, 1); Maybe coders need to be educated about how not to write code in order to avoid (syscall-)bloat? [1]: http://mlmmj.org/hg/mlmmj/file/tip/src/mygetline.c Moritz