Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rutgers!clyde!burl!codas!mtune!mtuxo!houxm!hropus!jrw From: jrw@hropus.UUCP (Jim Webb) Newsgroups: comp.unix.questions,comp.unix.wizards,comp.databases Subject: Re: O_SYNC option in SVR3 open system call Message-ID: <777@hropus.UUCP> Date: Tue, 11-Nov-86 17:18:18 EST Article-I.D.: hropus.777 Posted: Tue Nov 11 17:18:18 1986 Date-Received: Wed, 12-Nov-86 04:52:39 EST References: <5922@gatech.EDU> <9119@sun.uucp> Organization: Bell Labs, Holmdel, NJ Lines: 27 Xref: mnetor comp.unix.questions:18 comp.unix.wizards:30 comp.databases:4 > > O_SYNC When opening a regular file, this flag affects subsequent > > writes. If set, each write (2) will wait for both the file > > data and file status to be physically updated. > > > > Does anybody out there knows if this wait is for real or is the same BSD > > idea of the "fflush" in which blocks are merely "scheduled" and the call > > returns as if they were actually written to the device. > > The wait is for real. And this has been an (albeit undocumented) flag in all vax and 3bx versions of AT&T System V. Not to go into too much detail (my hands would get probably get crushed instead of just slapped ;-) but the kernel has two write routines, one that just schedules the disk block to be written and another that waits for the actually writing before returning. If O_SYNC is set, then the former is called. To find out whether your version of UNIX supports this, grep for SYNC in /usr/include/sys/file.h. That will give you the octal value of the flag, if it is available. Then, I guess to see if the kernel recognizes it, time writes with and without the O_SYNC flag set. The latter writes should be a good bit faster. -- Jim Webb "Out of phase--get help" ...!ihnp4!hropus!jrw "Use the Force, Read the Source"