Usage sysctl

Hello,

I understand with the utility sysctl(8). I use the command
sysctl -a -d

I see
kern.proc.pid: Process table

Having rummaged in source codes I understand that this sysctl should output the information on process. But how it to make?

sysctl kern.proc.pid
Outputs nothing.
 
/usr/src/tools/tools/sysdoc/tunables.mdoc
kern.proc.pid
struct

This internally used
.Nm
may be used to extract process information. See
.Xr sysctl 3
for an example.
Seems sysctl dont should do anything with this since its struct... "may be used" its not always may be used with sysctl utility =)
 
I believe this option in only available when the kernel is compiled with ``options STACK'' and/or ``options DDB''.
 
Here this moment also is not clear. I looked source codes and I know, how using kern.proc.pid to receive the information on process.
On the other hand, kern.proc.all is practically for the same, but as a result of performance
sysctl -A
We see
kern.proc.all: Format:S, proc Lengty:45312 Dump:.....
Intuitively I understand that it is necessary to specify pid process for reception of the information on it.

Means sysctl -a -d outputs the list of all possible sysctls? Even those which cannot be used with sysctl(8)?
:q
 
I understand all. A question purely rhetorical - what for to output the list sysctl's which then cannot be used with the command?
:q
 
Andrew said:
A question purely rhetorical - what for to output the list sysctl's which then cannot be used with the command?
There are two sysctls. sysctl(8) is a command line utility that gives you access to many parts of the sysctl(3) API. The parts it doesn't give you access to are those parts that are only useful to applications interfacing directly with the API.
 
For me a question. Whether has sense to write a set of utilities expanding sysctl (8) for reading of all known sysctl's? I wish to try, but whether there will be an advantage to a community?
 
To answer that for the community you first need to answer it for yourself, ie. are there capabilities lacking in the sysctl(8) utility that would be of value to you? If so, write them... at least the ones that are important to you, and then submit the changes to the project.
 
Thanks for council. Most likely and I will make. But nevertheless I tend to to write the version. The interface will differ.
 
Back
Top