[PATCH v1 10/11] perf config: undeclared PATH_MAX due to missing <limits.h> inclusion

From: Ian Rogers

Date: Thu Sep 17 2026 - 00:58:04 EST


Sashiko reported:

When compiling the perf tool against a strict C library such as musl
libc, a build failure occurs in home_perfconfig() and
perf_config__set_variable() due to an undeclared PATH_MAX
identifier.

The PATH_MAX macro is defined in the standard POSIX <limits.h>
header. Because tools/perf/util/config.c does not explicitly
include this header, build environments that lack implicit header
inclusion fail to resolve the identifier. This causes a compiler
error when evaluating the size of stack-allocated path arrays,
stopping the build.

Add the header file.

Reported-by: sashiko-bot@xxxxxxxxxx
Signed-off-by: Ian Rogers <irogers@xxxxxxxxxx>
---
tools/perf/util/config.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/tools/perf/util/config.c b/tools/perf/util/config.c
index b2972c35c1ec..5d0cfd86ede6 100644
--- a/tools/perf/util/config.c
+++ b/tools/perf/util/config.c
@@ -12,6 +12,7 @@
#include "config.h"

#include <errno.h>
+#include <limits.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
--
2.55.0.1082.g2b9226bbc0-goog