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

Bug#119974: Bug confirmed



On Sat, Dec 28, 2002 at 12:07:14PM -0500, H. S. Teoh wrote:
> Hi, I've just tested this bug, and observed something rather interesting:
> 
> % cpp /usr/include/unistd.h |grep fsync
> extern int fsync (int __fd)  ;
> % cpp -D_POSIX_SOURCE /usr/include/unistd.h | grep fsync
> %
> 
> So it gets included in the default header file, but not when _POSIX_SOURCE
> is defined. Now according to a little online research[1], I've found out
> that fsync() was actually NOT part of POSIX.1, but was introduced in
> POSIX.1b.  (There was apparently some controversy surrounding the exact
> semantics of fsync(), which may have played a role in its late
> introduction to POSIX.)

It's guarded by:
#if defined __USE_BSD || defined __USE_XOPEN

_POSIX_SOURCE is:
   _POSIX_SOURCE        IEEE Std 1003.1.
i.e. not 1b.

On the other hand, given:
   _POSIX_C_SOURCE      If ==1, like _POSIX_SOURCE; if >=2 add IEEE Std 1003.2;
                        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.


-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer



Reply to: