lkml.org 
[lkml]   [1999]   [Jun]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: Non-blocking read
Hi,

On Mon, 14 Jun 1999 20:08:36 +0200 (CEST), Arjan van de Ven
<arjan@fenrus.demon.nl> said:

> I want to do a non-blocking read from a file, from within the kernel.
> Is this, at all, possible? I have been tracing how userspace does
> this, but the userspace does not seem to be non-blocking either.

For regular files, that is correct. But...

> * non-blocking read is issued
> * if the pages are in the pagecache, they are copied to my buffer
> * if they are not, an asynchronous read-ahead is issued and the
> read-funtion returns -EAGAIN

...to do this in the kernel, look at the readahead code: that populates
the page cache asynchronously. There just isn't any high-level function
which does that automatically for you: you need to do all the setup
yourself.

--Stephen

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:52    [W:0.074 / U:0.156 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site