summaryrefslogtreecommitdiff
path: root/tools/include/nolibc
diff options
context:
space:
mode:
authorWilly Tarreau <w@1wt.eu>2022-02-07 19:23:46 +0300
committerPaul E. McKenney <paulmck@kernel.org>2022-04-21 03:05:45 +0300
commit023033fe343cdf2ba83ab762f8de69241c7fc086 (patch)
treee674d3cb74d7ae7bf766cbc4210138f49027ea21 /tools/include/nolibc
parentdffeb81af5fe5eedccf5ea4a8a120d8c3accd26e (diff)
downloadlinux-023033fe343cdf2ba83ab762f8de69241c7fc086.tar.xz
tools/nolibc/types: define PATH_MAX and MAXPATHLEN
These ones are often used and commonly set by applications to fallback values. Let's fix them both to agree on PATH_MAX=4096 by default, as is already present in linux/limits.h. Signed-off-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Diffstat (limited to 'tools/include/nolibc')
-rw-r--r--tools/include/nolibc/types.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/tools/include/nolibc/types.h b/tools/include/nolibc/types.h
index e0749dc0bd06..e4026e740b56 100644
--- a/tools/include/nolibc/types.h
+++ b/tools/include/nolibc/types.h
@@ -49,6 +49,17 @@
#define FD_SETSIZE 256
#endif
+/* PATH_MAX and MAXPATHLEN are often used and found with plenty of different
+ * values.
+ */
+#ifndef PATH_MAX
+#define PATH_MAX 4096
+#endif
+
+#ifndef MAXPATHLEN
+#define MAXPATHLEN (PATH_MAX)
+#endif
+
/* Special FD used by all the *at functions */
#ifndef AT_FDCWD
#define AT_FDCWD (-100)