From owner-freebsd-hackers@FreeBSD.ORG Wed Dec 14 01:59:44 2005 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 06F4816A41F for ; Wed, 14 Dec 2005 01:59:44 +0000 (GMT) (envelope-from jmg@hydrogen.funkthat.com) Received: from hydrogen.funkthat.com (gate.funkthat.com [69.17.45.168]) by mx1.FreeBSD.org (Postfix) with ESMTP id 224FA43D5D for ; Wed, 14 Dec 2005 01:59:43 +0000 (GMT) (envelope-from jmg@hydrogen.funkthat.com) Received: from hydrogen.funkthat.com (localhost.funkthat.com [127.0.0.1]) by hydrogen.funkthat.com (8.13.3/8.13.3) with ESMTP id jBE1xfN6075607; Tue, 13 Dec 2005 17:59:41 -0800 (PST) (envelope-from jmg@hydrogen.funkthat.com) Received: (from jmg@localhost) by hydrogen.funkthat.com (8.13.3/8.13.3/Submit) id jBE1xe0i075606; Tue, 13 Dec 2005 17:59:40 -0800 (PST) (envelope-from jmg) Date: Tue, 13 Dec 2005 17:59:39 -0800 From: John-Mark Gurney To: Vaclav Haisman Message-ID: <20051214015939.GD55657@funkthat.com> Mail-Followup-To: Vaclav Haisman , freebsd-hackers@freebsd.org References: <20051213193118.Q94136@logout.sh.cvut.cz> <20051214010711.F78686@logout.sh.cvut.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20051214010711.F78686@logout.sh.cvut.cz> User-Agent: Mutt/1.4.2.1i X-Operating-System: FreeBSD 5.4-RELEASE-p6 i386 X-PGP-Fingerprint: B7 EC EF F8 AE ED A7 31 96 7A 22 B3 D8 56 36 F4 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html Cc: freebsd-hackers@freebsd.org Subject: Re: kqueue/kevent and directories (Was: Equivalent of POLLERR for kqueue.) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: John-Mark Gurney List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Dec 2005 01:59:44 -0000 Vaclav Haisman wrote this message on Wed, Dec 14, 2005 at 01:12 +0100: > On Tue, 13 Dec 2005, Vaclav Haisman wrote: > > >Is there equivalent of POLLERR for kqueue()? Or is EV_EOF the only thing? > >I would like to use kqueue/kevent for sockets but error condition > >signaling is not clear to me from manpage. It's up to the driver, but I don't believe that kqueue normally delivers errors back to the process... it returns as ready, but needs to be checked manually via a call to the proper syscall... (at least for sockets).. > >Vaclav Haisman > Another unclear area for me is how do changes in watched directory map on > NOTE_*s of EVFILT_VNODE filter. What NOTE_* do I get when a file is > created/deleted/modified etc.? You basicly have to treat a directory as a normal file.. if a NOTE_WRITE or NOTE_EXTEND gets returned on a directory, you have to rescan the entire directory to see what changed... kqueue does not return the directory entry in a watched directory that change/added/removed.. > Is there some other documentation I can read besides the man page? src/sys/kern/kern_event.c (and associated files)... There is also jlemon's paper on kqueue: http://people.freebsd.org/~jlemon/papers/kqueue.pdf -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not."