[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: non-blocking I/O
From: |
Bastien ROUCARIES |
Subject: |
Re: non-blocking I/O |
Date: |
Tue, 29 Mar 2011 14:38:16 +0200 |
On Tue, Mar 29, 2011 at 2:08 PM, Bruno Haible <address@hidden> 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>
>
>
- Re: [libvirt] mingw: virsh event loop failure in current git, Eric Blake, 2011/03/28
- Re: non-blocking I/O, Bruno Haible, 2011/03/29
- Re: non-blocking I/O, Eric Blake, 2011/03/30
- Re: non-blocking I/O, Eric Blake, 2011/03/30
- Re: non-blocking I/O, Paolo Bonzini, 2011/03/31
- Re: non-blocking I/O, Bruno Haible, 2011/03/31
- [PATCH] nonblocking: new module, Eric Blake, 2011/03/31
- Re: [PATCH] nonblocking: new module, Bruno Haible, 2011/03/31