Posix.sync

Manuel M. T. Chakravarty chak@cse.unsw.edu.au
Tue, 20 Nov 2001 12:04:47 +1100


"Max A . K ." <max630@mail.ru> wrote,

> On Mon, Nov 19, 2001 at 10:14:02AM -0800, Sigbjorn Finne wrote:
> > I think that's a reasonable request, but the reason that
> > it isn't in there already is that the Posix library implements
> > just POSIX 1003.1a (1990), not also 1003.1b (1993),
> > which is when the (so-called) real-time/POSIX.4 extensions
> > (incl O_SYNC)  were introduced.
> 
> I see. 
> 
> > Rather than patching the Posix library to include stuff like
> > O_SYNC, I'd like to see a Haskell binding to the Single
> > UNIX (aka Unix98) instead - it subsumes the
> > POSIX.1 APIs (and you can get at the specs without having
> > to pay the extortionate rates that IEEE charges). Feel free
> > to contribute such a binding!
> 
> I'm afraid I will not. There is pretty huge number of
> functions to bind, and I'm afraid to miss some. Then I'm not
> wery good Haskeller.
> 
> Moreover, I could not see the Single Unix features in the
> linux-2.2 (at least that nice O_DSYNC flag). Maybe they are
> presented in 2.4, but I have no plan to use it.

AFAIK no OS implements all of the Single Unix specification.
Nevertheless, I think, Sigbjorn is right.  Ideally, we
should have a binding for Single Unix and on any particular
OS, you will have a subset of it available (that's the same
situation as you have with any other programming language).

As is pointed out in the open(2) man page, O_SYNC, O_DSYNC,
and O_RSYNC are synonymous in Linux 2.2.  In 2.4, at least
with some file systems (eg, XFS) you can choose which
behaviour O_SYNC should have.

Cheers,
Manuel