2005-02-07 17:24:10

by Chris Friesen

[permalink] [raw]
Subject: where to export system tuneables, /proc/sys/kernel or /sys/?


I'm doing some kernel work that will export tuneables to userspace. In
2.4 I would have used /proc/sys/kernel, but now there is /sys, which was
supposed to be for system information.

However, a bit of poking around in /sys didn't reveal any obvious place
to put it. Is current practice to still put this sort of thing in /proc?

Thanks,

Chris


2005-02-08 22:47:03

by H. Peter Anvin

[permalink] [raw]
Subject: Re: where to export system tuneables, /proc/sys/kernel or /sys/?

Followup to: <[email protected]>
By author: Chris Friesen <[email protected]>
In newsgroup: linux.dev.kernel
>
> I'm doing some kernel work that will export tuneables to userspace. In
> 2.4 I would have used /proc/sys/kernel, but now there is /sys, which was
> supposed to be for system information.
>
> However, a bit of poking around in /sys didn't reveal any obvious place
> to put it. Is current practice to still put this sort of thing in /proc?
>

/proc/sys/kernel, using the sysctl internals, yes.

Note that the use of the sysctl(2) system call is highly deprecated,
but the /proc/sys filesystem tree is not; the reason is that the
numeric API used by the former is unstable.

-hpa