Subject: Re: rmdir(".")
To: None <tech-kern@NetBSD.org>
From: Roland Illig <rillig@NetBSD.org>
List: tech-kern
Date: 09/09/2005 10:35:49
John Nemeth wrote:
> On Jan 30,  4:32am, Roland Illig wrote:
> } 
> } is there any technical reason for not allowing rmdir("."), or is it just 
> } to protect the user from something {s,}he might eventually not want to 
> } do? I'm not interested in a flame war, I just want to know the reasons 
> } for it. (I'm still too young to know everything about Unix-like systems. ;))
> } 
> } http://www.opengroup.org/onlinepubs/009695399/functions/rmdir.html says 
> } removing the current working directory is allowed.
> } 
> } By the way, the error code is wrong. It should not be EINVAL, but EBUSY.
> 
>      This is not entirely clear.  The page you reference says this:
> 
>      If the directory is the root directory or the current working
>      directory of any process, it is unspecified whether the function
>      succeeds, or whether it shall fail and set errno to [EBUSY].

In my interpretation, this says:

conformant to the specification ==
   (the function succeeds
    || (the function fails && errno is set to EBUSY))

What's your interpretation? Or did I miss the point here?

Roland