Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 31 Mar 2005 19:03:17 +1200
From:      Matthew Luckie <mjl@luckie.org.nz>
To:        freebsd-hackers@freebsd.org
Subject:   kqueue and ordinary files
Message-ID:  <424BA0B5.2000302@luckie.org.nz>

next in thread | raw e-mail | index | archive | help
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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?424BA0B5.2000302>