From owner-freebsd-hackers@FreeBSD.ORG Tue May 22 17:25:32 2007 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 39E2316A473 for ; Tue, 22 May 2007 17:25:32 +0000 (UTC) (envelope-from ssouhlal@FreeBSD.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 283F313C4C1 for ; Tue, 22 May 2007 17:25:32 +0000 (UTC) (envelope-from ssouhlal@FreeBSD.org) Received: from [192.168.0.97] (c-76-21-32-5.hsd1.ca.comcast.net [76.21.32.5]) by elvis.mu.org (Postfix) with ESMTP id A684D1A3C19; Tue, 22 May 2007 10:05:39 -0700 (PDT) In-Reply-To: <200705210948.36033.dmw@unete.cl> References: <200705201831.38828.dmw@unete.cl> <20070521075757.GG4602@funkthat.com> <200705210948.36033.dmw@unete.cl> Mime-Version: 1.0 (Apple Message framework v752.3) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <23B4A664-5916-47D3-8D42-282817F6CC70@FreeBSD.org> Content-Transfer-Encoding: 7bit From: Suleiman Souhlal Date: Tue, 22 May 2007 10:04:37 -0700 To: dmw@unete.cl X-Mailer: Apple Mail (2.752.3) Cc: freebsd-hackers@freebsd.org, John-Mark Gurney Subject: Re: kqueue implementation X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2007 17:25:32 -0000 On May 21, 2007, at 6:48 AM, Daniel Molina Wegener wrote: > On Monday 21 May 2007 03:57:58 John-Mark Gurney wrote: >> Daniel Molina Wegener wrote this message on Sun, May 20, 2007 > at 18:31 -0400: >>> I'm coding an application using the kqueue facility, but >>> I see that I can't handle open and read events. Is planned >>> to implement these handlings in the future?. Also, which >>> facility can I use to handle these kind of events? >> >> I'm unsure what you mean by open and read events? Do you >> mean getting an event when another process opens are file? >> or? As for read, they work fine for sockets, as w/ select, >> files are always ready to read even though they may block to >> read from disk... > > Hello, > > I mean vnode events, in the manual page I see NOTE_WRITE, but I > need NOTE_OPEN and NOTE_READ. Is there any chance to get these > kind of events? They should be easy to add.. All you would need to do for NOTE_OPEN would be to add a vop_open_post hook to VOP_OPEN that calls VFS_KNOTE_LOCKED(..., NOTE_OPEN). Similarly for read. Take a look at how, for example, NOTE_CREATE is implemented (vop_create_post in sys/kern/vfs_subr.c) and how we add VOP hooks (sys/kern/vnode_if.src). Why do you need these? -- Suleiman