Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Rainer Weikusat Newsgroups: comp.os.linux.development.apps Subject: Re: mkdir() and thread safety() Date: Thu, 31 Mar 2011 11:17:09 +0100 Lines: 19 Message-ID: <87pqp7tx0a.fsf@sapphire.mobileactivedefense.com> References: <9d56213c-a054-428e-866c-559da29fbbc3@o21g2000prh.googlegroups.com> <2d58ece6-bb9c-42e0-a990-fc13b92723ec@a21g2000prj.googlegroups.com> <87oc4vtn8o.fsf@sapphire.mobileactivedefense.com> <87lizwjln1.fsf@araminta.anjou.terraraq.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: individual.net HQOhP1hf4h80Xb1f/U89wgvRMfeI9u3siVGGkr2t5CBYU8Lbg= Cancel-Lock: sha1:OFX1p3nKec91S2nKCkQPfG8E5Xw= sha1:lhL9eNAyvhZyBDPoffZ5XU4O5xc= User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) Xref: x330-a1.tempe.blueboxinc.net comp.os.linux.development.apps:59 Richard Kettlewell writes: > David Schwartz writes: >> Rainer Weikusat wrote: >>> Also, the UNIX(*) standard demands that mkdir is supposed to fail >>> with EEXIST when the named file already existed. This is not possible >>> when mkdir is not an atomic operation. >> >> Yes, it is. The algorithm I specified will always fail if the named >> file already existed before the operation started. There is no >> requirement for atomicity. You can't just make up requirements because >> they seem reasonable to you. > > I'd go further than that: even when there is a standardized requirement > for atomicity (or any other property), you may still need to check what > the implementation does. NFS's failure to properly support O_EXCL is > notorious. You actually need to do so because Kennedy was shot, clearly proving that all kinds of things nobody expects CAN and DO happen ...