Re: An alternative way of populating /proc

From: Kai Henningsen (kaih@khms.westfalen.de)
Date: Sat Apr 15 2000 - 19:07:00 EST


Matt.Aubury@comlab.ox.ac.uk (Matt Aubury) wrote on 14.04.00 in <20000414170304.A5312@ash.comlab>:

> * Multiple reads are non-atomic -- Yes, but I think if you care about
> atomicity of the interface then, again, you are probably in the 10%
> of tricky cases.

You can solve a lot of those with an additional syscall interface that can
handle multiple values.

> Poking around my 2.2.12 /proc I see the following in the root owned
> parts:
>
> 187 -rw-r--r--
> 103 -r--r--r--
> 12 -r-------- (kcore, kmsg, IDE stuff -- don't know why)
> 11 -rw------- (IDE, some firewall stuff, some VM stuff)
> 52 dr-xr-xr-x
>
> So it seems that the vast majority of cases can be boiled down to just
> whether or not root is allowed to write.

You seem to have exactly two boolean variables here:

(1) root can read, or read/write
(2) mortals can read, or not

%d for public root-changeable int
%?d if root can only read
%0d if mortals can't read
%?0d for both

- or pick different indicator chars.

> As for data types, integer I/O (decimal and hex) seems to be very
> common. String output is also frequent. We could potentially also do
> range checked integers, string input, arrays... How useful would these
> be? We'll still have the ability to pass function pointers for output,
> and I'll be adding support for generic input too.

I suspect you also want IP numbers and some other beasts.

MfG Kai

-
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:27 EST