Subject: Re: O_SYNC vs. O_FSYNC
To: Ted Lemon <mellon@fugue.com>
From: Chris G Demetriou <Chris_G_Demetriou@LAGAVULIN.PDL.CS.CMU.EDU>
List: tech-userlevel
Date: 05/28/1995 02:27:14
> While we're talking about third party applications and header file
> compatibility, does anybody know why SunOS uses O_SYNC as its flag to
> tell the kernel to do synchronous writes, while NetBSD, BSD/OS and
> probably 4.4BSD use O_FSYNC?
> 
> This particular bugaboo is preventing Kerberos 5 from building on
> NetBSD/pmax and NetBSD/i386.   I can obviously add hacks to the
> configure tree for Kerberos 5 to conditionalize the use of O_SYNC
> vs. O_FSYNC, but this will be a good deal more work than simply
> changing the header file.
> 
> Is O_FSYNC in the POSIX spec or something?

M-x find-and-open-can-of-worms

I don't have a 1003.1 spec, but i DO have a 1003.1B spec (which is
1003.1 with the "Real Time Extensions" from 1003.4 folded in).

It has a bunch of flags that talk about synchronization:

	O_SYNC		complete sync, including update times, etc.

	O_DSYNC		sync writes, "random" stuff like update/access
			times needn't be updated synchronously.

	O_RSYNC		sync reads(?).  from what i can tell: don't
			return a value until you know the state of the
			data, apply pending writes before returning
			read data. (seems that this is normal for
			UFS's...  i'm not quite sure i understand
			all P.1b implies...)

>From looking at the changebars, and whatnot, it appears that these
were added in .1B.  I'm not sure if they're conditionally defined,
based on a compile-time symbolic constant
(e.g. _POSIX_SYNCHRONIZED_IO), but it doesn't look like they are...


chris