diff --git a/meson.build b/meson.build index 9022bcfdc9..e4f36e8574 100644 --- a/meson.build +++ b/meson.build @@ -553,7 +553,6 @@ functions = [ 'posix_fallocate', 'posix_memalign', 'prlimit', - 'sched_getaffinity', 'sched_setscheduler', 'setgroups', 'setns', @@ -602,6 +601,7 @@ headers = [ 'net/if.h', 'pty.h', 'pwd.h', + 'sched.h', 'sys/auxv.h', 'sys/ioctl.h', 'sys/mount.h', @@ -671,6 +671,8 @@ symbols = [ # Check for BSD approach for setting MAC addr [ 'net/if_dl.h', 'link_addr', '#include \n#include ' ], + + [ 'sched.h', 'cpu_set_t' ], ] if host_machine.system() == 'linux' diff --git a/src/util/virprocess.c b/src/util/virprocess.c index 6de3f36f52..81de90200e 100644 --- a/src/util/virprocess.c +++ b/src/util/virprocess.c @@ -35,7 +35,7 @@ # include # include #endif -#if WITH_SCHED_SETSCHEDULER +#if WITH_SCHED_H # include #endif @@ -480,7 +480,7 @@ int virProcessKillPainfully(pid_t pid, bool force) return virProcessKillPainfullyDelay(pid, force, 0, false); } -#if WITH_SCHED_GETAFFINITY +#if WITH_DECL_CPU_SET_T int virProcessSetAffinity(pid_t pid, virBitmap *map, bool quiet) { @@ -626,7 +626,7 @@ virProcessGetAffinity(pid_t pid) return ret; } -#else /* WITH_SCHED_GETAFFINITY */ +#else /* WITH_DECL_CPU_SET_T */ int virProcessSetAffinity(pid_t pid G_GNUC_UNUSED, virBitmap *map G_GNUC_UNUSED, @@ -646,7 +646,7 @@ virProcessGetAffinity(pid_t pid G_GNUC_UNUSED) _("Process CPU affinity is not supported on this platform")); return NULL; } -#endif /* WITH_SCHED_GETAFFINITY */ +#endif /* WITH_DECL_CPU_SET_T */ int virProcessGetPids(pid_t pid, size_t *npids, pid_t **pids)