From: Eli Zaretskii <eliz@gnu.org>
To: Andreas Schwab <schwab@linux-m68k.org>
Cc: larsi@gnus.org, sunlin7@yahoo.com, 44320@debbugs.gnu.org,
lin.sun@zoom.us
Subject: bug#44320: [PATH] [27.1] Make sure send-string-to-terminal send all contents
Date: Mon, 02 Nov 2020 21:31:14 +0200 [thread overview]
Message-ID: <83lffjd08t.fsf@gnu.org> (raw)
In-Reply-To: <87d00vziuu.fsf@igel.home> (message from Andreas Schwab on Mon, 02 Nov 2020 19:58:17 +0100)
> From: Andreas Schwab <schwab@linux-m68k.org>
> 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)?
next prev parent reply other threads:[~2020-11-02 19:31 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-29 23:01 bug#44320: [PATH] [27.1] Make sure send-string-to-terminal send all contents Lin Sun via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-10-30 0:36 ` Lin Sun via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-10-30 8:06 ` Eli Zaretskii
2020-10-30 12:38 ` Lars Ingebrigtsen
2020-10-30 13:25 ` Eli Zaretskii
2020-11-02 2:58 ` LinSun via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-11-02 3:11 ` LinSun via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-11-02 15:31 ` Eli Zaretskii
2020-11-02 15:49 ` Andreas Schwab
2020-11-02 16:14 ` Eli Zaretskii
2020-11-02 16:41 ` Andreas Schwab
2020-11-02 17:10 ` Eli Zaretskii
2020-11-02 17:36 ` Andreas Schwab
2020-11-02 17:59 ` Eli Zaretskii
2020-11-02 18:02 ` Andreas Schwab
2020-11-02 18:12 ` Eli Zaretskii
2020-11-02 18:22 ` Andreas Schwab
2020-11-02 18:35 ` Eli Zaretskii
2020-11-02 18:58 ` Andreas Schwab
2020-11-02 19:31 ` Eli Zaretskii [this message]
2020-11-02 20:26 ` Andreas Schwab
[not found] ` <4BD75783-F561-4DB8-A733-13A3D924C8C1@hxcore.ol>
2020-11-03 15:29 ` Eli Zaretskii
2020-11-05 0:14 ` LinSun via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-11-07 9:28 ` Eli Zaretskii
2020-11-09 2:27 ` LinSun via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-11-05 15:59 ` Eli Zaretskii
2020-11-05 16:07 ` Andreas Schwab
2020-11-02 15:22 ` Lars Ingebrigtsen
2020-11-02 16:07 ` Eli Zaretskii
2020-11-02 16:30 ` Lars Ingebrigtsen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=83lffjd08t.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=44320@debbugs.gnu.org \
--cc=larsi@gnus.org \
--cc=lin.sun@zoom.us \
--cc=schwab@linux-m68k.org \
--cc=sunlin7@yahoo.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.