Entry points: userland process (continued)


ioctl
Most drivers have settings controlled by an I/O control
system call known as ioctl.

This takes a file descriptor, the request and an argment.
This is what things like ifconfig use to get/set interface parameters.

ioctl(s, SIOCG80211CHANNEL, (caddr_t)&channel);

sysctl
The libc sysctl() wrapper around the __sysctl() system call
provides access to a name value list of values/settings.

This should normally be avoided by drivers for providing
settings/knobs but can be used to show state by interacting
with the sensors API in the kernel.

$sysctl hw
hw.sensors.0=aps0, X_ACCEL, 505 raw
hw.sensors.1=aps0, Y_ACCEL, 493 raw
hw.sensors.2=aps0, X_VAR, 505 raw
hw.sensors.3=aps0, Y_VAR, 494 raw
hw.sensors.4=aps0, Temp 1, 43.00 degC
hw.sensors.5=aps0, Temp 2, 43.00 degC
hw.sensors.6=aps0, Keyboard Active, 1 raw
hw.sensors.7=aps0, Mouse Active, 0 raw
hw.sensors.8=aps0, Lid Open, 1 raw
hw.sensors.9=aps0, unknown, 7 raw