[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#119974: Bug confirmed



Hi, I'm the original submitter.  I changed email address and reopened
the bug report so the BTS knows about it.  Please, always send mail to
119974-submitter@bugs.debian.org, instead of the original address, so
the BTS takes care to email the submitter's current address (plus the
bug report log, so you don't need to CC 119974@bugs.debian.org).

As for the bug, I'll try to clarify a pair of issues below:

> > It's guarded by:
> > #if defined __USE_BSD || defined __USE_XOPEN
> >
> > _POSIX_SOURCE is:
> >    _POSIX_SOURCE        IEEE Std 1003.1.
> > i.e. not 1b.
>
> Ahh, that explains it.
>
> > On the other hand, given:
> >    _POSIX_C_SOURCE      If ==1, like _POSIX_SOURCE; if >=2 add IEEE Std 1003
> >                         if >=199309L, add IEEE Std 1003.1b-1993;
> >                         if >=199506L, add IEEE Std 1003.1c-1995
> >
> > but _POSIX_C_SOURCE=199309 is not enough to turn on the prototype of
> > fsync... so there is a problem, but _POSIX_SOURCE is behaving as
> > intended.
> [snip]
>
> Wow, this is a messier tangle than I previously thought. :-)
>
> Is any of this documented anywhere? I think the original bug submitter
> filed the bug because according to his understanding of the
> documentation,
> fsync *should* be included when _POSIX_SOURCE is defined. The manpage
> *does* mention POSIX.1b; so if what you describe above is actually
> documented somewhere, then the submitter should be referred to it, and the
> bug should be closed.

Yes, I was aware of it; and no, I did not file the bug because it's not
included when _POSIX_SOURCE is defined, but because it never gets
included (whatever number you define it as) unless you also define the
BSD or X/OPEN test macros.  In fact, my report was a bit vague because
I was confused by the documentation.  The glibc info documentation just
says POSIX on its Summary of Library Facilities (announced as
Library Summary from the top level index):

`int fsync (int FILDES)'
     `unistd.h' (POSIX):  *Note Synchronizing I/O::.

Just saying POSIX does not tell you if its POSIX.1 or POSIX.1b.  Given
the current messy use of test macros, it would be natural to think POSIX
refers to whatever _POSIX_SOURCE buys you by default (POSIX.1);
otherwise the manual page would state clearly the standard revision so
you could define the test macro to the appropiate number.  On the other
hand, the fsync(2) manual page (which I had read) clearly labels fsync()
as POSIX.1b, so I was a bit confused for the precise revision, but it is
clearly a POSIX function.

I just reported that, as unistd.h guards the function prototype, you
must ask for BSD or X/OPEN functionality to get it included.  Asking
only for POSIX (whatever revision you ask for, including the most current
one) does not include the function prototype, and so it's a bug on
glibc's headers.  This bug report is just about the test-macros bug; now,
if someone confirms that fsync() is from POSIX.1b then (s)he must file a
bug to the glibc documentation so it no longer documents fsync() as POSIX
but POSIX.1b.

I know I didn't express too well previously; just hope it's now clear.



Reply to: