From owner-freebsd-bugs Tue May 9 23:25:58 1995 Return-Path: bugs-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.10/8.6.6) id XAA10737 for bugs-outgoing; Tue, 9 May 1995 23:25:58 -0700 Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.34]) by freefall.cdrom.com (8.6.10/8.6.6) with ESMTP id XAA10730 for ; Tue, 9 May 1995 23:25:47 -0700 Received: (from bde@localhost) by godzilla.zeta.org.au (8.6.9/8.6.9) id QAA01050; Wed, 10 May 1995 16:22:23 +1000 Date: Wed, 10 May 1995 16:22:23 +1000 From: Bruce Evans Message-Id: <199505100622.QAA01050@godzilla.zeta.org.au> To: Bernard.Steiner@Germany.EU.net, terry@cs.weber.edu Subject: Re: strange symlinks Cc: freebsd-bugs@FreeBSD.org Sender: bugs-owner@FreeBSD.org Precedence: bulk >> 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