From owner-freebsd-standards@FreeBSD.ORG Wed Sep 12 17:10:07 2012 Return-Path: Delivered-To: freebsd-standards@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6219A106564A for ; Wed, 12 Sep 2012 17:10:07 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 48BF48FC0C for ; Wed, 12 Sep 2012 17:10:07 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q8CHA7B6087774 for ; Wed, 12 Sep 2012 17:10:07 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q8CHA7T3087754; Wed, 12 Sep 2012 17:10:07 GMT (envelope-from gnats) Date: Wed, 12 Sep 2012 17:10:07 GMT Message-Id: <201209121710.q8CHA7T3087754@freefall.freebsd.org> To: freebsd-standards@FreeBSD.org From: Eitan Adler Cc: Subject: Re: standards/171577: realpath(3) returns ENOTDIR instead of ENOENT X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Eitan Adler List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Sep 2012 17:10:07 -0000 The following reply was made to PR standards/171577; it has been noted by GNATS. From: Eitan Adler To: Andrey Chernov Cc: FreeBSD Standards , bug-followup@freebsd.org Subject: Re: standards/171577: realpath(3) returns ENOTDIR instead of ENOENT Date: Wed, 12 Sep 2012 13:07:44 -0400 On 12 September 2012 13:00, Andrey Chernov wrote: > The following reply was made to PR standards/171577; it has been noted by GNATS. > > From: Andrey Chernov > To: Ed Maste > Cc: FreeBSD-gnats-submit@FreeBSD.ORG > Subject: Re: standards/171577: realpath(3) returns ENOTDIR instead of ENOENT > Date: Wed, 12 Sep 2012 20:56:07 +0400 > > On Wed, Sep 12, 2012 at 03:54:43PM +0000, Ed Maste wrote: > > When passed a path with a component that does not exist realpath() sets > > errno to ENOTDIR instead of ENOENT. See kern/128933 for the change that > > introduced this behaviour. I believe it is incorrect. > > > > ENOTDIR is > > > > 20 ENOTDIR Not a directory. A component of the specified pathname > > existed, but it was not a directory, when a directory was > > expected. > > > > >How-To-Repeat: > > > > feynman% realpath /does-not-exist/foo > > realpath: /does-not-exist/foo: Not a directory > > It works as designed. See POSIX realpath ERRORS section > http://pubs.opengroup.org/onlinepubs/9699919799/functions/realpath.html ENOTDIR implies the path exists: [ENOTDIR] Not a directory. A component of the specified pathname exists, but it is not a directory, when a directory was expected. from section 2.3: Error Numbers http://pubs.opengroup.org/onlinepubs/009695399/functions/xsh_chap02_03.html -- Eitan Adler