*BSD News Article 91853


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!munnari.OZ.AU!news.ecn.uoknor.edu!feed1.news.erols.com!cpk-news-hub1.bbnplanet.com!news.bbnplanet.com!EU.net!Germany.EU.net!Dortmund.Germany.EU.net!interface-business.de!usenet
From: j@ida.interface-business.de (J Wunsch)
Newsgroups: comp.unix.bsd.misc,comp.os.linux.misc
Subject: Re: Linux vs BSD
Date: 24 Mar 1997 11:28:03 GMT
Organization: interface business GmbH, Dresden
Lines: 32
Message-ID: <5h5og3$6qn@innocence.interface-business.de>
References: <32DFFEAB.7704@usa.net> <5d7spf$8n6@web.nmti.com>
  <5d9p55$t1h@news.ox.ac.uk> <5dadfr$cnu@web.nmti.com> <n4stf5.tq2.ln@zen>
  <E6sIEF.1qE@truffula.sj.ca.us> <prlfg5.bs.ln@zen>
  <Pine.NEB.3.95.970316102739.709D-100000@sphynx.fdn.fr>
  <5gjsc9$2cm@innocence.interface-business.de>
  <5gmk83$c9j@rzstud2.rz.uni-karlsruhe.de>
Reply-To: joerg_wunsch@interface-business.de (Joerg Wunsch)
NNTP-Posting-Host: ida.interface-business.de
X-Newsreader: knews 0.9.6
X-Phone: +49-351-31809-14
X-Fax: +49-351-3361187
X-PGP-Fingerprint: DC 47 E6 E4 FF A6 E9 8F  93 21 E0 7D F9 12 D6 4E
Xref: euryale.cc.adfa.oz.au comp.unix.bsd.misc:2877 comp.os.linux.misc:166221

uk1o@rzstud2.rz.uni-karlsruhe.de (Felix Schroeter) wrote:

> >The last thing is that async writes do not have a guaranteed time of
> >completion.

> Under Linux, the close of a block device (e.g. /dev/fd0) blocks until
> all data has been written.

But that isn't portable.  It has the negative side-effect that users
who started on Linux get used to it, and will rely on this feature.
If they later come to another Unix, they might get surprised (and will
certainly claim this other system being buggy even though it ain't).

> Another approach (which should work
> *everywhere*) is to write the data, then fsync() the fd, the close it.
> fsync() is specified to block until the data and all metadata are
> written to disk. (Perhaps it can even report errors!)

I don't think this is portable either.  It's just like with sync(2),
it _initiates_ the writeback, but doesn't wait for completion.  I
might be wrong about this, but that's what my man page says.  Note
that it is silent about completion status.

DESCRIPTION
     Fsync() causes all modified data and attributes of fd to be moved to a
     permanent storage device.  This normally results in all in-core modified
     copies of buffers for the associated file to be written to a disk.

-- 
J"org Wunsch					       Unix support engineer
joerg_wunsch@interface-business.de       http://www.interface-business.de/~j