From owner-freebsd-hackers@FreeBSD.ORG Fri Oct 31 11:36:46 2003 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 64E7716A4CE for ; Fri, 31 Oct 2003 11:36:46 -0800 (PST) Received: from mta9.adelphia.net (mta9.adelphia.net [68.168.78.199]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8538C43F75 for ; Fri, 31 Oct 2003 11:36:45 -0800 (PST) (envelope-from andi_payn@speedymail.org) Received: from [10.1.0.9] ([68.65.235.109]) by mta9.adelphia.net (InterMail vM.5.01.06.05 201-253-122-130-105-20030824) with ESMTP id <20031031193648.EWJ25728.mta9.adelphia.net@[10.1.0.9]>; Fri, 31 Oct 2003 14:36:48 -0500 From: andi payn To: Ruben de Groot In-Reply-To: <20031031063303.GA38640@ei.bzerk.org> References: <1067529247.36829.2138.camel@verdammt.falcotronic.net> <20031031063303.GA38640@ei.bzerk.org> Content-Type: text/plain Message-Id: <1067629003.825.97.camel@verdammt.falcotronic.net> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 Date: Fri, 31 Oct 2003 11:36:43 -0800 Content-Transfer-Encoding: 7bit cc: freebsd-hackers@freebsd.org Subject: Re: kevent and related stuff 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: Fri, 31 Oct 2003 19:36:46 -0000 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.