1 1.1 christos /* 2 1.1 christos * POSIX allows PATH_MAX to not be defined, see 3 1.1 christos * http://pubs.opengroup.org/onlinepubs/9699919799/functions/sysconf.html; 4 1.1 christos * the GNU Hurd is an example of a system not having it. 5 1.1 christos * 6 1.1 christos * Arguably, it would be better to test sysconf(_SC_PATH_MAX), 7 1.1 christos * but since the individual *.c files include "config.h" before 8 1.1 christos * <limits.h>, overriding an excessive value of PATH_MAX from 9 1.1 christos * "config.h" is impossible anyway, so for now, the simplest 10 1.1 christos * fix is to provide a value only on systems not having any. 11 1.1 christos * So far, we encountered no system defining PATH_MAX to an 12 1.1 christos * impractically large value, even though POSIX explicitly 13 1.1 christos * allows that. 14 1.1 christos * 15 1.1 christos * The real fix would be to replace all static buffers of size 16 1.1 christos * PATH_MAX by dynamically allocated buffers. But that is 17 1.1 christos * somewhat intrusive because it touches several files and 18 1.1 christos * because it requires changing struct mlink in mandocdb.c. 19 1.1 christos * So i'm postponing that for now. 20 1.1 christos */ 21 1.1 christos 22 1.1 christos #include <limits.h> 23 1.1 christos #include <stdio.h> 24 1.1 christos 25 1.1 christos int 26 1.1 christos main(void) 27 1.1 christos { 28 1.1 christos printf("PATH_MAX is defined to be %ld\n", (long)PATH_MAX); 29 1.1 christos return 0; 30 1.1 christos } 31