poll(), fifos, and Mac OS X

Just FYI, poll() on a fifo on Mac OS X _does not work_.

The output of the following poll/fifo compatibility test program:

http://uwsg.iu.edu/hypermail/linux/kernel/0003.1/0030.html

On my brand spankin’ new Macbook Air running 10.5.4:

fifotest OS: sysname Darwin
release 9.4.0
version Darwin Kernel Version 9.4.0: Mon Jun 9 19:30:53 PDT 2008; root:xnu-1228.5.20~1/RELEASE_I386
machine i386

supported poll flags:
POLLIN: 1h
POLLRDNORM: 40h
POLLRDBAND: 80h
POLLPRI: 2h
POLLOUT: 4h
POLLWRNORM: 4h
POLLWRBAND: 100h
POLLERR: 8h
POLLHUP: 10h
POLLNVAL: 20h
–> pollflags 1c7h.
fifo, single reader, no writer, fd_r: ret 1, errno 0, flags 20h.
fifo, reader, writer, empty, fd_r: ret 1, errno 0, flags 20h.
fifo, reader, writer, empty, fd_w: ret 1, errno 0, flags 20h.
close(WR)
fifo, reader, writer gone, empty, fd_r: ret 1, errno 0, flags 20h.
open(WR)
fifo, reader, writer reappeared, empty, fd_r: ret 1, errno 0, flags 20h.
fifo, reader, writer reappeared, empty, fd_w: ret 1, errno 0, flags 20h.
write()
fifo, reader, writer, 1 byte, fd_r: ret 1, errno 0, flags 20h.
fifo, reader, writer, 1 byte, fd_w: ret 1, errno 0, flags 20h.
fifo, reader, writer gone, 1 byte, fd_r: ret 1, errno 0, flags 20h.
read()
fifo, reader, writer gone, empty, fd_r: ret 1, errno 0, flags 20h.
open(WR)
fifo, reader, writer reappeared, empty, fd_r: ret 1, errno 0, flags 20h.
close(RD)
fifo, no reader, writer, empty, fd_w: ret 1, errno 0, flags 20h.

That’s right, poll() on a fifo immediately returns POLLNVAL in every case.

This is the sound of my head smashing my keyboard.

3 thoughts on “poll(), fifos, and Mac OS X”

  1. WONTFIX

    Reasons –
    a) Unrelated to iCandy
    b) Fanbois will not reach there
    c) We have crashing iPhone Apps to fix

    Seriously though my experience with Apple is that they are so not serious about Security and stability of the base OS and driver availability – deeply unfunny.

  2. I have been told that Fedora 9 works great :).

    I am not sure about RHEL-5 though… I havent had an Air to test it on.

Comments are closed.