]> git.kaiwu.me - haproxy.git/commitdiff
BUILD: fd: Make sure to include sched.h
authorOlivier Houchard <ohouchard@haproxy.com>
Tue, 8 Sep 2026 14:00:18 +0000 (16:00 +0200)
committerOlivier Houchard <cognet@ci0.org>
Tue, 8 Sep 2026 13:50:58 +0000 (15:50 +0200)
Commit 5e9662ddd63a730235deec27489c7e8897fea21d made it so that instead
of checking for the existence of CLONE_FILES, we'd define
HA_HAVE_UNSHARE if file unsharing is available. To determine that, it
checks for the existence of CLONE_FILES, however without including
sched.h, it will never be defined, and file unsharing will never be
used.
Fix that by properly including sched.h.

include/haproxy/compat.h

index 1f486835d7653acc86e70b9409a329a273199ac6..2d76ffb49956b7bf8c0a249d91b1f30a7a94e35e 100644 (file)
 #include <limits.h>
 #include <unistd.h>
 #include <fcntl.h>
+/* for CLONE_FILES, tested by HA_HAVE_UNSHARE below */
+#ifdef _POSIX_PRIORITY_SCHEDULING
+#include <sched.h>
+#endif
 /* This is needed on Linux for Netfilter includes */
 #include <sys/param.h>
 #include <sys/types.h>