From owner-freebsd-hackers@FreeBSD.ORG Mon Jun 16 04:35:23 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 3D80737B401 for ; Mon, 16 Jun 2003 04:35:23 -0700 (PDT) Received: from stork.mail.pas.earthlink.net (stork.mail.pas.earthlink.net [207.217.120.188]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9850543F85 for ; Mon, 16 Jun 2003 04:35:22 -0700 (PDT) (envelope-from tlambert2@mindspring.com) Received: from user-2ivfi6a.dialup.mindspring.com ([165.247.200.202] helo=mindspring.com) by stork.mail.pas.earthlink.net with asmtp (SSLv3:RC4-MD5:128) (Exim 3.33 #1) id 19RsGW-00020F-00; Mon, 16 Jun 2003 04:35:12 -0700 Message-ID: <3EEDA76C.43795D89@mindspring.com> Date: Mon, 16 Jun 2003 04:18:04 -0700 From: Terry Lambert X-Mailer: Mozilla 4.79 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Tony Finch References: <1079.10.0.81.10.1055692530.squirrel@www.mundomateo.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-ELNK-Trace: b1a02af9316fbb217a47c185c03b154d40683398e744b8a4c54ec960071150b12c3c5d8ffae0139b350badd9bab72f9c350badd9bab72f9c350badd9bab72f9c cc: hackers@freebsd.org cc: oremanj@www.get-linux.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: Mon, 16 Jun 2003 11:35:23 -0000 Tony Finch wrote: > Joshua Oreman wrote: > >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'. > > > >I would say, use select(2). > >Is there a reason this wouldn't work? > > Select doesn't work with files. The current "tail -f" uses kqueue. The prior "tail -f" used to open the file, and fstat() it in a 1 second sleep() loop, looking for the file to get larger. So your "alternative to kqueue" is to sleep loop and fstat. -- Terry