Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1a 12/4/83; site rlgvax.UUCP Path: utzoo!linus!vaxine!wjh12!genrad!grkermit!masscomp!clyde!burl!ulysses!mhuxl!ihnp4!zehntel!hplabs!hao!seismo!rlgvax!guy From: guy@rlgvax.UUCP Newsgroups: net.unix-wizards Subject: Re: Undocumented feature in Sys5: synchronous write Message-ID: <1942@rlgvax.UUCP> Date: Wed, 30-May-84 00:59:07 EDT Article-I.D.: rlgvax.1942 Posted: Wed May 30 00:59:07 1984 Date-Received: Mon, 28-May-84 05:39:55 EDT References: <267@pcsbst.UUCP> Organization: CCI Office Systems Group, Reston, VA Lines: 24 > Normally, writes to normal files are cached in the buffer pool and > written out to disk with some delay. > Some database people asked me to introduce a "write-through" system > call, i.e. a write that writes data immediately to disk, thus avoiding > disk consistency problems after a system crash. Looking at the Sys5 code, > I found that the code for doing this is already there: in > you have > #define FSYNC 00020 > but an appropriate define > #define O_SYNC 00020 > is missing from and also the docu doesn't mention it. Yup. Welcome to the wonderful world of UNIX; a treasure hunt each day. The annoying thing is that some of the stuff are real treasures, but the authors have seen fit to bury them deeply. I suspect this feature was introduced "accidentally"(!); it may have been a side-effect of the changes to the file system code in System V to write file system data structures in a specified order. On the other hand, if somebody felt this wasn't useful enough to applications to finish implementing (i.e., putting in the O_SYNC bit) and documenting, I'd like to know what kind of applications they've ever seen. At least Berkeley documented "fsync". Guy Harris {seismo,ihnp4,allegra}!rlgvax!guy