On 6/24/2022 10:34 PM, Eli Zaretskii wrote: >> Cc: larsi@gnus.org, 56025@debbugs.gnu.org >> From: Jim Porter >> Date: Fri, 24 Jun 2022 16:03:13 -0700 >> >> POSIX standard says[1] (thanks to Eliot Moss on the Cygwin mailing list >> for citing this passage): >> >> When [EOF is] received, all the bytes waiting to be read are >> immediately passed to the process without waiting for a , and >> the EOF is discarded. Thus, if there are no bytes waiting (that is, >> the EOF occurred at the beginning of a line), a byte count of zero >> shall be returned from the read(), representing an end-of-file >> indication. > > Perhaps some reference to this should also be in the comments. How about this patch? I added a reference to the specific section of the POSIX specification so that it's (hopefully) easy for people to look up if they need further details.