Nonblocking I/O and POLL_BUG

Per Hedeland per at
Mon Oct 25 21:53:45 UTC 1999

sthaug at wrote:
>Using O_NONBLOCK is safe for almost all platforms. The only one I know
>of which needs something different is (old) SunOS 4.1.x, which needs
>O_NDELAY. See for instance src/port/*/include/port_after.h in the BIND
>8.2.2 distribution.
>Steinar Haug, Nethelp consulting, sthaug at
>% grep PORT_NONBLOCK */include/port_after.h
>aix32/include/port_after.h:#define PORT_NONBLOCK	O_NONBLOCK
>ultrix/include/port_after.h:#define PORT_NONBLOCK	O_NONBLOCK

Well, given that I know from personal experience that O_NONBLOCK doesn't
work [1] for sockets on AIX 3.2 and Ultrix 4.3 - as my summary showed,
the #define is there, the fcntl() returns 0, but the socket remains in
blocking mode - you'll forgive me if I have less than absolute
confidence in that list. Of course it may have been fixed by later
patches, and anyway hopefully no-one uses those cranky old OSes for a
news server, so those particular examples are hardly cause for major

--Per Hedeland
per at

[1] With standard compilation options, at least - -YPOSIX made read, but
not write, work on Ultrix; using some BSD-compatibility mode made both
work on AIX - but that's typically fraught with other problems on
SysVish systems. (Of course AIX was true to form by having the old
BSD-only FIONBIO work always (for sockets), but the POSIX O_NONBLOCK
work only in BSD mode...:-)

More information about the inn-workers mailing list