Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 16 Jun 2003 13:17:15 -0500
From:      Stephen Montgomery-Smith <stephen@math.missouri.edu>
To:        hackers@freebsd.org
Subject:   Re: kqueue alternative?
Message-ID:  <3EEE09AB.2030609@math.missouri.edu>
In-Reply-To: <20030616171110.GC56734@webserver.get-linux.org>
References:  <1079.10.0.81.10.1055692530.squirrel@www.mundomateo.com> <Pine.NEB.3.96L.1030615125423.98988D-100000@fledge.watson.org> <Pine.NEB.3.96L.1030615125423.98988D-100000@fledge.watson.org> <E19RrTD-0006yV-00@chiark.greenend.org.uk> <20030616171110.GC56734@webserver.get-linux.org>

next in thread | previous in thread | raw e-mail | index | archive | help

>>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
stephen@math.missouri.edu
http://www.math.missouri.edu/~stephen



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3EEE09AB.2030609>