summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEduard Zingerman <eddyz87@gmail.com>2025-06-18 02:31:34 -0700
committerAlexei Starovoitov <ast@kernel.org>2025-06-18 06:52:07 -0700
commitcd7312a78f36e981939abe1cd1f21d355e083dfe (patch)
treee4afa400dd232b51a07c9fd80e2a4ceb795929e2
parentbd07bd12f2c17d3e13d58c09f5eac5d021ec14ea (diff)
selftests/bpf: include limits.h needed for PATH_MAX directly
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>
-rw-r--r--tools/testing/selftests/bpf/unpriv_helpers.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/testing/selftests/bpf/unpriv_helpers.c b/tools/testing/selftests/bpf/unpriv_helpers.c
index 3aa9ee80a55e..f997d7ec8fd0 100644
--- a/tools/testing/selftests/bpf/unpriv_helpers.c
+++ b/tools/testing/selftests/bpf/unpriv_helpers.c
@@ -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>