Subject: Re: Linux emulation and mkdir with trailing /
To: Warner Losh <>
From: David Brownlee <abs@NetBSD.ORG>
List: tech-kern
Date: 09/18/2000 09:07:56
On Sun, 17 Sep 2000, Warner Losh wrote:

> : 	I have a linux binary here which calls the mkdir system call with
> : 	a trailing /
> It should ENOENT if the directory doesn't exist and EEXIST if it does.
> Why?  If the directory doesn't exist for "/foo/bar/", then /foo/bar
> won't exist, and return the error.  If it does, then "/foo/bar/."
> exists.  I believe that the standard states that null path components
> are treated as '.'.  I don't have the standards docs handy, but recall
> this from past discussions on related topics.

	That is what I seemed to recall - though its possible that some
	other part of the standard overrides that for trailing / (as
	mentioned by Matthew Orgass).

On Sun, 17 Sep 2000, Matthew Orgass wrote:
>   SUSv2 (and I believe POSIX) says that directories may have one or more
> trailing slashes, so this should be accepted.

	Would you have a document and section number for this - I'd like
	to add a reference to the manpage to ensure this is settled for
	the future - thanks :)

			       -- A pmap for every occasion --