[EXTERNAL] Re: FIFO issues

Lavrentiev, Anton (NIH/NLM/NCBI) [C] lavr@ncbi.nlm.nih.gov
Tue Sep 20 03:51:29 GMT 2022


> It seems that there's an exception: If no process has ever had the FIFO open for
> writing since it was opened for reading, then the FIFO is not considered to be
> at end-of-file.

IMO, when a virgin FIFO is read with a blocking read (of just one byte), it will block -- it will not return 0.
Meaning that such a FIFO was not ready for read (when the other end was not (yet) attached / written), and
also meaning that there was no EOF (which is obvious because a transaction has not even started).
select() should indicate just the same (and it does so on the discussed platforms) regardless of O_NONBLOCK.

Anton Lavrentiev
Contractor NIH/NLM/NCBI



More information about the Cygwin mailing list