Hello,
On Thu, Jun 01, 2006 at 08:23:27PM +0200, Ralf Wildenhues wrote:
> I went ahead and checked these BSD systems:
> http://www.freebsd.org/cgi/cvsweb.cgi/src/bin/mkdir/mkdir.c
> http://cvsweb.netbsd.org/bsdweb.cgi/src/bin/mkdir/mkdir.c
> http://www.openbsd.org/cgi-bin/cvsweb/src/bin/mkdir/mkdir.c
>
> All of them support -m.
>
> FreeBSD has a race-free mkdir -p since rev. 1.23 of mkdir.c, but I
> wouldn't trust it before rev. 1.25, dated 2002, in FreeBSD 5.0.
>
> NetBSD has a race-free mkdir -p since rev. 1.28 of mkdir.c, but I
> wouldn't trust it before rev. 1.29, dated 2003, in NetBSD 2.0.2.
>
> OpenBSD has a race-free mkdir -p since rev. 1.7 of mkdir.c, 1998,
> OpenBSD 2.4, but looking at the source code, I found a small
> bug in it (which is not so relevant to intended usage though):
> http://cvs.openbsd.org/cgi-bin/query-pr-wrapper?full=yes&numbers=5141
thank you, Ralf, for the review. It seems that autoconf.texi needs
to be corrected; patch attached.
> > > If yes, is there any way to detect them, too?
> (matching right from `uname -rs' output seems to ugly and
> maintenance-intensive to me),
After our private communication, I'm fully convinced. We don't want
to go down that path.
(One problem is, that we don't know about a generic way to
distinguish real *BSD from GNU/k*bsd systems which contain only the
BSD kernel.)
> Hmm, could take to AC_REQUIRE([AC_CANONICAL_HOST]) and match from
> there [...] but that may all be overkill. Not sure.
In this light, I'd rather back out my proposal. If GNU mkdir is not
found, just use install-sh, and that's it.
OK to commit the above doc patch?
Have a nice day,
Stepan
2006-06-04 Stepan Kasal <[EMAIL PROTECTED]>
* doc/autoconf.texi (Limitations of Usual Tools): Correct
information about race-free implementations of mkdir.
Index: doc/autoconf.texi
===================================================================
RCS file: /cvsroot/autoconf/autoconf/doc/autoconf.texi,v
retrieving revision 1.1036
diff -u -r1.1036 autoconf.texi
--- doc/autoconf.texi 4 Jun 2006 07:38:28 -0000 1.1036
+++ doc/autoconf.texi 4 Jun 2006 11:43:16 -0000
@@ -13230,12 +13230,10 @@
For example, if you invoke @code{mkdir -p a/b} and @code{mkdir -p a/c}
at the same time, both processes might detect that @file{a} is missing,
one might create @file{a}, then the other might try to create @file{a}
-and fail with a @code{File exists} diagnostic. At least Solaris 10,
[EMAIL PROTECTED] 1.6, and [EMAIL PROTECTED] 3.4 are vulnerable to race
-conditions. The @acronym{GNU} Core Utilities
-(since @samp{fileutils}
-version 4.1), [EMAIL PROTECTED] 5.0, and [EMAIL PROTECTED] are
-known to have a
+and fail with a @code{File exists} diagnostic. At least Solaris 10 and
[EMAIL PROTECTED] 1.6 are vulnerable to race conditions. The @acronym{GNU}
+Core Utilities (since @samp{fileutils} version 4.1), [EMAIL PROTECTED] 5.0,
[EMAIL PROTECTED] 2.0.2, and [EMAIL PROTECTED] 2.4 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