| Summary: | ioctl(fd, FIONREAD, &c) on a FIFO (not PIPE) does not work | ||
|---|---|---|---|
| Product: | Base System | Reporter: | steve <steve> |
| Component: | kern | Assignee: | Robert Watson <rwatson> |
| Status: | Closed FIXED | ||
| Severity: | Affects Only Me | ||
| Priority: | Normal | ||
| Version: | Unspecified | ||
| Hardware: | Any | ||
| OS: | Any | ||
|
Description
steve
2001-03-03 18:40:01 UTC
To clarify: ioctl(fd, FIONREAD, &c) on a fifo file (created with mkfifo(2)) always sets c=0, that is the available data size is not correctly reported Steve Responsible Changed From-To: freebsd-bugs->rwatson 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). State Changed From-To: open->patched Change state to 'patched' as a fix was merged to HEAD as fifo_vnops.c:1.123. Leave the PR open for testing and merge purposes. The fifo_io and fifo_misc regression tests have been updated to detect this bug. State Changed From-To: patched->closed This fix (actually 1.124) was merged from HEAD to RELENG_6 as fifo_vnops.c:1.113.2.11, and appeared in 6.0-RELEASE. |