From owner-freebsd-arch@FreeBSD.ORG Fri Feb 27 05:35:45 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E813916A4CE for ; Fri, 27 Feb 2004 05:35:45 -0800 (PST) Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id EEC1B43D1F for ; Fri, 27 Feb 2004 05:35:44 -0800 (PST) (envelope-from phk@phk.freebsd.dk) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.12.11/8.12.11) with ESMTP id i1RDZYQh011617; Fri, 27 Feb 2004 14:35:39 +0100 (CET) (envelope-from phk@phk.freebsd.dk) To: Bruce Evans From: "Poul-Henning Kamp" In-Reply-To: Your message of "Fri, 27 Feb 2004 23:16:09 +1100." <20040227230124.D2469@gamplex.bde.org> Date: Fri, 27 Feb 2004 14:35:33 +0100 Message-ID: <11616.1077888933@critter.freebsd.dk> cc: Dag-Erling =?iso-8859-1?q?Sm=F8rgrav?= cc: arch@freebsd.org Subject: Re: per-device sysctls X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Feb 2004 13:35:46 -0000 In message <20040227230124.D2469@gamplex.bde.org>, Bruce Evans writes: >On Thu, 26 Feb 2004, Dag-Erling [iso-8859-1] Smørgrav wrote: > >> "M. Warner Losh" 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. sysctl is superior for properties that should not be vulnerable to any user who happens to be able to open the device. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence.