OS: SCO OpenServer 5.0.7 using gcc 2.95.3p4 client/client.c:3000:'PATH_MAX' undeclared. This is related to bug 3746. In SCO OpenServer 5, PATH_MAX is undefined in limits.h. Below is the relevant part of limits.h: -------------------- /* * The following are not defined since the value can vary according * to the file referred to. * * In all cases, pathconf should be checked to find the actual value for * a particular file. * * LINK_MAX _PC_LINK_MAX _POSIX_LINK_MAX * NAME_MAX _PC_NAME_MAX PATHSIZE * PATH_MAX _PC_PATH_MAX PATHSIZE * PIPE_BUF _PC_PIPE_BUF _POSIX_PIPE_BUF * * A similar rationale applies to the following cross compatibility values. * * MAXPATHLEN (from 4.2 BSD params.h) */ /* * It is arguable whether these should be defined even in _IBCS2 mode since * the defintions are WRONG on recent SCO OS's and pathconf should be * used instead */ #ifdef _IBCS2 #define LINK_MAX 1000 #define PATH_MAX 256 #define PIPE_BUF 5120 #endif /* _IBCS2 */ -------------------- The recommended solution is to use pathconf to find this value. Alternatively, you could use _POSIX_PATH_MAX since that is defined as 255 but that could be too restrictive. A workaround to get this compiled is: make FLAGS2="-DPATH_MAX=_POSIX_PATH_MAX" But then I got utils/smbget.c:118:'MAXPATHLEN' undeclared. As you can see from the part of limits.h extracted above, that is also deliberately undefined. Adding -DMAXPATHLEN=_POSIX_PATH_MAX would probably work here too but it is time to go home. Thanks Larry Manulak Programmer Omega Computer Services Ltd.
This seems to be the same as bug 4008 (Compile error in client/client.c when building for SCO OSR 5). I think I have provided additional informatiion about why it happens.
This appears to be similar to bug 2560 where it showed up in 3.0.13 in smbd/vfs.c and appeared to have been solved by 3.0.14a. It reappears here in client.c (is that new code?).
Fixed in Samba 3.4 by commit 2b3c44e4fb980335c22abcc07a88f32b13e5918f Author: Jeremy Allison <jra@samba.org> Date: Sat Nov 10 22:31:34 2007 -0800 Always define PATH_MAX. Makes code simpler (removes a bunch of #defines). Remove pstring from msdfs.c. Jeremy. (This used to be commit e203ba22275320808bc11b17361ad1f2d5b0b897)