lkml.org 
[lkml]   [1996]   [Sep]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: POSIX feature or bug?


On Fri, 20 Sep 1996, Ulrich Windl wrote:
>
> This is from HP-UX 10.01 (Patchlevel 7+)
>
> rkdvmhp1:windl(32) % cd /tmp
> rkdvmhp1:windl(33) % mkdir X
> rkdvmhp1:windl(34) % cd X
> rkdvmhp1:windl(35) % rmdir /tmp/X
> rmdir: /tmp/X: Cannot remove mountable directory

Yes, but do the same thing in another window:

Win 1 Win 2

cd /tmp
mkdir X
cd X
rmdir /tmp/X

See, the HP-UX and Solaris checks are just something stupid like this:

if (current_cwd == dir_to_remove)
return -EINVAL;

while Digital UNIX and Linux just do not do that stupid check (and it
_is_ stupid, because it doesn't "protect" against anything).

In fact, you don't even need two windows: do the following on Solaris (or
HP-UX):

kruuna$ cd /tmp
/tmp
kruuna$ mkdir X
kruuna$ cd X
/tmp/X
kruuna$ ( cd ; rmdir /tmp/X )
/home/fs/torvalds
kruuna$ /bin/pwd
pwd: cannot determine current directory!

See? It's not the OS being "clever" and noticing that the directory is in
use, it's the OS being "anal" and permitting the rmdir() only if it's not the
cwd of the process trying to run. I don't see the point in that kind of
testing.

Linus

\
 
 \ /
  Last update: 2005-03-22 13:37    [W:0.041 / U:7.152 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site