[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: nonblocking read
From: |
Ladislav Michl |
Subject: |
Re: nonblocking read |
Date: |
Wed, 14 Nov 2007 14:22:44 +0100 |
User-agent: |
Mutt/1.5.13 (2006-08-11) |
On Tue, Nov 13, 2007 at 12:15:17AM +0100, Pawel Kot wrote:
> > If the official driver documentation or source code doesn't explicitly
> > state that the driver may block in read(2) after a successful select(2),
> > I would still ask the driver maintainers about that; chances are this
> > behavior is not what they had in mind, and they are just not aware of
> > it.
>
> I disagree. As said above successful select() does not mean read()
> will not block. To make read() not block you need to set the file
> descriptor to non blocking mode. And that's the only way that
> guarantees read() not to block.
What about fcntl(fd, F_SETFL, O_NONBLOCK) before select?
ladis