aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/pmccontrol/pmccontrol.c
diff options
context:
space:
mode:
authorAttilio Rao <attilio@FreeBSD.org>2011-05-10 13:49:34 +0000
committerAttilio Rao <attilio@FreeBSD.org>2011-05-10 13:49:34 +0000
commit7cafb27f94a834682b13159da468deea0d1fefcf (patch)
tree513bc6cc0e2e24c523fbce7cfbc9c01aba192b76 /usr.sbin/pmccontrol/pmccontrol.c
parent7d456f2f3ff3a6896a739077c65b371df4e3761f (diff)
downloadsrc-7cafb27f94a834682b13159da468deea0d1fefcf.tar.gz
src-7cafb27f94a834682b13159da468deea0d1fefcf.zip
Avoid breaking strict-aliasing.
Notes
Notes: svn path=/projects/largeSMP/; revision=221736
Diffstat (limited to 'usr.sbin/pmccontrol/pmccontrol.c')
-rw-r--r--usr.sbin/pmccontrol/pmccontrol.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.sbin/pmccontrol/pmccontrol.c b/usr.sbin/pmccontrol/pmccontrol.c
index 836025b926fc..80d4bd7c3dde 100644
--- a/usr.sbin/pmccontrol/pmccontrol.c
+++ b/usr.sbin/pmccontrol/pmccontrol.c
@@ -141,6 +141,7 @@ pmcc_do_enable_disable(struct pmcc_op_list *op_list)
unsigned char *map;
unsigned char op;
int cpu, pmc;
+ size_t setsize;
if ((ncpu = pmc_ncpu()) < 0)
err(EX_OSERR, "Unable to determine the number of cpus");
@@ -152,8 +153,9 @@ pmcc_do_enable_disable(struct pmcc_op_list *op_list)
"halted");
}
CPU_ZERO(&haltedcpus);
+ setsize = (size_t)cpusetsize;
if (ncpu > 1 && sysctlbyname("machdep.hlt_cpus", &haltedcpus,
- (size_t *)&cpusetsize, NULL, 0) < 0)
+ &setsize, NULL, 0) < 0)
err(EX_OSERR, "ERROR: Cannot determine which CPUs are "
"halted");
CPU_FILL(&cpumask);