Re: NAME_MAX on MingW

2021-03-08 Thread Reuben Thomas
On Mon, 8 Mar 2021 at 10:06, Bruno Haible wrote: > Hi Reuben, > > > Unfortunately, this doesn't help, because pathconf is not present on > mingw. > > Then use some fallback, e.g. 256 or PATH_MAX. > > > So the best I can do is #define _POSIX_ to get the value of NAME_MAX that > > it has. > > Speak

Re: NAME_MAX on MingW

2021-03-08 Thread Bruno Haible
Hi Reuben, > Unfortunately, this doesn't help, because pathconf is not present on mingw. Then use some fallback, e.g. 256 or PATH_MAX. > So the best I can do is #define _POSIX_ to get the value of NAME_MAX that > it has. Speaking for Gnulib, we cannot support _POSIX_ on mingw. This macro modifi

Re: NAME_MAX on MingW

2021-03-08 Thread Bruno Haible
Reuben Thomas wrote: > Having looked into this, it seems that the same issues apply to PATH_MAX, > yet gnulib has a pathmax module to define PATH_MAX. What's different in > that case? Most systems have a PATH_MAX, only the Hurd doesn't. Whereas only few systems have a NAME_MAX (musl libc, Cygwin,

Re: NAME_MAX on MingW

2021-03-08 Thread Reuben Thomas
On Mon, 8 Mar 2021 at 00:16, Reuben Thomas wrote: > On Mon, 8 Mar 2021 at 00:14, Bruno Haible wrote: > >> Hi Reuben, >> >> > NAME_MAX is defined in limits.h. >> >> No. POSIX [1] specifies that it may be omitted from , and >> that pathconf (_PC_NAME_MAX) is the right way to access the maximum >>

Re: NAME_MAX on MingW

2021-03-08 Thread Reuben Thomas
On Mon, 8 Mar 2021 at 00:14, Bruno Haible wrote: > > I don't see anything Gnulib should do here. > Having looked into this, it seems that the same issues apply to PATH_MAX, yet gnulib has a pathmax module to define PATH_MAX. What's different in that case? -- https://rrt.sc3d.org

Re: NAME_MAX on MingW

2021-03-07 Thread Reuben Thomas
On Mon, 8 Mar 2021 at 00:14, Bruno Haible wrote: > Hi Reuben, > > > NAME_MAX is defined in limits.h. > > No. POSIX [1] specifies that it may be omitted from , and > that pathconf (_PC_NAME_MAX) is the right way to access the maximum > length of a file name component. [2] > Ah, thanks for setting

Re: NAME_MAX on MingW

2021-03-07 Thread Bruno Haible
Hi Reuben, > NAME_MAX is defined in limits.h. No. POSIX [1] specifies that it may be omitted from , and that pathconf (_PC_NAME_MAX) is the right way to access the maximum length of a file name component. [2] > So my question is: is there something gnulib can/should do here? I don't see anythin

NAME_MAX on MingW

2021-03-07 Thread Reuben Thomas
NAME_MAX is defined in limits.h. And indeed it is there on Mingw, but guarded by the Windows-specific non-standard macro _POSIX_. I found this suggestion that Windows system headers have not used _POSIX_ since MSVC 2013: https://sourceforge.net/p/mingw-w64/mailman/message/33014416/ However, the