tech-userlevel archive

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

Re: mkdir -p, autoconf



ignatios%cs.uni-bonn.de@localhost writes:

> 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".

Sorry, I meant not documented in mkdir(1).

Attachment: signature.asc
Description: PGP signature



Home | Main Index | Thread Index | Old Index