Module Name: src Committed By: mrg Date: Tue Feb 1 10:45:02 UTC 2022
Modified Files: src/usr.sbin/cpuctl: cpuctl.c Log Message: allow "cpuN" as well as "N" to specific a CPU. update usage to include a change i made from 2015 to allow multiple CPUs to be operated on at the same time for most commands. To generate a diff of this commit: cvs rdiff -u -r1.31 -r1.32 src/usr.sbin/cpuctl/cpuctl.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/usr.sbin/cpuctl/cpuctl.c diff -u src/usr.sbin/cpuctl/cpuctl.c:1.31 src/usr.sbin/cpuctl/cpuctl.c:1.32 --- src/usr.sbin/cpuctl/cpuctl.c:1.31 Tue Apr 21 02:56:37 2020 +++ src/usr.sbin/cpuctl/cpuctl.c Tue Feb 1 10:45:02 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: cpuctl.c,v 1.31 2020/04/21 02:56:37 msaitoh Exp $ */ +/* $NetBSD: cpuctl.c,v 1.32 2022/02/01 10:45:02 mrg Exp $ */ /*- * Copyright (c) 2007, 2008, 2009, 2012, 2015 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #ifndef lint #include <sys/cdefs.h> -__RCSID("$NetBSD: cpuctl.c,v 1.31 2020/04/21 02:56:37 msaitoh Exp $"); +__RCSID("$NetBSD: cpuctl.c,v 1.32 2022/02/01 10:45:02 mrg Exp $"); #endif /* not lint */ #include <sys/param.h> @@ -132,12 +132,12 @@ usage(void) { const char *progname = getprogname(); - fprintf(stderr, "usage: %s identify cpuno\n", progname); + fprintf(stderr, "usage: %s identify cpuno [cpuno ..]\n", progname); fprintf(stderr, " %s list\n", progname); - fprintf(stderr, " %s offline cpuno\n", progname); - fprintf(stderr, " %s online cpuno\n", progname); - fprintf(stderr, " %s intr cpuno\n", progname); - fprintf(stderr, " %s nointr cpuno\n", progname); + fprintf(stderr, " %s offline cpuno [cpuno ..]\n", progname); + fprintf(stderr, " %s online cpuno [cpuno ..]\n", progname); + fprintf(stderr, " %s intr cpuno [cpuno ..]\n", progname); + fprintf(stderr, " %s nointr cpuno [cpuno ..]\n", progname); fprintf(stderr, " %s ucode [cpuno] [file]\n", progname); exit(EXIT_FAILURE); /* NOTREACHED */ @@ -296,6 +296,9 @@ getcpuid(char *arg) u_int id; long np; + if (strncmp(arg, "cpu", 3) == 0) + arg += 3; + id = (u_int)strtoul(arg, &argp, 0); if (*argp != '\0') usage();