Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 31 Oct 2003 11:36:43 -0800
From:      andi payn <andi_payn@speedymail.org>
To:        Ruben de Groot <mail25@bzerk.org>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: kevent and related stuff
Message-ID:  <1067629003.825.97.camel@verdammt.falcotronic.net>
In-Reply-To: <20031031063303.GA38640@ei.bzerk.org>
References:  <1067529247.36829.2138.camel@verdammt.falcotronic.net> <20031031063303.GA38640@ei.bzerk.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 2003-10-30 at 22:33, Ruben de Groot wrote:
> On Thu, Oct 30, 2003 at 07:54:07AM -0800, andi payn typed:
> 
> [...]
> 
> > * I think (but I'm not sure) that kevent doesn't notify at all if the
> > only change to a file is its ATIME. If I'm right, this makes kevent
> > completely useless for fam. Adding a NOTE_ACCESS or something similar
> > would fix this. 

> Wouldn't NOTE_ATTRIB (EVFILT_VNODE) do what you want?

That was my first guess, but I first tested it with wait_on (before
sending the original email), and have since tested it directly, and
apparently you don't get NOTE_ATTRIB notifications just because the
ATIME changes.

As far as I can tell, there is no way to get notifications on only the
ATIME changing.

Now, if everyone seems to write the manpage as implying that NOTE_ATTRIB
should in fact get triggered by a change in the ATIME, maybe the right
solution is to make this true. However, I could easily see that breaking
existing code. That's why I suggested adding a new NOTE_ACCESS instead.

To see for yourself, here's the simplest possible test:
# touch /tmp/file
# ls -lu /tmp/file
-rw-------  1 andi  users  0 Oct 31 11:29 /tmp/file
# wait_on -h /tmp/file > /tmp/out &
# cat /tmp/file
# cat /tmp/out
# ls -lu /tmp/file
-rw-------  1 andi  users  0 Oct 31 11:30 /tmp/file
# touch /tmp/file
[1]+  Exit 4     wait_on -h /tmp/file > /tmp/out
# cat /tmp/out
/tmp/file: attributed

In other words, changing the ATIME (e.g., with cat) does not trigger
NOTE_ATTRIB; changing the MTIME (e.g., with touch), does.




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