OS: SCO OpenServer 5.0.7 using gcc 2.95.3p4
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
#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:
But then I got
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.
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
Author: Jeremy Allison <firstname.lastname@example.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.
(This used to be commit e203ba22275320808bc11b17361ad1f2d5b0b897)