From owner-svn-src-all@FreeBSD.ORG Mon Jan 17 23:36:54 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A0B5106566C; Mon, 17 Jan 2011 23:36:54 +0000 (UTC) (envelope-from mdf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1910D8FC15; Mon, 17 Jan 2011 23:36:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0HNarPo016715; Mon, 17 Jan 2011 23:36:53 GMT (envelope-from mdf@svn.freebsd.org) Received: (from mdf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0HNarV0016712; Mon, 17 Jan 2011 23:36:53 GMT (envelope-from mdf@svn.freebsd.org) Message-Id: <201101172336.p0HNarV0016712@svn.freebsd.org> From: Matthew D Fleming Date: Mon, 17 Jan 2011 23:36:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217521 - head/sbin/sysctl X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jan 2011 23:36:54 -0000 Author: mdf Date: Mon Jan 17 23:36:53 2011 New Revision: 217521 URL: http://svn.freebsd.org/changeset/base/217521 Log: The kernel is not exporting any "T,dev_t" sysctl nodes anymore, so remove the capability and mention from sysctl(8). Modified: head/sbin/sysctl/sysctl.8 head/sbin/sysctl/sysctl.c Modified: head/sbin/sysctl/sysctl.8 ============================================================================== --- head/sbin/sysctl/sysctl.8 Mon Jan 17 23:34:36 2011 (r217520) +++ head/sbin/sysctl/sysctl.8 Mon Jan 17 23:36:53 2011 (r217521) @@ -134,9 +134,7 @@ few bytes. .Pp The information available from .Nm -consists of integers, strings, devices -.Pq Vt dev_t , -and opaque types. +consists of integers, strings, and opaque types. The .Nm utility @@ -165,17 +163,8 @@ For a detailed description of these vari .Pp The changeable column indicates whether a process with appropriate privilege can change the value. -String, integer, and devices values can be set using +String, and integer values can be set using .Nm . -For device values, -.Ar value -can be specified as a character device special file name. -Special values -.Cm off -and -.Cm none -denote -.Dq no device . .Bl -column security.bsd.unprivileged_read_msgbuf integerxxx .It Sy "Name Type Changeable .It "kern.ostype string no @@ -220,7 +209,6 @@ denote .It "hw.floatingpoint integer no .It "hw.machine_arch string no .It "hw.realmem integer no -.It "machdep.console_device dev_t no .It "machdep.adjkerntz integer yes .It "machdep.disable_rtc_set integer yes .It "machdep.guessed_bootdev string no Modified: head/sbin/sysctl/sysctl.c ============================================================================== --- head/sbin/sysctl/sysctl.c Mon Jan 17 23:34:36 2011 (r217520) +++ head/sbin/sysctl/sysctl.c Mon Jan 17 23:36:53 2011 (r217521) @@ -67,7 +67,6 @@ static int show_var(int *, int); static int sysctl_all(int *oid, int len); static int name2oid(char *, int *); -static void set_T_dev_t(char *, void **, size_t *); static int set_IK(const char *, int *); static void @@ -287,10 +286,6 @@ parse(char *string) newsize = sizeof(quadval); break; case CTLTYPE_OPAQUE: - if (strcmp(fmt, "T,dev_t") == 0) { - set_T_dev_t (newval, &newval, &newsize); - break; - } /* FALLTHROUGH */ default: errx(1, "oid '%s' is type %d," @@ -420,40 +415,6 @@ S_vmtotal(int l2, void *p) } static int -T_dev_t(int l2, void *p) -{ - dev_t *d = (dev_t *)p; - - if (l2 != sizeof(*d)) { - warnx("T_dev_T %d != %zu", l2, sizeof(*d)); - return (1); - } - printf("%s", devname(*d, S_IFCHR)); - return (0); -} - -static void -set_T_dev_t(char *path, void **val, size_t *size) -{ - static struct stat statb; - - if (strcmp(path, "none") && strcmp(path, "off")) { - int rc = stat (path, &statb); - if (rc) { - err(1, "cannot stat %s", path); - } - - if (!S_ISCHR(statb.st_mode)) { - errx(1, "must specify a device special file."); - } - } else { - statb.st_rdev = NODEV; - } - *val = (void *) &statb.st_rdev; - *size = sizeof(statb.st_rdev); -} - -static int set_IK(const char *str, int *val) { float temp; @@ -675,7 +636,6 @@ show_var(int *oid, int nlen) free(oval); return (0); - case 'T': case 'S': i = 0; if (strcmp(fmt, "S,clockinfo") == 0) @@ -686,8 +646,6 @@ show_var(int *oid, int nlen) func = S_loadavg; else if (strcmp(fmt, "S,vmtotal") == 0) func = S_vmtotal; - else if (strcmp(fmt, "T,dev_t") == 0) - func = T_dev_t; else func = NULL; if (func) {