diff --git a/sbin/sysctl/sysctl.8 b/sbin/sysctl/sysctl.8 index 1f5c8e6af773..dbdf18716483 100644 --- a/sbin/sysctl/sysctl.8 +++ b/sbin/sysctl/sysctl.8 @@ -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 variable see .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 diff --git a/sbin/sysctl/sysctl.c b/sbin/sysctl/sysctl.c index 93ff8c62ecf7..de37c8b20254 100644 --- a/sbin/sysctl/sysctl.c +++ b/sbin/sysctl/sysctl.c @@ -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," @@ -419,40 +414,6 @@ S_vmtotal(int l2, void *p) return (0); } -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) { @@ -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) {