From owner-freebsd-hackers@FreeBSD.ORG Mon Jun 16 22:12:25 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 EE87237B401 for ; Mon, 16 Jun 2003 22:12:25 -0700 (PDT) Received: from puffin.mail.pas.earthlink.net (puffin.mail.pas.earthlink.net [207.217.120.139]) by mx1.FreeBSD.org (Postfix) with ESMTP id 50EA343F3F for ; Mon, 16 Jun 2003 22:12:25 -0700 (PDT) (envelope-from tlambert2@mindspring.com) Received: from user-2injaq3.dialup.mindspring.com ([165.121.171.67] helo=mindspring.com) by puffin.mail.pas.earthlink.net with asmtp (SSLv3:RC4-MD5:128) (Exim 3.33 #1) id 19S8lN-0000pD-00; Mon, 16 Jun 2003 22:12:10 -0700 Message-ID: <3EEEA2E2.6E4A2409@mindspring.com> Date: Mon, 16 Jun 2003 22:10:58 -0700 From: Terry Lambert X-Mailer: Mozilla 4.79 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Joshua Oreman References: <1079.10.0.81.10.1055692530.squirrel@www.mundomateo.com> <20030616171110.GC56734@webserver.get-linux.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-ELNK-Trace: b1a02af9316fbb217a47c185c03b154d40683398e744b8a4c58d8e6e73f7d48b9004c2415d6bc12a350badd9bab72f9c350badd9bab72f9c350badd9bab72f9c cc: Tony Finch cc: hackers@freebsd.org 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: Tue, 17 Jun 2003 05:12:26 -0000 Joshua Oreman wrote: > > >I would say, use select(2). > > >Is there a reason this wouldn't work? > > > > 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? Select blocks on readfds if a read from the file would block; that is never the case with a file: you will either get data, or you will get an EOF. Select blocks on writefds if a write to the file would block; that is never the case with a file: you will either successfully write, or you will get an error, e.g. as a result of exceeding quota, etc.. Therefore a select for reads or writes on a disk file should always return true. -- Terry