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
This commit is contained in:
Daniel P. Berrange 2011-02-28 14:13:58 +00:00
parent 3ee7cf6c9b
commit 3c37a171a2
2 changed files with 21 additions and 1 deletions

View File

@ -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

View File

@ -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 */