diff --git a/meson.build b/meson.build index 31d02e5b67..740f62d484 100644 --- a/meson.build +++ b/meson.build @@ -584,6 +584,7 @@ functions = [ 'posix_fallocate', 'posix_memalign', 'prlimit', + 'sched_get_priority_min', 'sched_getaffinity', 'sched_setscheduler', 'setgroups', diff --git a/src/util/virprocess.c b/src/util/virprocess.c index 8e4440b45f..5cdf3e3eb9 100644 --- a/src/util/virprocess.c +++ b/src/util/virprocess.c @@ -1573,7 +1573,7 @@ virProcessExitWithStatus(int status) exit(value); } -#if WITH_SCHED_SETSCHEDULER +#if defined(WITH_SCHED_SETSCHEDULER) && defined(WITH_SCHED_GET_PRIORITY_MIN) static int virProcessSchedTranslatePolicy(virProcessSchedPolicy policy) @@ -1667,7 +1667,7 @@ virProcessSetScheduler(pid_t pid, return 0; } -#else /* ! WITH_SCHED_SETSCHEDULER */ +#else /* ! (defined(WITH_SCHED_SETSCHEDULER) && defined(WITH_SCHED_GET_PRIORITY_MIN)) */ int virProcessSetScheduler(pid_t pid G_GNUC_UNUSED, @@ -1682,7 +1682,7 @@ virProcessSetScheduler(pid_t pid G_GNUC_UNUSED, return -1; } -#endif /* !WITH_SCHED_SETSCHEDULER */ +#endif /* ! (defined(WITH_SCHED_SETSCHEDULER) && defined(WITH_SCHED_GET_PRIORITY_MIN)) */ /* * Get all stat fields for a process based on pid and tid: