提交 7344da06 编写于 作者: M malc

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
上级 06f7332a
......@@ -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 {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册