The functionality tests of my FIFO code is coming to an end. You can found these testing programs in my perforce branch. Here is the testing results.
Each of the fifo core functions is tested separately, including read/write/select/poll/kqueue/sigio. All works well except the one testing fifo status change.(See //depot/projects/soc2009/fifo/fifo_tests/functionality/hangup.c). I haven’t fixed this problem yet.
Special attention is put to the previously reported FIFO bugs. They are PR 74242, 76525, 94772, 76144, 116770.
- kern/74242: it’s an issue of mknod. There is some disagreement about whether mknod(S_FIFO) should work for unprivileged users. According to the bug tracker, our developers has come to an agreement and now we allow unpriviledged users creating fifo using mknod.
- kern/76525, kern/94772, kern/76144: they are of the same problem. If you close one endpoint of fifo, select/poll on the other endpoint does not return. The problem is caused by the socket code, which does not handle POLLHUP. FIFO suffers from this because it uses socket code. But pipe actually implements POLLHUP. When we switch FIFO to use pipe code, those bugs disappear.
- kern/116770: fifo with no writers is opened nonblockingly for reading and the resulting file descriptor is added to a kqueue, kevent will immediately report an EOF condition. There are some arguments about whether it’s really a bug. Under my FIFO implementation, we do not suffer from this problem.
Thanks John for pointing out that there are official regression test for FIFO. The regression tests covers more fields and are very easy to use. All the tests are passed under my FIFO implementation.