stdin set to nonblocking mode
John Meacham
john at repetae.net
Fri Aug 12 10:43:56 EDT 2005
On Fri, Aug 12, 2005 at 07:11:24AM -0700, Sigbjorn Finne wrote:
>
> "Simon Marlow" <simonmar at microsoft.com> writes:
> >
> ...
> >No - read() can always return less than the requested amount of data,
> >even when not in O_NONBLOCK mode.
> >
>
> Hmm, care to give some details as to why you equate "can" with
> "always will" on all platforms?
Yes. this is guarenteed behavior on pretty much every system. A whole
lot of things would break if it were otherwise. if select says a file
descriptor can be written to or read from then the next write or read call is
guarenteed to not block, no matter what its size. (you just may get a
short read or write)
John
--
John Meacham - ⑆repetae.net⑆john⑈
More information about the Glasgow-haskell-bugs
mailing list