From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: `message' not outputting the newline "atomically" Date: Sun, 23 Jun 2019 05:25:48 +0300 Message-ID: <83y31tm40j.fsf@gnu.org> References: <83y31xr3aa.fsf@gnu.org> <26154872-1a5c-7302-0f32-b16aff8e0ae7@cs.ucla.edu> <83blytq90m.fsf@gnu.org> <95de57fb-ef8c-a65f-d3ca-4a9e7f0f38bc@cs.ucla.edu> <83a7ecquzb.fsf@gnu.org> <83tvckp5ni.fsf@gnu.org> <83r27op1wb.fsf@gnu.org> <60d1b05d-ef4c-252a-0626-8c69c103fdf0@cs.ucla.edu> <83o92rpk1g.fsf@gnu.org> <9d07a8e2-7f9b-bbfa-b73e-0d7aee09b099@cs.ucla.edu> <83zhmankgu.fsf@gnu.org> <31b12a41-18f2-d20c-55dc-28f7adb8606c@cs.ucla.edu> Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="76194"; mail-complaints-to="usenet@blaine.gmane.org" Cc: schwab@suse.de, larsi@gnus.org, emacs-devel@gnu.org To: Paul Eggert Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jun 23 04:26:20 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hesCy-000Jgt-8P for ged-emacs-devel@m.gmane.org; Sun, 23 Jun 2019 04:26:20 +0200 Original-Received: from localhost ([::1]:42994 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hesCw-0005DS-K5 for ged-emacs-devel@m.gmane.org; Sat, 22 Jun 2019 22:26:18 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39875) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hesCa-0005DA-0r for emacs-devel@gnu.org; Sat, 22 Jun 2019 22:25:57 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:41752) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hesCZ-0000eO-4t; Sat, 22 Jun 2019 22:25:55 -0400 Original-Received: from [176.228.60.248] (port=2578 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hesCY-0003e6-BY; Sat, 22 Jun 2019 22:25:54 -0400 In-reply-to: <31b12a41-18f2-d20c-55dc-28f7adb8606c@cs.ucla.edu> (message from Paul Eggert on Sat, 22 Jun 2019 12:14:55 -0700) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:238050 Archived-At: > Cc: schwab@suse.de, larsi@gnus.org, emacs-devel@gnu.org > From: Paul Eggert > Date: Sat, 22 Jun 2019 12:14:55 -0700 > > static void > dump_fingerprint (const char *label, unsigned char const *xfingerprint) > { > fprintf (stderr, "%s: ", label); > for (int i = 0; i < 32; ++i) > fprintf (stderr, "%02x", (unsigned) xfingerprint[i]); > fprintf (stderr, "\n"); > } > > Here, GNU/Linux Emacs would issue 34 'write' system calls if stderr were using > _IONBF (and the output line could be interleaved with other output lines, > possibly causing confusion), whereas GNU/Linux Emacs issues just one 'write' > system call now that stderr uses _IOLBF (thus avoiding the confusion). > > I don't see any significant problem with line-buffering here, or anywhere else > that Emacs outputs to stderr. And I've looked at quite a few uses. What if Emacs crashes half way through that loop, because 'i' is computed incorrectly? With line buffering, we risk not seeing anything. OTOH, the number of system calls is not something we should be bothered with. So this looks like a net loss to me.