[Toybox] toybox debian patch for PATH_MAX.

Rob Landley rob at landley.net
Tue Sep 13 22:52:50 PDT 2022


I'm looking at
https://salsa.debian.org/debian/toybox/-/blob/master/debian/patches/set-pathmax-default.patch
and:

A) Nothing outside of kconfig uses PATH_MAX that I'm aware of?
toys/posix/getconf.c has CONF(PATH_MAX) but that expands to _PC_PATH_MAX which
is an enum value in /usr/include/*/bits/confname.h that resolves to... looks
like 4? Other than that, grep in a clean checkout finds www/code.html saying we
do NOT use PATH_MAX, and the aforementioned kconfig.

2) I'm building on devuan barnacle and it's got PATH_MAX due to...

/usr/include/linux/limits.h:13:2: warning: #warning defining PATH_MAX [-Wcpp]
 #warning defining PATH_MAX
  ^~~~~~~
In file included from /usr/include/x86_64-linux-gnu/bits/local_lim.h:38,
                 from /usr/include/x86_64-linux-gnu/bits/posix1_lim.h:161,
                 from /usr/include/dirent.h:233,
                 from ./toys.h:13,
                 from lib/args.c:10:

I also checked the musl and bionic headers, and both of them define PATH_MAX in
limits.h. (Without which that kconfig build would have broken.)

III) The three kconfig/*.c files you modified all #include "lxc.h" so I can just
add the #ifndef block there once instead of repeating it in many individual files.

If toybox itself needs this it wouldn't go in various *.c files, it would go in
lib/portability.h which is (indirectly) #included from every toybox *.c file.
But... why is it needed? (What breaks if it's not there?)

I commited dea2ace53450 to the repo for kconfig (that whole directory needs to
be replaced, I know), but there's an actual issue in toybox itself, could you be
more specific about what you're seeing?

Thanks,

Rob


More information about the Toybox mailing list