Skip to content
Snippets Groups Projects
Commit 7344da06 authored by malc's avatar malc
Browse files

Properly initialize len argument of sysctl and include stdio.h (perror)

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6517 c046a42c-6fe2-441c-8c8c-71466251a162
parent 06f7332a
No related branches found
No related tags found
No related merge requests found
......@@ -37,6 +37,7 @@ static void ppc_init_cacheline_sizes(char **envp)
}
#elif defined __APPLE__
#include <stdio.h>
#include <sys/types.h>
#include <sys/sysctl.h>
......@@ -46,6 +47,7 @@ static void ppc_init_cacheline_sizes(void)
unsigned cacheline;
int name[2] = { CTL_HW, HW_CACHELINE };
len = sizeof(cacheline);
if (sysctl(name, 2, &cacheline, &len, NULL, 0)) {
perror("sysctl CTL_HW HW_CACHELINE failed");
} else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment