Dnia nie 18. maja 2003 11:49, Simon Strandgaard napisa?:

> > in particular, a file  descriptor  is also ready on end-of-file),

> Can someone explain why 'select' has such behavier and why its smart ?
>
> To me this is non-intuitive... so non-intuitive that I simply don't
> understand it :-)

For me it's very intuitive. How would you otherwise distinguish between end of 
stream and a state where it's not known yet whether there is something more 
to read?

select selects descriptors from which you could read without being blocked.
It's very purpose is to check which of several file descriptors won't block 
(in case of a single descriptor you can just perform a blocking read) or to 
block not longer than a specific timeout. In ancient times without select the 
only option was busy waiting.

And it's like C select does.

-- 
   __("<         Marcin Kowalczyk
   \__/       qrczak / knm.org.pl
    ^^     http://qrnik.knm.org.pl/~qrczak/