[PATCH 1/3] libapi: Add missing header with NAME_MAX define to io_dir.h

Arnaldo Carvalho de Melo posted 3 patches 11 months ago
[PATCH 1/3] libapi: Add missing header with NAME_MAX define to io_dir.h
Posted by Arnaldo Carvalho de Melo 11 months ago
From: Arnaldo Carvalho de Melo <acme@redhat.com>

Most systems get this indirectly, but some odd cases (some musl libc
systems) can't find it, so just add the header where NAME_MAX is defined
to avoid that.

Fixes: d118b08f7eee6d6f ("tools lib api: Add io_dir an allocation free readdir alternative")
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: James Clark <james.clark@linaro.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/lib/api/io_dir.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/lib/api/io_dir.h b/tools/lib/api/io_dir.h
index aab73393d2a217ab..ef83e967e48c59f7 100644
--- a/tools/lib/api/io_dir.h
+++ b/tools/lib/api/io_dir.h
@@ -11,6 +11,7 @@
 #include <unistd.h>
 #include <sys/stat.h>
 #include <sys/syscall.h>
+#include <linux/limits.h>
 
 #if !defined(SYS_getdents64)
 #if defined(__x86_64__) || defined(__arm__)
-- 
2.48.1