This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Use uname not sysctl to get the kernel revision
- From: "Albert Cahalan" <acahalan at gmail dot com>
- To: "H. Peter Anvin" <hpa at zytor dot com>
- Cc: ak at suse dot de, tytso at mit dot edu, ebiederm at xmission dot com, drepper at redhat dot com, arjan at infradead dot org, rdunlap at xenotime dot net, akpm at osdl dot org, linux-kernel at vger dot kernel dot org, libc-alpha at sourceware dot org
- Date: Thu, 13 Jul 2006 02:09:50 -0400
- Subject: Re: [PATCH] Use uname not sysctl to get the kernel revision
- References: <787b0d920607122200m4785f7ddmddf40c079a7460cb@mail.gmail.com> <44B5DD41.90705@zytor.com>
On 7/13/06, H. Peter Anvin <hpa@zytor.com> wrote:
Albert Cahalan wrote:
>>
>> The numerical namespace for sysctl is unsalvagable imho. e.g.
>> distributions regularly break it because there is no central
>> repository of numbers so it's not very usable anyways in practice.
>
> Huh? How exactly is this different from system call numbers,
> ioctl numbers, fcntl numbers, ptrace command numbers, and every
> other part of the Linux ABI?
>
Mostly because some branches of the sysctl tree have dynamic content
which is hard to marshal into a numeric form.
Dynamic content is no problem. FreeBSD uses sysctl
to implement their "ps" program. The process info comes
out of sysctl now. The sysctl man page has an example.
Non-numeric data is more troublesome. FreeBSD has
a syscall that will take text (still faster than /proc/sys),
and another that will convert the text representation
into numeric form for later high-performance use.
Look up all 3 calls here, in section 2:
http://www.freebsd.org/cgi/man.cgi?manpath=FreeBSD+7.0-current