kernel enviroment in sysctl MIB

Reinier Kleipool Reinier at Kleipool.org
Thu Nov 13 03:03:10 PST 2003


Perter Pentechv wrote

> Take a look at the kenv(1) utility - its source is in the
> src/usr.bin/kenv/kenv.c file.

Yes this does the job. But in a strange way... It starts at OID 0.3
(kern.environment) and appends small integers to it (0,1,2,3 etc). Why do it
so strange.. Why are the variable names not just visible in sysctl. I know
that the kern enviroment is not often used in normal operation, but would't
it be nicer to just see the variables in the sysctl mib?

I can incorporate this "trick" in my install program, but I could also try
to patch kern_environment.c so the variables become visible. What do you
think....

Kind regards,
Reinier



More information about the freebsd-hackers mailing list