per-device sysctls

Bruce Evans bde at zeta.org.au
Sat Feb 28 03:06:01 PST 2004


On Fri, 27 Feb 2004, Poul-Henning Kamp wrote:

> In message <20040227230124.D2469 at gamplex.bde.org>, Bruce Evans writes:
> >Only broken drivers use sysctl variables.  ioctl(3) is a much better
> >interface that sysctl(3) for accessing per-device info.  sysctl(8) is
> >a better interface than ioctl(8) for handling the few device control
> >things that can be done in a generic way, but this is only because
> >there are so few such things that ioctl(8) doesn't exist.
>
> sysctl is superior for properties that should not be vulnerable
> to any user who happens to be able to open the device.

Nope.  Only broken drivers would provide more features than are intended
to any user who happens to be able to open the device.  Many drivers
require write access to do write-like operations, and some bogusly
require appropriate privilege.  Extra device nodes (control devices)
are be required to provide access to certain features (especially when
opening the normal device is required to have a side effect).  There
is much more support for access control on device nodes than on sysctls.

Bruce


More information about the freebsd-arch mailing list