Re: An alternative way of populating /proc

From: Matthew Kirkwood (weejock@ferret.lmh.ox.ac.uk)
Date: Tue Apr 11 2000 - 12:08:06 EST


On Tue, 11 Apr 2000, Matt Aubury wrote:

> create_proc_entries(NULL,
> "test:{bar:{x:%d,y:%d,z:%d},foo:%f}",
> &x, &y, &z, foo_fun);
>
> creates a "/proc/test" directory, which further contains a
> subdirectory "bar" and a file "foo". The "bar" subdirectory
> contains three files "x", "y" and "z".

I like the directory thing. Imagine the deafening lack of
"/proc/cpuinfo is architecture-specific" threads when we
can tell people to cat /proc/cpu/0/bogomips.

> Many people will hate this because (1) it's doing parsing within the
> kernel, (2) it tends to favour ascii I/O, (3) it tends to favour deep
> directory hierarchies,(4) it uses recursion :-)

I only hate it because of (1) :-)

I'm not at all sure that it would scale to all of the uses that
people would want to make of it, though - how to I represent
file permissions here? What about writable files?

Without a lot of care, tt could easily turn into sysctl.c.

Matthew.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Apr 15 2000 - 21:00:16 EST