On 28/Feb - 07:18, Jérémie Dimino wrote:
> >  #define stat64 stat
> >  #define lstat64 lstat
> >  #define fstat64 fstat
> >  #endif
> >  
> > +#if defined(__NetBSD__)
> > +#define FNM_FILE_NAME FNM_PATHNAME
> > +#define _XOPEN_UNIX 1
> 
> what does `_XOPEN_UNIX` do on NetBSD?
> 
>     $ uname -a
>     NetBSD 5.1.2 ...
>     $ grep -r _XOPEN_UNIX /usr/include
>     <nothing>
> 
> It seems to be ignored?

Maybe the commit log is not clear. 

_XOPEN_UNIX is not defined on NetBSD but core checks this flag to compile
or not the function unix_create_error_checking_mutex (lib/unix_stubs.c:1132).

As NetBSD has all the code needed to compile properly
unix_create_error_checking_mutex, I just set _XOPEN_UNIX to 1 to be sure
that unix_create_error_checking_mutex is compiled properly. So it does
not have any impact on NetBSD includes, only on the code compiled in
unix_stubs.c .

Moreover, as said in the commit log, I think the check on _XOPEN_UNIX is
too strong, I think a test on

 #defined(_POSIX_THREADS) && _POSIX_THREADS >= 200112L

seems sufficient to make unix_create_error_checking_mutex works
properly.

Best regards,
-- 
Arnaud Degroote
Postdoc
RIA LAAS - CNRS