From owner-acpi-jp@jp.FreeBSD.org Thu Jan  1 07:21:10 2004
Received: (from daemon@localhost)
	by castle.jp.FreeBSD.org (8.11.6p2+3.4W/8.11.3) id hBVMLAB28336;
	Thu, 1 Jan 2004 07:21:10 +0900 (JST)
	(envelope-from owner-acpi-jp@jp.FreeBSD.org)
Received: from smtpout.mac.com (smtpout.mac.com [17.250.248.84])
	by castle.jp.FreeBSD.org (8.11.6p2+3.4W/8.11.3) with ESMTP/inet id hBVML9C28330
	for <acpi-jp@jp.FreeBSD.org>; Thu, 1 Jan 2004 07:21:09 +0900 (JST)
	(envelope-from DrZiplok@mac.com)
Received: from mac.com (smtpin08-en2 [10.13.10.153])
	by smtpout.mac.com (8.12.6/MantshX 2.0) with ESMTP id hBVML7OJ027946
	for <acpi-jp@jp.FreeBSD.org>; Wed, 31 Dec 2003 14:21:08 -0800 (PST)
Received: from [192.168.0.100] (c-24-7-66-113.client.comcast.net [24.7.66.113])
	(authenticated bits=0)
	by mac.com (Xserve/smtpin08/MantshX 3.0) with ESMTP id hBVML78v002922
	for <acpi-jp@jp.FreeBSD.org>; Wed, 31 Dec 2003 14:21:07 -0800 (PST)
Mime-Version: 1.0 (Apple Message framework v609)
In-Reply-To: <20031231195702.GF751@hermes.home.paeps.cx>
References: <20031212114100.GC659@hermes.nixsys.be> <20031212171121.M54374@root.org> <20031215073539.GB685@hermes.nixsys.be> <20031231113238.A2478@root.org> <20031231195702.GF751@hermes.home.paeps.cx>
Content-Type: text/plain; charset=US-ASCII; format=flowed
Message-Id: <9FDA83CC-3BDF-11D8-AE15-000393C72BD6@mac.com>
Content-Transfer-Encoding: 7bit
From: Michael Smith <DrZiplok@mac.com>
To: acpi-jp@jp.FreeBSD.org
X-Mailer: Apple Mail (2.609)
Reply-To: acpi-jp@jp.FreeBSD.org
Precedence: list
Date: Wed, 31 Dec 2003 14:21:05 -0800
X-Sequence: acpi-jp 2957
Subject: [acpi-jp 2957] Re: [patch] Thermal ioctls?
Sender: owner-acpi-jp@jp.FreeBSD.org
X-Originator: DrZiplok@mac.com
X-Distribute: distribute version 2.1 (Alpha) patchlevel 24e+031216


On Dec 31, 2003, at 11:57 AM, Philip Paeps wrote:

>>> [Aside: is there any reason for prefering sysctl over ioctl?  I have
>>> nothing against either of them, but I notice sysctl getting very
>>> popular...]
>>
>> My approach is: sysctls for user control, ioctls for program control.
>
> Sounds logical.

Completely wrong, though.

ioctls are appropriate as a control channel for file descriptors.  If 
you
have something that's normally opened and treated like a file, you tend
to use ioctl against the same file descriptor to control it.

If there's no file descriptor involved, ioctl is not the right 
approach; sysctl
is the catchall that you should use in that case.  The structured 
namespace
is superior in most regards anyway.

  = Mike

