http://bugs.winehq.org/show_bug.cgi?id=58745
--- Comment #4 from Robin Haberkorn rhaberkorn@fmsbw.de --- (In reply to Eric Pouech from comment #3)
to do a proper implementation, you'd need to somehow buffer the unix pipe stream (for eg peeknamedpipe to work) and that cannot be done on reader side (as several processes can peek from the same Unix pipe) this cannot be done on writer side as its a Unix process
But couldn't you just return TRUE when peeking 0 elements on the pipe? Even if you do not allow peeking more than 0 elements, this would already improve compatibility.
From your latest post: why would you need temporary files? reading from the wrapped unix pipe with ReadFile would work just fine (I mean reading from temp files or reading from the wrapped unix pipe should behave the same).
Because I have code using glib and as long as we don't have a workaround in glib itself, I cannot read from stdin using glib APIs (GIOChannel). They do a zero-peek on the pipe to determine whether it is readable. [1] As long as this is a given, AFAIK I could only work around the issue on my side - where I have full control - with temporary files.
Let's suppose Wine is not changed and I would like to work around this issue in glib, what would you suppose to do in order to determine whether the pipe is readable? Is using PeekNamedPipe() instead of ReadFile() for FIFOs necessary at all? I suppose they had some reason to write it like this in the first place.
[1] https://gitlab.gnome.org/GNOME/glib/-/blob/main/glib/giowin32.c#L1780