From owner-freebsd-hackers@FreeBSD.ORG Wed May 23 01:42:55 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 78FAF16A469 for ; Wed, 23 May 2007 01:42:55 +0000 (UTC) (envelope-from dmw@unete.cl) Received: from mail09.ifxnetworks.com (mail09.ifxnetworks.com [190.61.128.19]) by mx1.freebsd.org (Postfix) with ESMTP id 188AA13C44B for ; Wed, 23 May 2007 01:42:54 +0000 (UTC) (envelope-from dmw@unete.cl) Received: (qmail 27000 invoked from network); 23 May 2007 01:42:54 -0000 X-Spam-DCC: CTc-dcc1: mail09.ifxnetworks.com 1030; Body=1 Fuz1=1 Fuz2=1 X-Spam-Checker-Version: SpamAssassin 3.1.8 (2007-02-13) on mail09.ifxnetworks.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=6.0 tests=none autolearn=disabled version=3.1.8 Received: from unknown (HELO quake) (dmw@unete.cl@[200.73.29.73]) (envelope-sender ) by mail09.ifxnetworks.com (qmail-ldap-1.03) with AES256-SHA encrypted SMTP for ; 23 May 2007 01:42:53 -0000 From: Daniel Molina Wegener Organization: DMW To: freebsd-hackers@freebsd.org Date: Tue, 22 May 2007 21:42:36 -0400 User-Agent: KMail/1.9.6 References: <200705201831.38828.dmw@unete.cl> <200705210948.36033.dmw@unete.cl> <23B4A664-5916-47D3-8D42-282817F6CC70@FreeBSD.org> In-Reply-To: <23B4A664-5916-47D3-8D42-282817F6CC70@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200705222142.36556.dmw@unete.cl> Cc: John-Mark Gurney , Suleiman Souhlal Subject: Re: kqueue implementation X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: dmw@unete.cl List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2007 01:42:55 -0000 On Tuesday 22 May 2007 13:04:37 Suleiman Souhlal wrote: > 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? I'm working on a log file monitor, with programable tasks on certain events. > > -- Suleiman > > [SNIP] Regards, -- .O. | Daniel Molina Wegener | C/C++ Developer ..O | dmw [at] unete [dot] cl | FOSS Coding Adict OOO | BSD & Linux User | Standards Rocks!