]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
selftests/bpf: include limits.h needed for PATH_MAX directly
authorEduard Zingerman <eddyz87@gmail.com>
Wed, 18 Jun 2025 09:31:34 +0000 (02:31 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Wed, 18 Jun 2025 13:52:07 +0000 (06:52 -0700)
Constant PATH_MAX is used in function unpriv_helpers.c:open_config().
This constant is provided by include file <limits.h>.
The dependency was added by commit [1], which does not include
<limits.h> directly, relying instead on <limits.h> being included from
zlib.h -> zconf.h.
As it turns out, this is not the case for all systems, e.g. on
Fedora 41 zlib 1.3.1 is used, and there <limits.h> is not included
from zconf.h. Hence, there is a compilation error on Fedora 41.

[1] commit fc2915bb8bfc ("selftests/bpf: More precise cpu_mitigations state detection")

Fixes: fc2915bb8bfc ("selftests/bpf: More precise cpu_mitigations state detection")
Signed-off-by: Eduard Zingerman <eddyz87@gmail.com>
Acked-by: Viktor Malik <vmalik@redhat.com>
Link: https://lore.kernel.org/r/20250618093134.3078870-1-eddyz87@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/unpriv_helpers.c

index 3aa9ee80a55e4d9c5bcbe549b47e4ee2e64e6d27..f997d7ec8fd08651e9ca9393e711f6f94610b624 100644 (file)
@@ -1,6 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0-only
 
 #include <errno.h>
+#include <limits.h>
 #include <stdbool.h>
 #include <stdlib.h>
 #include <stdio.h>