diff options
author | Paul Smith <psmith@gnu.org> | 2022-10-22 19:42:07 -0400 |
---|---|---|
committer | Paul Smith <psmith@gnu.org> | 2022-10-22 22:40:26 -0400 |
commit | f364e0d8d6e03f1e8bc995641530e4df6598704c (patch) | |
tree | f7700f2873b0c5b1dd5dffbb741c6f5f3ce43f01 /src/makeint.h | |
parent | bb0c05a7f0329dd2ea38021e9c0b9e74e0cdb7de (diff) | |
download | make-git-f364e0d8d6e03f1e8bc995641530e4df6598704c.tar.gz |
Set PATH_MAX on systems without a default value
Some systems (HURD) use fully-dynamic pathnames, with no limit.
We can't support this without significant effort so for now set
PATH_MAX to a large value.
* src/makeint.h: Set PATH_MAX to 4096 if not set and MAXPATHLEN
is also not set. Remove MAXPATHLEN setting: we won't use it.
* src/misc.c (get_path_max): If we can't get the path max via
pathconf() use the default PATH_MAX.
* src/dir.c (find_directory) [W32]: Use MAX_PATH not MAXPATHLEN.
(local_stat) [W32]: Ditto.
* src/job.c (create_batch_file) [W32]: Ditto.
* src/remake.c (name_mtime) [W32]: Ditto.
* src/w32/w32os.c (os_anontmp) [W32]: Ditto.
Diffstat (limited to 'src/makeint.h')
-rw-r--r-- | src/makeint.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/makeint.h b/src/makeint.h index c924b31e..f9de63d0 100644 --- a/src/makeint.h +++ b/src/makeint.h @@ -152,13 +152,14 @@ extern int errno; #endif #ifndef PATH_MAX -# ifndef POSIX +# ifdef MAXPATHLEN # define PATH_MAX MAXPATHLEN +# else +/* Some systems (HURD) have fully dynamic pathnames with no maximum. + Ideally we'd support this but it will take some work. */ +# define PATH_MAX 4096 # endif #endif -#ifndef MAXPATHLEN -# define MAXPATHLEN 1024 -#endif #ifdef PATH_MAX # define GET_PATH_MAX PATH_MAX |