X-Spam-Check-By: sourceware.org From: ericblake AT comcast DOT net (Eric Blake) To: Alex Riesen , cygwin AT cygwin DOT com Subject: Re: cygwin-1.5.19-2: mkdir returns inconsistent errno Date: Thu, 26 Jan 2006 14:33:28 +0000 Message-Id: <012620061433.15133.43D8DDB80001B6F600003B1D22069997350A050E040D0C079D0A@comcast.net> Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com > mkdir (also syscall) return "Permission denied" when its argument refers to > a mountpoint at the top of windows drive (probably also a windows mount, > I haven't tried). > For example: > $ mount d: /d > $ mkdir / > mkdir: cannot create directory `/': File exists > $ mkdir /d > mkdir: cannot create directory `/d': Permission denied > $ mkdir /d/tmp > mkdir: cannot create directory `/d/tmp': File exists I raised this issue before, and the conclusion was that POSIX permits this behavior (the mkdir must fail, but is permitted to fail for ANY of the permissible errno values that apply to the situation when more than one failure mode is present). Therefore, it is highly likely that no change will be made to cygwin. > > This is highly unexpected, does not match linux behaviour (it returns EEXIST), > and actually breaks git (git clone, creation of pathnames, to be precise). Then git has a bug. Report it there. To be portable when making pathnames, you must first check for directory existance rather than relying on an errno of EEXIST to tell you the directory exists. This is not even cygwin-specific. It is possible on Linux to have /usr mounted on a read-only filesystem, then /usr/local mounted in a writable location, such that the call "mkdir -p /usr/local/dir" will get EROFS on the /usr component rather than EEXIST (trust me - the coreutils code for mkdir faced this very same issue in 5.90, and was fixed in time for the current 5.93). -- Eric Blake volunteer cygwin coreutils maintainer -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/