svn commit: r217521 - head/sbin/sysctl

Matthew D Fleming mdf at FreeBSD.org
Mon Jan 17 23:36:54 UTC 2011


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) {


More information about the svn-src-head mailing list