Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 27 Feb 2004 10:07:43 -0500
From:      John Baldwin <john@baldwin.cx>
To:        arch@FreeBSD.org
Cc:        Dag-Erling =?iso-8859-1?q?Sm=F8rgrav?= <des@des.no>
Subject:   Re: per-device sysctls
Message-ID:  <200402271007.43299.john@baldwin.cx>
In-Reply-To: <20040227230124.D2469@gamplex.bde.org>
References:  <xzpk729lnq7.fsf@dwp.des.no> <xzp7jy9lmnf.fsf@dwp.des.no> <20040227230124.D2469@gamplex.bde.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Friday 27 February 2004 07:16 am, Bruce Evans wrote:
> On Thu, 26 Feb 2004, Dag-Erling [iso-8859-1] Sm=F8rgrav wrote:
> > "M. Warner Losh" <imp@bsdimp.com> writes:
> > > How is this different than the sysctl stuff that already exsists for
> > > this and is accessed by devinfo?
> >
> >  1) it is immensely easier to access
> >
> >  2) it gives drivers a well-defined place to put their per-device
> >     sysctl variables - devinfo doesn't address that issue at all
>
> 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.

Note that ioctl's act on dev_t devices, not on device_t devices.  We have t=
wo=20
distinct notions of a device right now: physical hardware devices (new-bus)=
=20
and UNIX file devices (entries in /dev).  You can ioctl the latter, but not=
=20
necessarily the former.

=2D-=20
John Baldwin <john@baldwin.cx>  <><  http://www.baldwin.cx/~john/
"Power Users Use the Power to Serve"  =3D  http://www.FreeBSD.org



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200402271007.43299.john>