Subject: bug#44320: [PATH] [27.1] Make sure send-string-to-terminal send all contents

From: Lars Ingebrigtsen <[email-masked]>
Date: Mon, 02 Nov 2020 17:30:44 +0100

Eli Zaretskii <[email-masked]> writes:

> What is the significance of 4K bytes in this case?  Is 'fwrite'
> documented not to write more than that?  I couldn't find such
> documentation.

writes that are less than a system block size are unlikely to be chopped
into parts.

> Anyway, if we need to fix calls to 'fwrite', we should provide
> something similar to emacs_write, and use it everywhere we use
> 'fwrite' now.

I can't see anything in the fwrite man page that guarantees that it'll
write all that we tell it to write:

RETURN VALUE
       On success, fread() and fwrite() return the number of items read or writ‐
       ten.  This number equals the number of bytes transferred only  when  size
       is  1.  If an error occurs, or the end of the file is reached, the return
       value is a short item count (or zero).

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no