sysctl: good practices and how to deprecate a node

Jean-Sébastien Pédron dumbbell at
Fri Mar 7 10:33:27 UTC 2008

Hash: SHA1


I'm currently working again on the Synaptics Touchpad support[1] in psm(4).

The enable_synaptics() probe function adds a subtree to "hw.psm"; I
didn't changed its behaviour for now. This subtree is created only if:
    o  "hw.psm.synaptics_support" is true
    o  no previous probe function "took" the device.
If the function doesn't find a Synaptics touchpad, the tree is left created.

First, is enable_synaptics() the right place to add this subtree
(compared to a "globally" created tree, like "hw.psm")?

If enable_synaptics() is the way to go, should it be always created if
"hw.psm.synaptics_support" is true, even if no touchpad is found? Or
only when the touchpad is detected?

In psmsoftintr(), the code in FreeBSD doesn't check for bad sysctl
values. My patch doesn't do it either for now. But wrong values could
cause division by zero for example. Is there a way to check sysctls only
when they are modified, instead of before every use?

Last question: I expanded the Synaptics subtree with my own nodes but
there are three nodes which are not used anymore. How should I handle
deprecation of these nodes?

Thanks :)

[1] See the wiki:

- --
Jean-Sébastien Pédron

PGP Key:

Version: GnuPG v1.4.8 (FreeBSD)
Comment: Using GnuPG with Mozilla -


More information about the freebsd-hackers mailing list