Date: Wed, 10 May 1995 16:22:23 +1000 From: Bruce Evans <bde@zeta.org.au> To: Bernard.Steiner@Germany.EU.net, terry@cs.weber.edu Cc: freebsd-bugs@FreeBSD.org Subject: Re: strange symlinks Message-ID: <199505100622.QAA01050@godzilla.zeta.org.au>
index | next in thread | raw e-mail
>> The next one may be a general 4.4 problem...
>> assumption: /tmp/foo does not exist, /tmp/bar is a symlink to /tmp/foo.
>> chdir("/tmp/bar") fails with ENOENT, but at the same time
>> mkdir("/tmp/bar", 0x777) fails with EEXIST.
>I think this is a generic result of the path component item evaluation
>order. I guess the only thing to say is that "according to the code,
>this is correct behaviour" 8-).
It's because chdir follows symlinks but mkdir doesn't. chdir operates on
directories while mkdir operates on directory entries. The directory
/tmp/foo doesn't exist so the error for chdir is ENOENT but the directory
entry /tmp/bar exists so the error for mkdir is EEXIST.
>> Third, whatever happened to the fchdir() syscall that I vaguely remember
>> having had in (at least) 386BSD0.1 ?
>It had *better* still be there! I've been using it with a couple of
It hasn't changed. See `man fchdir'.
Bruce
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199505100622.QAA01050>
