Select doesn't work with files.


Really? `man 2 select' says nothing about that. It just talks about
'file descriptors'. Now if it said 'socket descriptors' or 'non-file
file descriptors' I would understand, but I don't think that that statement
is implied by the man page. Is there something I'm missing?


Well I did a little experimentation. It looks like this. select will say that a file is ready for reading if read(2) will not block. However, if you get to an end of file, then read does not block, rather it returns 0 to indicate end of file. Thus select will not block and will say that this file is ready for reading. In essence, calling select will always say that a file is ready for reading, and calling select serves no purpose.


Well I definitely learned something.


-- Stephen Montgomery-Smith [EMAIL PROTECTED] http://www.math.missouri.edu/~stephen

_______________________________________________
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to