Get number of bytes available in PeekNamedPipe (take 2)

Alexandre Julliard julliard at winehq.com
Thu Jul 25 12:42:54 CDT 2002


Uwe Bonnes <bon at elektron.ikp.physik.tu-darmstadt.de> writes:

> PeekNamedPipe must report when the pipe is broken, otherwise some programs
> wait forever for a message from the already disappeared program. Without
> checking for a broken other end, FIONREAD always reports "0 bytes". I don't
> see how I can doi that on the client side, beside exporting the
> pipe(_user)_get_fd functions directly. Programming hints are welcome.

OK, I was thinking this would be checked in read(), but I guess the
app may never call read() if PeekNamedPipe returns 0 available
bytes. You should be able to check for a closed pipe using poll() and
testing for POLLHUP.

-- 
Alexandre Julliard
julliard at winehq.com



More information about the wine-devel mailing list