bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: netfs and O_NONBLOCK


From: Roland McGrath
Subject: Re: netfs and O_NONBLOCK
Date: Mon, 26 Jul 2004 15:48:43 -0400 (EDT)

I'm not sure what you think O_NONBLOCK has to do with io_select.
io_select's behavior should never be affected by nonblocking mode.

The O_NONBLOCK flag bit is strangely overloaded (as specified in POSIX.1).
It is a state flag for an open file description (i.e. a peropen in our
implementations' data structures).  However, it is not preserved from the
flags in an open like e.g. O_APPEND is.  O_NONBLOCK is a flag to the open
call itself (in our case, that means dir_lookup and fsys_getroot) that says
that acquiring the new file descriptor (i.e. client port) itself should not
block.  Without O_NONBLOCK, a terminal device blocks in open until carrier
detect, for example.  That meaning is unrelated to the file description's
(peropen's) state of nonblocking i/o mode.  You cannot enable nonblocking
i/o mode at open time, only with fcntl (i.e. io_set_openmodes et al).
This is why O_NONBLOCK belongs in OPENONLY_STATE_MODES.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]