From: "Alexander V. Lukyanov" <lav@yars.free.net>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Michael Rothwell <rothwell@holly-springs.nc.us>,
linux-kernel@vger.kernel.org
Subject: Re: O_NONBLOCK, read(), select(), NFS, Ext2, etc.
Date: Fri, 12 Jan 2001 19:34:38 +0300 [thread overview]
Message-ID: <20010112193437.A26510@swing.yars.free.net> (raw)
In-Reply-To: <200101120327.f0C3Rxc02512@513.holly-springs.nc.us> <E14H0hc-00043X-00@the-village.bc.nu>
In-Reply-To: <E14H0hc-00043X-00@the-village.bc.nu>; from alan@lxorguk.ukuu.org.uk on Fri, Jan 12, 2001 at 09:40:55AM +0000
On Fri, Jan 12, 2001 at 09:40:55AM +0000, Alan Cox wrote:
> > be true; but perhaps I am doing something wrong. If I open() a file (on
> > 2.2.18) from a floppy or NFS mount (to test in a slow environment) with
> > O_NONBLOCK|O_RDONLY, read() will still block. If I try to select() on
> > the file descriptor, select() always returns 0.
>
> The definition of immediate is not 'instant'. Otherwise no I/O system would
> ever return anything but -EWOULDBLOCK. Its that it won't wait when there is
> no data pending. On a floppy there is always data pending
I have a long standing idea on modifying poll/read/write behavior on
regular files opened in O_NONBLOCK mode. How about the following scheme:
* poll returns POLLIN/POLLOUT on regular files only if the data are
in buffer cache/there is room for write().
* read returns EAGAIN if the data are not in buffer cache.
* write returns EAGAIN if there is no room (yet) to store the data.
All the operation should signal to IO subsystem that the data are
needed in cache/the room has to be freed.
--
Alexander.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/
next prev parent reply other threads:[~2001-01-12 16:35 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-01-12 2:34 Michael Rothwell
2001-01-12 3:28 ` Chris Wedgwood
2001-01-12 9:40 ` Alan Cox
2001-01-12 14:55 ` Michael Rothwell
2001-01-12 16:34 ` Alexander V. Lukyanov [this message]
2001-01-12 15:18 Andries.Brouwer
2001-01-12 18:10 Dan Kegel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20010112193437.A26510@swing.yars.free.net \
--to=lav@yars.free.net \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=rothwell@holly-springs.nc.us \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®