Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 12 Sep 2012 17:00:13 GMT
From:      Andrey Chernov <ache@FreeBSD.ORG>
To:        freebsd-standards@FreeBSD.org
Subject:   Re: standards/171577: realpath(3) returns ENOTDIR instead of ENOENT
Message-ID:  <201209121700.q8CH0DFn038845@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR standards/171577; it has been noted by GNATS.

From: Andrey Chernov <ache@FreeBSD.ORG>
To: Ed Maste <emaste@FreeBSD.ORG>
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
 
 [ENOENT]
     A component of file_name does not name an existing file or file_name 
 points to an empty string.
 [ENOTDIR]
     A component of the path prefix is not a directory, or the file_name 
 argument contains at least one non- <slash> character and ends with one or 
 more trailing <slash> characters and the last pathname component names an 
 existing file that is neither a directory nor a symbolic link to a 
 directory.
 
 -- 
 http://ache.vniz.net/



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201209121700.q8CH0DFn038845>