Bug 4366 - fsync and POSIX.1-2001
Summary: fsync and POSIX.1-2001
Status: RESOLVED INVALID
Alias: None
Product: glibc
Classification: Unclassified
Component: libc (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Ulrich Drepper
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-04-15 11:37 UTC by Pierre Habouzit
Modified: 2014-07-10 20:33 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:
fweimer: security-


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pierre Habouzit 2007-04-15 11:37:06 UTC
fsync is conforming to POSIX.1-2001 says the manpage (which is correct, I 
checked).

Though compiling code with:

  gcc -ansi -Wall -D_POSIX_SOURCE=1 -D_POSIX_C_SOURCE=20011200 ...

does not enables fsync prototype.
There is a missing guard in unistd.h that says:

  #if defined __USE_BSD || defined __USE_XOPEN                                        

that should be:

  #if defined __USE_BSD || defined __USE_XOPEN || defined __USE_XOPEN2K
Comment 1 Jakub Jelinek 2007-04-15 12:51:15 UTC
AFAIK fsync is just an POSIX option and only mandatory for XSI and Realtime
option group.
Therefore the app IMHO needs to define either -D_XOPEN_SOURCE,
-D_XOPEN_SOURCE=500 or -D_XOPEN_SOURCE=600 and that's where fsync prototype
is available.
Comment 2 Pierre Habouzit 2007-04-15 16:12:35 UTC
Subject: Re:  fsync and POSIX.1-2001

On Sun, Apr 15, 2007 at 11:51:15AM -0000, jakub at redhat dot com wrote:
> 
> ------- Additional Comments From jakub at redhat dot com  2007-04-15 12:51 -------
> AFAIK fsync is just an POSIX option and only mandatory for XSI and Realtime
> option group.
> Therefore the app IMHO needs to define either -D_XOPEN_SOURCE,
> -D_XOPEN_SOURCE=500 or -D_XOPEN_SOURCE=600 and that's where fsync prototype
> is available.

  Oh seems I read the spec too fast, it really seems you're right. You
can close the bug, thanks.

Comment 3 Pierre Habouzit 2007-04-15 16:15:56 UTC
invalid bug