From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/6378 Path: news.gmane.org!not-for-mail From: Josiah Worcester Newsgroups: gmane.linux.lib.musl.general Subject: Re: Why stdout_write checks for terminal? Date: Tue, 21 Oct 2014 09:59:58 -0500 Message-ID: References: <20141021145640.GA5781@zx-spectrum.accesssoftek.com> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=f46d0438907dbc73ff0505f01596 X-Trace: ger.gmane.org 1413903619 13122 80.91.229.3 (21 Oct 2014 15:00:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 21 Oct 2014 15:00:19 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-6391-gllmg-musl=m.gmane.org@lists.openwall.com Tue Oct 21 17:00:15 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 1Xgav0-0003qj-1e for gllmg-musl@plane.gmane.org; Tue, 21 Oct 2014 17:00:14 +0200 Original-Received: (qmail 24018 invoked by uid 550); 21 Oct 2014 15:00:12 -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 23997 invoked from network); 21 Oct 2014 15:00:12 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=pTCjRXIKv2AQD41LPTfofZaVxOI1naovRF7+9h3YCts=; b=b2r3WODS1RbbCQ2iLg2MiVqHVSgnsU3L3rb4k5ZCtcHBqJkdQfkopVvckvsAevlJUG t04k25iAIu59J7cFFhAl1AhCLHBqDlUWZwYif2c6oxl+mPev9Wh+8s2jsK2wyvoylAP9 VbZESecP2EhwYTXqmDYpX7F1vf/QY/wgdhTv5AYlw7oMqD/XbfQUl9N4OtmKjm11LCeu 5SmPz6Yb1+Av+IsehgbnzLr1PDDn6GaWSNkvsmLrs1uR16dWleoW86PKfKQwV73UZvx7 7wE2zzJSm9lVRP/7z0FO9k9QfwuT/ei6WTpfnlMbnSTcksSwGputv3cEyDO3gpfvqxp5 BNZQ== X-Received: by 10.180.73.40 with SMTP id i8mr29327110wiv.30.1413903598513; Tue, 21 Oct 2014 07:59:58 -0700 (PDT) In-Reply-To: <20141021145640.GA5781@zx-spectrum.accesssoftek.com> Xref: news.gmane.org gmane.linux.lib.musl.general:6378 Archived-At: --f46d0438907dbc73ff0505f01596 Content-Type: text/plain; charset=UTF-8 On Tue, Oct 21, 2014 at 9:56 AM, Sergey Dmitrouk wrote: > Hi, > > the code in src/stdio/__stdout_write.c checks whether output is going to > a terminal and if it's not the case disables line buffering. I'm > wondering what's the reason behind this? This causes some programs to > produce different output depending whether stdout is terminal or not, > not a bit deal, but I don't see much profit in disabling buffering > either. > > Regards, > Sergey > >From the spec < http://pubs.opengroup.org/onlinepubs/009695399/functions/stdin.html>: "the standard input and standard output streams are fully buffered if and only if the stream can be determined not to refer to an interactive device." --f46d0438907dbc73ff0505f01596 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On T= ue, Oct 21, 2014 at 9:56 AM, Sergey Dmitrouk <sdmitrouk@accessso= ftek.com> wrote:
Hi,

the code in src/stdio/__stdout_write.c checks whether output is going to a terminal and if it's not the case disables line buffering.=C2=A0 I= 9;m
wondering what's the reason behind this?=C2=A0 This causes some program= s to
produce different output depending whether stdout is terminal or not,
not a bit deal, but I don't see much profit in disabling buffering
either.

Regards,
Sergey

From the spec <http://pu= bs.opengroup.org/onlinepubs/009695399/functions/stdin.html>:=C2=A0 &= quot;the standard input and standard output streams are fully buffered if and only if the stream can be determined not to refer to an int= eractive device."
--f46d0438907dbc73ff0505f01596--