From owner-freebsd-hackers@FreeBSD.ORG Sun Jun 15 09:59:20 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 8662C37B401 for ; Sun, 15 Jun 2003 09:59:20 -0700 (PDT) Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id C170E43F93 for ; Sun, 15 Jun 2003 09:59:19 -0700 (PDT) (envelope-from robert@fledge.watson.org) Received: from fledge.watson.org (localhost [127.0.0.1]) by fledge.watson.org (8.12.9/8.12.9) with ESMTP id h5FGveYA099163; Sun, 15 Jun 2003 12:57:40 -0400 (EDT) (envelope-from robert@fledge.watson.org) Received: from localhost (robert@localhost)h5FGvewG099160; Sun, 15 Jun 2003 12:57:40 -0400 (EDT) (envelope-from robert@fledge.watson.org) Date: Sun, 15 Jun 2003 12:57:40 -0400 (EDT) From: Robert Watson X-Sender: robert@fledge.watson.org To: Matthew Hagerty In-Reply-To: <1079.10.0.81.10.1055692530.squirrel@www.mundomateo.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-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: Sun, 15 Jun 2003 16:59:20 -0000 On Sun, 15 Jun 2003, Matthew Hagerty wrote: > I'm writing a little application that needs to watch a file that another > process is writing to, think 'tail -F'. kqueue and kevent are going to > do it for me on *BSD, but I'm also trying to support *cough* linux and > other UN*X types OSes. > > >From what I can find on google, the linux community seems very opposed > to kqueue and has not yet implemented it (they say: blah blah blah, > aio_*, blah blah balh.) What alternatives do I have with OSes that > don't support kqueue? I'd really hate to poll with stat(), but do I > have any other choices? I was recently told about a library named libevent from Niels Provos, which abstracts a variety of underlying event mechanisms behind a common API. You can learn a bit more about it here: http://www.monkey.org/~provos/libevent/ It doesn't appear to support /dev/poll yet, but the web page suggests such support is planned. If it's not already a port, we should create one. Robert N M Watson FreeBSD Core Team, TrustedBSD Projects robert@fledge.watson.org Network Associates Laboratories