home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!haven.umd.edu!darwin.sura.net!mips!swrinde!elroy.jpl.nasa.gov!ames!ncar!destroyer!sol.ctr.columbia.edu!The-Star.honeywell.com!umn.edu!math.fu-berlin.de!unidui!flyer!easix!umunk!udo
- From: udo@umunk.GUN.de (Udo Munk)
- Newsgroups: comp.unix.questions
- Subject: Re: reliable write()
- Message-ID: <9208141294@umunk.GUN.de>
- Date: 14 Aug 92 20:04:33 GMT
- References: <14001@auspex-gw.auspex.com>
- Organization: umunk (private)
- Lines: 29
- X-Newsreader: Tin 1.1 PL4
-
- guy@Auspex.COM (Guy Harris) writes:
- : >Once in the
- : >kernel, however, you have no way of knowing when the write to disk
- : >will occur.
- :
- : True by default, but *some* flavors of UNIX, as noted, have one of two
- : mechanisms to give greater control over when the write to disk will
- : occur:
- :
- : 1) O_SYNC - a file descriptor mode bit that can be set when the
- : file is opened (by including O_SYNC in the open mode) or
- : after it's opened (with "fcntl()"); if set, all writes are
- : supposed to go immediately to some flavor of permanent
- : storage (e.g., disk).
- :
- : 2) "fsync()" - a call that can be performed on a file descriptor
- : to flush all file data to permanent storage.
- :
- : Some flavors of UNIX have O_SYNC, some have "fsync()", some have both,
- : some have neither.
-
- What about calling system("sync"); after a flush of the buffers for
- systems which have neighter?
- --
- Udo Munk | voice: +49 2131 275348 | uucp: +49 2131 278869
- Oberstr. 21 | mail : udo@umunk.GUN.de | 2400/1200/300 8N1
- 4040 Neuss 1 | ...!{mcshh,smurf,unido}!easix!umunk!udo | MYNAME=bbsuser
- Fed. Rep. of | CompuServe: 100021,2515 | login: uucp
- Germany | at first connect get ~/info and ~/files| pwd: public
-