From owner-freebsd-hackers@FreeBSD.ORG Thu Mar 31 07:03:24 2005 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 0498C16A4CE for ; Thu, 31 Mar 2005 07:03:24 +0000 (GMT) Received: from grunt9.ihug.co.nz (grunt9.ihug.co.nz [203.109.254.51]) by mx1.FreeBSD.org (Postfix) with ESMTP id E553043D54 for ; Thu, 31 Mar 2005 07:03:22 +0000 (GMT) (envelope-from mjl@luckie.org.nz) Received: from 203-173-150-25.bliink.ihug.co.nz (lycra.luckie.org.nz) [203.173.150.25] by grunt9.ihug.co.nz with esmtp (Exim 3.35 #1 (Debian)) id 1DGti5-0004UU-00; Thu, 31 Mar 2005 19:03:21 +1200 Received: from 203-173-154-140.bliink.ihug.co.nz ([203.173.154.140] helo=[192.168.1.6]) by lycra.luckie.org.nz with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.50 (FreeBSD)) id 1DGti4-0008T4-JE for freebsd-hackers@freebsd.org; Thu, 31 Mar 2005 19:03:20 +1200 Message-ID: <424BA0B5.2000302@luckie.org.nz> Date: Thu, 31 Mar 2005 19:03:17 +1200 From: Matthew Luckie User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.5) Gecko/20050313 X-Accept-Language: en-us, en MIME-Version: 1.0 To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Subject: kqueue and ordinary files 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: Thu, 31 Mar 2005 07:03:24 -0000 Does kqueue signal EOF on an ordinary file when there is nothing left to read? The code at http://www.wand.net.nz/~mjl12/kqfile.c.txt cc -Wall -o kqfile kqfile.c ./kqfile kqueue.c doesn't ever get EOF notification as far as i can tell. as in, it isn't signaled in kevent.flags, nor does kqueue signal the file is ready for reading and then read(2) return 0. ident 3 filter 0xffffffff flags 0x0001 fflags 0x0000 data 128 read 128 bytes how should i detect that the file no longer has anything left to read with kqueue? at the moment I use select but would like to use kqueue where available.