Subject: Re: Generic Properties
To: None <>
From: John Fremlin <>
List: tech-kern
Date: 06/23/2001 23:00:38 writes:

> It has come to my attention that there is a desire to use properties
> for objects other than devices.  To address this need, here is a
> proposal for a framework to support generic kernel properties.  More
> specific property frameworks, like device properties, can be built
> on top of this:

Sounds a lot like linux procfs


>    int setprop(kdatabase_t db, opaque_t object, const char *name, 
> 		void *val, size_t len, int type, int wait);
>    size_t getprop(kdatabase_t db, opaque_t object, prop_iter_t *next,
> 		const char *name, void *val, size_t len, int *type);
>    int delprop(kdatabase_t db, opaque_t object, const char *name);
>    int copyprops(kdatabase_t db, opaque_t source, opaque_t dest, 
> 			int wait);

O dear. So many new syscalls, so many new tools needed to play with
them :-(

Why not recycle those good old tried and tested favorites, like read(2)
and write(2)? Then all your users need is a working shell.


> Similar interfaces are provided for manipulating kernel databases
> for both inside the kernel as well as a system call interface.  Only
> root can create or modify property values, but anyone can query
> properties.

A bit arbitrary. If you had an fs for it you'd get finer grained
permission control for free. . .

Note that I'm not saying you should simply copy linux procfs, because
that interface is very very messy both inside and outside the
kernel. You could keep your interface but implement it on top of a
filesystem, which would simplify the userspace interface like
anything and make it much more powerful.