From owner-freebsd-hackers@FreeBSD.ORG Mon Jun 16 11:17:17 2003 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5A4A037B401 for ; Mon, 16 Jun 2003 11:17:17 -0700 (PDT) Received: from sccimhc02.asp.att.net (sccimhc02.asp.att.net [63.240.76.164]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9389743FA3 for ; Mon, 16 Jun 2003 11:17:16 -0700 (PDT) (envelope-from stephen@math.missouri.edu) Received: from math.missouri.edu (12-216-242-20.client.mchsi.com[12.216.242.20]) by sccimhc02.asp.att.net (sccimhc02) with SMTP id <20030616181715im2001qfgie>; Mon, 16 Jun 2003 18:17:16 +0000 Message-ID: <3EEE09AB.2030609@math.missouri.edu> Date: Mon, 16 Jun 2003 13:17:15 -0500 From: Stephen Montgomery-Smith User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.3.1) Gecko/20030611 X-Accept-Language: en-us, en MIME-Version: 1.0 To: hackers@freebsd.org References: <1079.10.0.81.10.1055692530.squirrel@www.mundomateo.com> <20030616171110.GC56734@webserver.get-linux.org> In-Reply-To: <20030616171110.GC56734@webserver.get-linux.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: kqueue alternative? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jun 2003 18:17:17 -0000 >>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