Path: utzoo!attcan!uunet!husc6!cmcl2!nrl-cmf!ames!zodiac!joyce!sri-unix!quintus!ok From: ok@quintus.uucp (Richard A. O'Keefe) Newsgroups: comp.databases Subject: ensuring output has reached the disc (was Oracle wars) Keywords: O_SYNC, fsync, SunOS 3.x Message-ID: <179@quintus.UUCP> Date: 20 Jul 88 21:23:13 GMT References: <5165@dasys1.UUCP> <8208@ncoast.UUCP> <178@turbo.oracle.UUCP> <180@turbo.oracle.UUCP> <302@infmx.UUCP> Sender: news@quintus.UUCP Reply-To: ok@quintus.UUCP (Richard A. O'Keefe) Organization: Quintus Computer Systems, Inc. Lines: 34 In article <302@infmx.UUCP> aland@infmx.UUCP (Alan S. Denney @ Informix) writes: >The funniest thing is that they choose the Suns to run their benchmarks. >Sun 3.X machines DO NOT SUPPORT synchronous writes anyway (no O_SYNC flag >here, folks), so any claim that their benchmarks are hurt by "integrity >issues" on these machines is BOGUS. The only way to force i/o is to use >raw devices; Oracle decries raw devices as being "complex" in their current >ad. (If my understanding of Sun 3.X synchronicity is wrong, I will post >a followup and apology. I confirmed this with a friend at Sun about a month >ago). The current ads do *not* indicate that this integrity claim >applies only to certain (e.g SVR2+) ports, that I recall. I'm using SunOS 3.2. A quick "grep" through /usr/include/*/*.h confirmed the absence of an O_SYNC flag. But "man -k sync" turned up fsync (2) - synchronize a file's in-core state with that on disk and "man 2 fsync" says that fsync(fd) fsync moves all modified data and attributes of fd to a per- manent storage device: all in-core modified copies of buffers for the associated file have been written to a disk when the call returns. Note that this is different than sync(2) which schedules disk I/O for all files (as though an fsync had been done on all files) but returns before the I/O completes. fsync should be used by programs which require a file to be in a known state; for example, a program which contains a simple transaction facility might use it to ensure that all modifications to a file or files caused by a transaction were recorded on disk. [Sun Release 3.2 Last Change: 16 July 1986] ^^^^^^^^^^^^ This appears to claim that the changed information has actually been written on the disc, not merely scheduled for writing. What more do you want, exactly?