tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: mkdir -p, autoconf



hi,

On Fri, Oct 07, 2022 at 06:40:19AM -0400, Greg Troxel wrote:
> 
>   1) Is NetBSD's mkdir -p safe, in that it is immune to
>     check for dir
>     call mkdir(2) which fails because another mkdir did it in between
>     return -1 because that was an error
> 
>   I don't see this documented in the (9) manpage.

... because that's not where it's handled.

Code inspection shows that mkdir itself, if mkdir(2) failed, 
checks whether the (possibly intermediate) path exists and is
a directory, and in this case handles it the same af it was
created successfully.

So the answer to this is "yes".

	-is


Home | Main Index | Thread Index | Old Index