]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* doc/autoconf.texi (Limitations of Usual Tools) <mkdir>: `mkdir -p'
authorAlexandre Duret-Lutz <adl@gnu.org>
Thu, 19 Feb 2004 23:21:41 +0000 (23:21 +0000)
committerAlexandre Duret-Lutz <adl@gnu.org>
Thu, 19 Feb 2004 23:21:41 +0000 (23:21 +0000)
is not always thread-safe.  Report from Nathanael Nerode.

ChangeLog
doc/autoconf.texi

index 00ee2659a436de2faf882e60b20cf657ed80f07c..dfff2cab508fb9525a2011f08fd34078060e3daa 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2004-02-20  Alexandre Duret-Lutz  <adl@gnu.org>
+
+       * doc/autoconf.texi (Limitations of Usual Tools) <mkdir>: `mkdir -p'
+       is not always thread-safe.  Report from Nathanael Nerode.
+
 2004-02-18  Paul Eggert  <eggert@twinsun.com>
 
        Fix a dependencies problem, stemming from a Autoconf 2.59 build
index 2607af4c16668c683433bcf637fe2486083e2d43..6e550241806b01e5c77eda41859be81bda31cc1e 100644 (file)
@@ -11273,6 +11273,21 @@ should succeed when @file{foo} is a symbolic link to an already-existing
 directory.  GNU Coreutils 5.1.0 @command{mkdir} succeeds, but Solaris 9
 @command{mkdir} fails.
 
+Not all @code{mkdir -p} implementations are thread-safe.  When it is not
+and you call @code{mkdir -p a/b} and @code{mkdir -p a/c} at the same
+time, both will detect that @file{a/} is missing, one will create
+@file{a/}, then the other will try to create @file{a/} and die with a
+@code{File exists} error.  At least Solaris 8, NetBSD 1.6, and OpenBSD
+3.4 have an unsafe @code{mkdir -p}.  GNU Coreutils (since Fileutils
+version 4.0c), FreeBSD 5.0, and NetBSD-current are known to have a
+race-free @code{mkdir -p}.  This possible race is harmful in parallel
+builds when several @file{Makefile} rules call @code{mkdir -p} to
+construct directories.  You may use @command{mkinstalldirs} or
+@code{install-sh -d} as a safe replacement, provided these scripts are
+recent enough (the copies shipped with Automake 1.8.3 are OK, those from
+older versions are not thread-safe either).
+
+
 @item @command{mv}
 @c ---------------
 @prindex @command{mv}