Date: Wed, 15 Apr 1998 10:12:40 -0700 From: "Eric A. Davis" <edavis@nas.nasa.gov> To: Eivind Eklund <eivind@yes.no> Cc: edavis@shark.nas.nasa.gov, freebsd-hackers@FreeBSD.ORG Subject: Re: how to add new system calls... Message-ID: <199804151712.KAA25752@shark.nas.nasa.gov> In-Reply-To: eivind's message of Wed, 15 Apr 1998 12:57:29 %2B0200.<19980415125729.03160@follo.net>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199804151712.KAA25752>
