Subject: Re: Linux emulation and mkdir with trailing /
To: NetBSD Kernel Technical Discussion List <>
From: Greg A. Woods <>
List: tech-kern
Date: 09/25/2000 16:04:23
[ On Monday, September 25, 2000 at 13:55:12 (-0400), Matthew Orgass wrote: ]
> Subject: Re: Linux emulation and mkdir with trailing /
>   True, but directories are still special, and at least SUSv2 and probably
> POSIX allows trailing slashes only when refering to a directory.

OK, I'm confused now, could someone with a real copy of POSIX-1003.1
have a look?

I find the following in POSIX-1003.2-Draft-12:  pathname:  A string that is used to identify a file.
 A pathname consists of, at most, {PATH_MAX} bytes, including the
 terminating null character.  It has an optional beginning slash, followed
 by zero or more filenames separated by slashes.  If the pathname refers
 to a directory, it may also have one or more trailing slashes.  Multiple
 successive slashes are considered to be the same as one slash.  A
 pathname that begins with two successive slashes may be interpreted in an
 implementation-defined manner, although more than two leading slashes
 shall be treated as a single slash.  The interpretation of the pathname
 is described in pathname resolution in  [POSIX.1 {8}]
This would tend suggest that at least in the writing of this draft the
POSIX folks were bending away from the old V7 behaviour.

However this begs the question of why SunOS-5.6 (at least) does not do
this -- I was under the distinct impression that SunOS-5 was certified
POSIX compliant....

>   I also think that rename, chown, fchown, and lchown should be changed to
> the POSIX/XPG behavior at all times (as OpenBSD has done for a while). 

That's a good idea...

> While POSIX rename behavior is braindead, it is the standard and portable
> programs should expect it. 

s/should/will/  :-)

							Greg A. Woods

+1 416 218-0098      VE3TCP      <>      <robohack!woods>
Planix, Inc. <>; Secrets of the Weird <>