mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Michael Rothwell <rothwell@holly-springs.nc.us>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: linux-kernel@vger.kernel.org
Subject: Re: O_NONBLOCK, read(), select(), NFS, Ext2, etc.
Date: Fri, 12 Jan 2001 09:55:21 -0500	[thread overview]
Message-ID: <3A5F1AD9.F9868559@holly-springs.nc.us> (raw)
In-Reply-To: <E14H0hc-00043X-00@the-village.bc.nu>

Alan Cox wrote:
> 
> > using the O_NONBLOCK flag, then read() and write() will always return
> > immediately and not block the calling process. This does not appear to
> > 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


How about using fcntl(), O_ASYNC and SIGIO? Or maybe a broader question:
what's the preferred/working way to do async file i/o on Linux?

-M
-
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/

  reply	other threads:[~2001-01-12 14:56 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 [this message]
2001-01-12 16:34   ` Alexander V. Lukyanov
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=3A5F1AD9.F9868559@holly-springs.nc.us \
    --to=rothwell@holly-springs.nc.us \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    /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®