From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/6380 Path: news.gmane.org!not-for-mail From: Sergey Dmitrouk Newsgroups: gmane.linux.lib.musl.general Subject: Re: Why stdout_write checks for terminal? Date: Tue, 21 Oct 2014 18:40:35 +0300 Message-ID: <20141021154035.GA5902@zx-spectrum.accesssoftek.com> References: <20141021145640.GA5781@zx-spectrum.accesssoftek.com> <20141021151727.GD22465@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Trace: ger.gmane.org 1413906058 24057 80.91.229.3 (21 Oct 2014 15:40:58 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 21 Oct 2014 15:40:58 +0000 (UTC) To: "musl@lists.openwall.com" Original-X-From: musl-return-6393-gllmg-musl=m.gmane.org@lists.openwall.com Tue Oct 21 17:40:51 2014 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1XgbYJ-0000kJ-Je for gllmg-musl@plane.gmane.org; Tue, 21 Oct 2014 17:40:51 +0200 Original-Received: (qmail 3639 invoked by uid 550); 21 Oct 2014 15:40:50 -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 3629 invoked from network); 21 Oct 2014 15:40:49 -0000 Content-Disposition: inline In-Reply-To: <20141021151727.GD22465@brightrain.aerifal.cx> Xref: news.gmane.org gmane.linux.lib.musl.general:6380 Archived-At: On Tue, Oct 21, 2014 at 08:17:27AM -0700, Rich Felker wrote: > Full buffering _must_ be disabled if the underlying file is an > "interactive device" (terminal); this is a requirement of the > standards. Somewhere in the distant past musl always put stdout in > line-buffered mode, but users complained (rightfully) because programs > writing binary data to stdout (e.g. things like djpeg) were 10-100x > slower than with other libcs, so now whether it's line or full > buffered depends on whether it's a terminal. Thanks for the explanation (and to Josiah as well), that makes sense. Related commit message is missing details and it wasn't really clear why this change is needed. Regards, Sergey