Subject: Re: O_NONBLOCK in a character device driver
To: None <>
From: Andreas Gustafsson <>
List: tech-kern
Date: 08/17/1997 14:19:00
In <> said:
> I'm having some problems using O_NONBLOCK in a character device
> driver.  It seems that the fcntl(fd, F_SETFL, O_NONBLOCK) call
> returns 0 for no error, but the flags are not being passed to
> the read routine correctly.
> ...
> The problem is, O_NONBLOCK is defined to be 0x00000004, which most certainly
> is not 0x10.

You need to make the driver mask with IO_NDELAY instead of O_NONBLOCK.
As to why two different bits are used, I don't know.
Andreas Gustafsson,