提交 2b9c1b1b 编写于 作者: R Roman Bogorodskiy 提交者: Peter Krempa

util: FreeBSD: stub out CPU affinity functions

上级 b370cd29
...@@ -168,6 +168,34 @@ realloc: ...@@ -168,6 +168,34 @@ realloc:
return 0; return 0;
} }
#elif defined(__FreeBSD__)
int virProcessInfoSetAffinity(pid_t pid ATTRIBUTE_UNUSED,
virBitmapPtr map)
{
if (!virBitmapIsAllSet(map)) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("setting process affinity isn't supported "
"on FreeBSD yet"));
return -1;
}
return 0;
}
int virProcessInfoGetAffinity(pid_t pid ATTRIBUTE_UNUSED,
virBitmapPtr *map,
int maxcpu)
{
if (!(*map = virBitmapNew(maxcpu))) {
virReportOOMError();
return -1;
}
virBitmapSetAll(*map);
return 0;
}
#else /* HAVE_SCHED_GETAFFINITY */ #else /* HAVE_SCHED_GETAFFINITY */
int virProcessInfoSetAffinity(pid_t pid ATTRIBUTE_UNUSED, int virProcessInfoSetAffinity(pid_t pid ATTRIBUTE_UNUSED,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册