lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Wed, Oct 17, 2012 at 11:31:14PM -0200, Jorge wrote:
> On 17/10/12 18:06, Sam Roberts wrote:
> >Diego doesn't want to document capabilities that don't work the same
> >on linux and windows.
> Sounds fair.
> 
> >Btw, you cannot meaningfully select() on files in linux. You can
> >select from them, but they always
> >return readable,so selecting on an io object, or the fd from an io
> >object probably doesn't do what you want.
> 
> Hm, i must be missing something (again). I've done

You can't poll on _regular_ files. It's actually a POSIX requirement that
regular files always signal immediate readiness for reading and writing.
Historically, block I/O devices were considered sufficiently fast in the
grand scheme of things that it was useless to poll on them. And it's also
really hard to implement in kernels--few (I can't think of any) do it
without relying on threads.

Character devices, named fifos, unix domain sockets... these things are not
regular files.