Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 13 Feb 1996 20:09:43 +1100
From:      Bruce Evans <bde@zeta.org.au>
To:        msmith@atrad.adelaide.edu.au
Cc:        hackers@FreeBSD.org
Subject:   Re: device driver ioctl for nonblocking IO?
Message-ID:  <199602130909.UAA19799@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>> I've got a really stupid one here...
>...
>> If I open an fd on the device and fcntl(fd, F_SETFL, O_NONBLOCK), I get
>> a mystery ioctl sent to my device.

>Argh.  FIONBIO.  Not enough coffee.  Sorry.

FIONBIO should be ignored unless you want to handle the races that can
result when a process changes the flag while another process is blocked
in an i/o.  The O_NONBLOCK flag (aka the O_NDELAY flag) (aka the FNDELAY
flag) is better aka the FNONBLOCK flag in the kernel.  It is stored in
the file descriptor flags and passed to all read and write functions
after converting it to the IO_NDELAY.  It is also passed to the open,
ioctl and close functions without conversion.

Bruce



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199602130909.UAA19799>