Richard Meng wrote, quoting Brian Dessent:
>> Mingw uses the Microsoft C library (MSVCRT). glibc is designed for
>> linux and has not (and probably never will be) ported to win32. If
>> you want posix emulation, you want Cygwin not Mingw, which does
>> include (some) support for mkfifo().
> did you ever try the Cygwin's fifo, ...
No, but ...
> ... it seems that, if you do not read
> from the fifo, you can only write only one byte to it. but it's not
> the same on linux.
On any *nix system, it is an error to write to a pipe, either named or
unnamed, for which there is no reader; the writing application will
receive a SIGPIPE, which, if unhandled, will induce termination.
OTOH, if the pipe does have a reader, the number of bytes that may be
written, before the reader actually removes them is implementation
dependent. Just because Linux allows you to write multiple bytes is no
reason to expect similar behaviour elsewhere -- the bufferring mechanism
employed for the pipe may differ. Blocking of the write, as you are
seeing, is perfectly correct behaviour, when the pipe's buffer can
accept no further data. Admittedly, one byte does seem to be an
unnecessarily extreme restriction, but could be expected if, for
example, the write stream to the pipe were unbufferred.