kern/25511: ioctl(fd, FIONREAD, &c) on a FIFO (not PIPE) does not work

Robert Watson rwatson at FreeBSD.org
Tue Sep 13 05:31:07 PDT 2005


Synopsis: ioctl(fd, FIONREAD, &c) on a FIFO (not PIPE) does not work

Responsible-Changed-From-To: freebsd-bugs->rwatson
Responsible-Changed-By: rwatson
Responsible-Changed-When: Tue Sep 13 11:50:11 GMT 2005
Responsible-Changed-Why: 
Take ownership of this bug, as I have recently been writing regression tests
and fixing fifofs bugs.  I have reproduced this bug with a local test
program, and believe the description is correct (that the useful result of
FIONREAD from the read socket is overwritten with the less useful result of
FIONWRITE on the write socket for O_RDWR fifo descriptors).  According to
POSIX, all this is undefined, but useful behavior would be useful.  We may
want to handle each ioctl specifically before passing to the socket layer
rather than relying on fall-through for precisely this reason (that other
ioctls may also be failing oddly).


http://www.freebsd.org/cgi/query-pr.cgi?pr=25511


More information about the freebsd-bugs mailing list