On 03/29/2011 06:08 AM, Bruno Haible wrote: > 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
Thanks for the research. It looks like everyone except mingw supports the standardized O_NONBLOCK, so I see no reason to implement O_NDELAY (modern code shouldn't be using it) or ioctl FIONBIO. > > 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). Mingw supports named pipes (witness the mkfifo gnulib function), and you can open named pipes with O_NONBLOCK; so supporting O_NONBLOCK would be a useful addition for those. For all other file types, POSIX recommends that O_NONBLOCK is silently ignored rather than making open() fail (http://austingroupbugs.net/view.php?id=141); likewise, using fcntl F_SETFL with O_NONBLOCK on regular files and directories is recommended to silently ignore the bit (either mask it out on set, or the bit is set on F_GETFL but has no effect) rather than failing. -- Eric Blake [email protected] +1-801-349-2682 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
