Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 13 Dec 2005 17:59:39 -0800
From:      John-Mark Gurney <gurney_j@resnet.uoregon.edu>
To:        Vaclav Haisman <V.Haisman@sh.cvut.cz>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: kqueue/kevent and directories (Was: Equivalent of POLLERR for kqueue.)
Message-ID:  <20051214015939.GD55657@funkthat.com>
In-Reply-To: <20051214010711.F78686@logout.sh.cvut.cz>
References:  <20051213193118.Q94136@logout.sh.cvut.cz> <20051214010711.F78686@logout.sh.cvut.cz>

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



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