From owner-freebsd-hackers Wed Apr 15 10:13:58 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id KAA13918 for freebsd-hackers-outgoing; Wed, 15 Apr 1998 10:13:58 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from shark.nas.nasa.gov (shark.nas.nasa.gov [129.99.34.41]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id RAA13723 for ; Wed, 15 Apr 1998 17:12:59 GMT (envelope-from edavis@shark.nas.nasa.gov) Received: from shark.nas.nasa.gov (edavis@localhost) by shark.nas.nasa.gov (8.8.7/NAS8.8.7) with ESMTP id KAA25752; Wed, 15 Apr 1998 10:12:41 -0700 (PDT) Message-Id: <199804151712.KAA25752@shark.nas.nasa.gov> X-Mailer: exmh version 2.0.2 2/24/98 To: Eivind Eklund cc: edavis@shark.nas.nasa.gov, freebsd-hackers@FreeBSD.ORG Subject: Re: how to add new system calls... In-reply-to: eivind's message of Wed, 15 Apr 1998 12:57:29 +0200.<19980415125729.03160@follo.net> Date: Wed, 15 Apr 1998 10:12:40 -0700 From: "Eric A. Davis" Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Wed, 15 Apr 1998 12:57:29 +0200 Eivind Eklund wrote >On Tue, Apr 14, 1998 at 04:51:08PM -0700, Eric A. Davis wrote: >> >> I am working on a project (for McKusick's Adv. Kernel class) that allows >> user level processes to monitor filesystem activity on a file by file >> basis. The application program expresses interest in files by supplying >> the pathname of a file and a set of events to be monitored. These events >> can be create file, delete file, size changed, attributes changed, etc. > >YES! I've been missing this since I left my Amiga 5 years ago! > Cool! >Does the above imply watching for changes in directories, too? Ie, >file added to directory, notification sent... > Well, it's basically a reverse engineer or IRIX's imon/fam. If a directory is being monitored then any created, deleted, modified file within that directory will generate an event. If a file a monitored then only events for that file will be genereated. >What level of notification? Do you get information saying 'file so >changed atime to XXX'/'file XXX added to directory', or just a flag >saying 'event so happened on descriptor so'? > An event structure is put on a queue (file desc) that contains the file in question and what happened to it. Thus far the following event can be generated: create file, delete file, create dir, delete dir, modify file (contents changed), attribute change for file/dir (chmod, chown, etc). Of course a process can only register a monitor with the kernel on file in which it has access. ;-) Any other ideas would be great. - e -- Eric Allen Davis Network Engineer edavis@nas.nasa.gov NASA Ames Research Center Voice: (415)604-2543 NAS Systems Division Pager: (415)428-6931 http://www.nas.nasa.gov/~edavis To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message