Subject: Re: Implementation question
To: None <cherry@sdf.lonestar.org>
From: Steven M. Bellovin <smb@cs.columbia.edu>
List: tech-kern
Date: 04/11/2006 09:17:19
On Tue, 11 Apr 2006 18:40:56 +0530, "Cherry G. Mathew"
<cherry@sdf.lonestar.org> wrote:

> On 4/11/06, Steven M. Bellovin <smb@cs.columbia.edu> wrote:
> 
> >
> > In all Unix drivers I've ever looked at, read calls block in the driver if
> > there's no data available.  The interrupt routine would wake the sleeping
> > process, which would then copy the data to userspace and return.
> 
> Doesn't the driver have the option of returning EAGAIN, especially if
> the process doesn't want to sleep on a read ?
> 
Sure, if that's what the user wants.  The question was on how to do
blocking reads, and by longstanding tradition that's the default for Unix.

		--Steven M. Bellovin, http://www.cs.columbia.edu/~smb