This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH,HURD]: Update posix_opt.h
Roland McGrath, le Tue 05 Jan 2010 15:03:50 -0800, a Ãcrit :
> > /* Different Hurd filesystems might do these differently.
> > You must query the particular file with `pathconf' or `fpathconf'. */
> > -#undef _POSIX_CHOWN_RESTRICTED /* Only root can change owner of file? */
> > -#undef _POSIX_NO_TRUNC /* Overlong file names get error? */
> > -#undef _POSIX_SYNC_IO /* File supports O_SYNC et al? */
> > +#define _POSIX_CHOWN_RESTRICTED 0 /* Only root can change owner of file? */
> > +#define _POSIX_NO_TRUNC 0 /* Overlong file names get error? */
> > +#define _POSIX_SYNCHRONIZED_IO 0 /* File supports O_SYNC et al? */
>
> Did the specification for these change? If so, you should change that
> comment too. If not, it is incorrect to #define these since they are not
> in fact system-wide compile-time constants. They are chosen entirely by
> the particular filesystem, so you really have to use pathconf to get the
> true answers.
>From what I understand of the standard, 0 precisely means that:
â 3. Option might or might not be supported at runtime.
The implementation advertises at compile time (by defining the constant in <unistd.h>
with value zero) that the option is supported for compilation and might or might not be
supported at runtime. In this case, the fpathconf(), pathconf(), or sysconf() functions
defined in the System Interfaces volume of POSIX.1-2008 or the getconf utility defined in
the Shell and Utilities volume of POSIX.1-2008 can be used to retrieve the value of each
symbol on each specific implementation to determine whether the option is supported at
runtime.â
I don't see which change you'd like to see in the comments. The way I
understood was the meaning of the option, so a question mark makes
sense.
> > +/* X/Open realtime support is not available. */
> > +#define _XOPEN_REALTIME -1
> > +
> > +/* X/Open thread realtime support is available. */
> ^not
> > +#define _XOPEN_REALTIME_THREADS -1
>
> Why is -1 preferable to #undef for these?
I have seen places assuming that such macros are defined and just check
against -1. It wasn't these macros in particular, however.
Samuel