X-Recipient: archive-cygwin AT delorie DOT com X-Spam-Check-By: sourceware.org Date: Thu, 6 Mar 2008 15:26:14 +0100 From: Corinna Vinschen To: cygwin AT cygwin DOT com Subject: Re: bug with touch t/ Message-ID: <20080306142614.GR18407@calimero.vinschen.de> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: <20080305183640 DOT GI18407 AT calimero DOT vinschen DOT de> <47CFEE38 DOT 5040905 AT byu DOT net> <20080306132748 DOT GP18407 AT calimero DOT vinschen DOT de> <47CFF263 DOT 90804 AT byu DOT net> <20080306134546 DOT GQ18407 AT calimero DOT vinschen DOT de> <47CFF979 DOT 6080201 AT byu DOT net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <47CFF979.6080201@byu.net> User-Agent: Mutt/1.5.16 (2007-06-09) Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: 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 On Mar 6 07:02, Eric Blake wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > According to Corinna Vinschen on 3/6/2008 6:45 AM: > | SUSv3(*) says: > | > | [EISDIR] > | The named file is a directory and oflag includes O_WRONLY or O_RDWR. > | [ENOENT] > | O_CREAT is not set and the named file does not exist; or O_CREAT is > | set and either the path prefix does not exist or the path argument > | points to an empty string. > | > | Given these descriptions, I can't see anything wrong with that Linux > | behaviour. > > By those SUSv3 rules (which are identical to POSIX), open("t/", > O_RDONLY|O_CREAT) when t does not exist falls under ENOENT, not EISDIR. > In POSIX 2004, path resolution requires that if a trailing slash is > present, resolution is performed as if by "t/.", making "t" a path prefix > which is not present. And in the draft POSIX 200x, the wording has been > made more explicit that when doing path resolution, if there is a trailing > slash but the text before the slash does not name an existing directory, > then it fails with ENOENT. > > But on Linux: > Linux$ strace touch t/ > ~ [...] > ~ open("t/", O_WRONLY|O_NONBLOCK|O_CREAT|O_NOCTTY, 0666) = -1 EISDIR (Is a > directory) But the flags are not O_RDONLY|O_CREAT. They are O_WRONLY|O_CREAT. That's why this falls under EISDIR under SUSv3 rules, afaics. Which chapter in the austin doc are you refering to? I can't find this re-wording for some reason. Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Project Co-Leader cygwin AT cygwin DOT com Red Hat -- 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/