Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 25 Jun 2012 20:03:54 -0400
From:      Arnaud Lacombe <lacombar@gmail.com>
To:        FreeBSD Current <freebsd-current@freebsd.org>,  FreeBSD Hackers <freebsd-hackers@freebsd.org>
Cc:        bp@FreeBSD.org, kby@FreeBSD.org
Subject:   sysctl filesystem ?
Message-ID:  <CACqU3MXaa0R7fG6Q-EqS3h8PJh__tzNeugBxVyqKHxsCR-wTuQ@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
Hi folks,

I find myself in a situation where I need to directly explore the
sysctl(8) tree from my program. The tricky part is this:

from `src/sbin/sysctl.c':
/*
 * These functions uses a presently undocumented interface to the kernel
 * to walk the tree and get the type so it can print the value.
 * This interface is under work and consideration, and should probably
 * be killed with a big axe by the first person who can find the time.
 * (be aware though, that the proper interface isn't as obvious as it
 * may seem, there are various conflicting requirements.
 */

AFAIT, the whole interface used by sysctl(8) to explore the sysctl
tree (ie. list, name, get description) is undocumented. This comment
has been there for about, well... 17 years. No matter to say that it
is highly unlikely anyone is ever gonna design that perfect interface.
Right now, I am left with no choice but to figure out how that stuff
work, which I foresee will be a real PITA. No choice ? Well, not so
much. About 12 years ago a filesystem interface was written for
sysctl, namely scfs(4). It was authored by Kelly Yancey and (?) Boris
Popov. Unfortunately, time passed and no code is any longer publicly
available. URLs are either no longer valid or password-protected.

This interface would just be perfect for my use-case. No need to spend
time decoding a prehistoric interface, no need to craft custom
accessors. I would just have to use standard POSIX file interface...
if the code was available.

I was hoping some of the people on this list would either, have the
scfs(4) code on their drives/tapes, or have a way to contact the
original author(s) and thus have a chance to get that code ?

Thanks in advance,
 - Arnaud

ps: I know the code will certainly have to be fixed, but that is still
the best option I've got so far.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CACqU3MXaa0R7fG6Q-EqS3h8PJh__tzNeugBxVyqKHxsCR-wTuQ>