提交 3c37a171 编写于 作者: D Daniel P. Berrange

Add check for kill() to fix build of cgroups on win32

The kill() function doesn't exist on Win32, so it needs to be
checked for at build time & code disabled in cgroups

* configure.ac: Check for kill()
* src/util/cgroup.c: Stub out virCGroupKill* functions
  when kill() isn't available
上级 3ee7cf6c
......@@ -120,7 +120,7 @@ AC_MSG_RESULT([$have_cpuid])
dnl Availability of various common functions (non-fatal if missing),
dnl and various less common threadsafe functions
AC_CHECK_FUNCS_ONCE([cfmakeraw regexec sched_getaffinity getuid getgid \
initgroups posix_fallocate mmap \
initgroups posix_fallocate mmap kill \
getmntent_r getgrnam_r getpwuid_r])
dnl Availability of pthread functions (if missing, win32 threading is
......
......@@ -1307,6 +1307,8 @@ int virCgroupGetFreezerState(virCgroupPtr group, char **state)
"freezer.state", state);
}
#ifdef HAVE_KILL
static int virCgroupKillInternal(virCgroupPtr group, int signum, virHashTablePtr pids)
{
int rc;
......@@ -1520,3 +1522,21 @@ int virCgroupKillPainfully(virCgroupPtr group)
VIR_DEBUG("Complete %d", rc);
return rc;
}
#else /* HAVE_KILL */
int virCgroupKill(virCgroupPtr group ATTRIBUTE_UNUSED,
int signum ATTRIBUTE_UNUSED)
{
return -ENOSYS;
}
int virCgroupKillRecursive(virCgroupPtr group ATTRIBUTE_UNUSED,
int signum ATTRIBUTE_UNUSED)
{
return -ENOSYS;
}
int virCgroupKillPainfully(virCgroupPtr group ATTRIBUTE_UNUSED)
{
return -ENOSYS;
}
#endif /* HAVE_KILL */
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册