Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.sbin/cpuctl allow "cpuN" as well as "N" to specific a CPU.
details: https://anonhg.NetBSD.org/src/rev/29fe443b0844
branches: trunk
changeset: 359941:29fe443b0844
user: mrg <mrg%NetBSD.org@localhost>
date: Tue Feb 01 10:45:02 2022 +0000
description:
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.
diffstat:
usr.sbin/cpuctl/cpuctl.c | 17 ++++++++++-------
1 files changed, 10 insertions(+), 7 deletions(-)
diffs (46 lines):
diff -r 1e49fcf573df -r 29fe443b0844 usr.sbin/cpuctl/cpuctl.c
--- a/usr.sbin/cpuctl/cpuctl.c Tue Feb 01 09:18:07 2022 +0000
+++ b/usr.sbin/cpuctl/cpuctl.c Tue Feb 01 10:45:02 2022 +0000
@@ -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 @@
{
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 @@
u_int id;
long np;
+ if (strncmp(arg, "cpu", 3) == 0)
+ arg += 3;
+
id = (u_int)strtoul(arg, &argp, 0);
if (*argp != '\0')
usage();
Home |
Main Index |
Thread Index |
Old Index