On Tue, Mar 29, 2011 at 2:08 PM, Bruno Haible <[email protected]> wrote: > Hi Paolo, Eric, > >> prefer to implement {g,s}et_nonblock_flag functions. ... >> This module can then be used to build a fcntl F_GETFL/F_SETFL >> implementation, but it is not very important to do so. > > Nevertheless in gnulib we try to offer the POSIX APIs, if possible. > > There are three APIs for non-blocking I/O on Unix: > 1) fcntl F_SETFL O_NONBLOCK (POSIX, SysV) > 2) fcntl F_SETFL O_NDELAY (older SysV) > 3) ioctl FIONBIO (BSD 4.2) 4) SOCK_NONBLOCKL
Bastien > According to the include files the support is the following: > > - glibc, MacOS X, FreeBSD, NetBSD, OpenBSD, AIX, HP-UX, IRIX, OSF/1, Solaris, > Cygwin, Interix have all three APIs, > - mingw lacks F_GETFL, O_NONBLOCK, O_NDELAY > - BeOS lacks O_NDELAY, FIONBIO > - Haiku lacks O_NDELAY > > So, barring bugs that we find during unit testing, we need > - a replacement for fcntl F_SETFL O_NONBLOCK that supports mingw, > - extend lib/open.c so that it handles O_NONBLOCK on mingw (presumably > by failing, because Win32 does not support non-blocking I/O on > regular files). Or fail silently ? Bastien > > I agree that get/set_nonblocking functions are a good step towards this. > > Bruno > -- > In memoriam Rachel Levy <http://en.wikipedia.org/wiki/Rachel_Levy> > >
