virProcessSetScheduler() uses not just sched_setscheduler() but
also sched_get_priority_{min,max}(). Currently we assume that
the former being available implies that the latter are as well,
but that's not the case for at least GNU/Hurd.
Make sure all functions are actually available before
attempting to use them.
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
'posix_fallocate',
'posix_memalign',
'prlimit',
+ 'sched_get_priority_min',
'sched_getaffinity',
'sched_setscheduler',
'setgroups',
exit(value);
}
-#if WITH_SCHED_SETSCHEDULER
+#if defined(WITH_SCHED_SETSCHEDULER) && defined(WITH_SCHED_GET_PRIORITY_MIN)
static int
virProcessSchedTranslatePolicy(virProcessSchedPolicy policy)
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,
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: