From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#44320: [PATH] [27.1] Make sure send-string-to-terminal send all contents Date: Mon, 02 Nov 2020 21:31:14 +0200 Message-ID: <83lffjd08t.fsf@gnu.org> References: <5f9b49e9.1c69fb81.72b0f.80d6@mx.google.com> <83ft5wb0jz.fsf@gnu.org> <87mu03j3cv.fsf@gnus.org> <83v9eralri.fsf@gnu.org> <0EA6FC59-A66D-45B8-8B09-62D6A9032FBC@hxcore.ol> <83eelbepw3.fsf@gnu.org> <877dr321ya.fsf@igel.home> <83wnz3d9bz.fsf@gnu.org> <87361r1zjf.fsf@igel.home> <83v9end6s1.fsf@gnu.org> <87y2jjzmnq.fsf@igel.home> <83r1pbd4ia.fsf@gnu.org> <87lffjzlfr.fsf@igel.home> <83pn4vd3vf.fsf@gnu.org> <87h7q7zkiq.fsf@igel.home> <83o8kfd2sy.fsf@gnu.org> <87d00vziuu.fsf@igel.home> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30657"; mail-complaints-to="usenet@ciao.gmane.io" Cc: larsi@gnus.org, sunlin7@yahoo.com, 44320@debbugs.gnu.org, lin.sun@zoom.us To: Andreas Schwab Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Nov 02 20:32:38 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kZfZF-0007rG-Rh for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 02 Nov 2020 20:32:37 +0100 Original-Received: from localhost ([::1]:60876 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kZfZE-0003A0-TD for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 02 Nov 2020 14:32:36 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56616) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kZfYg-00039m-0C for bug-gnu-emacs@gnu.org; Mon, 02 Nov 2020 14:32:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:59393) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kZfYf-0007bN-NT for bug-gnu-emacs@gnu.org; Mon, 02 Nov 2020 14:32:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kZfYf-0007HF-Kc for bug-gnu-emacs@gnu.org; Mon, 02 Nov 2020 14:32:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 02 Nov 2020 19:32:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 44320 X-GNU-PR-Package: emacs Original-Received: via spool by 44320-submit@debbugs.gnu.org id=B44320.160434550227941 (code B ref 44320); Mon, 02 Nov 2020 19:32:01 +0000 Original-Received: (at 44320) by debbugs.gnu.org; 2 Nov 2020 19:31:42 +0000 Original-Received: from localhost ([127.0.0.1]:42704 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kZfYI-0007GW-GA for submit@debbugs.gnu.org; Mon, 02 Nov 2020 14:31:42 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:56440) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kZfYG-0007GJ-CG for 44320@debbugs.gnu.org; Mon, 02 Nov 2020 14:31:36 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:53577) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kZfY9-0007Yc-7S; Mon, 02 Nov 2020 14:31:29 -0500 Original-Received: from [176.228.60.248] (port=3959 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kZfY4-0004hc-D3; Mon, 02 Nov 2020 14:31:25 -0500 In-Reply-To: <87d00vziuu.fsf@igel.home> (message from Andreas Schwab on Mon, 02 Nov 2020 19:58:17 +0100) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:192568 Archived-At: > From: Andreas Schwab > Cc: lin.sun@zoom.us, larsi@gnus.org, sunlin7@yahoo.com, > 44320@debbugs.gnu.org > Date: Mon, 02 Nov 2020 19:58:17 +0100 > > On Nov 02 2020, Eli Zaretskii wrote: > > > Is EINTR considered an error for this purpose? > > Sure. So if the call to 'write' made by 'fwrite' is interrupted by a signal, and 'fwrite' didn't succeed to write anything, 'fwrite' will return EOF and errno will be set to EINTR? The proposed patch didn't handle that case. And if 'fwrite' was interrupted by a signal, but it succeeded to write something, it will return a smaller count without setting errno? Then how to distinguish between a partial write due to a signal and a partial write due to, say, disk full? > > If not, what exactly is considered an error? I don't see this clearly > > documented, so it could be something we cannot rely on. > > https://pubs.opengroup.org/onlinepubs/9699919799/functions/fputc.html Thanks. > > In short, it sounds like calling fwrite in a loop will only work by > > sheer luck. > > I don't see why. Too many subtle assumptions for my palate. In general, stdio is not safe in the presence of signals. Would it be better to suspend SIGIO by calling unrequest_sigio instead (and resume it once 'fwrite' returns)?