Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 12 Sep 2012 17:20:10 GMT
From:      Ed Maste <emaste@freebsd.org>
To:        freebsd-standards@FreeBSD.org
Subject:   Re: standards/171577: realpath(3) returns ENOTDIR instead of ENOENT
Message-ID:  <201209121720.q8CHKAHi068320@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: Ed Maste <emaste@freebsd.org>
To: Andrey Chernov <ache@freebsd.org>, Ed Maste <emaste@freebsd.org>, 
	FreeBSD-gnats-submit@freebsd.org
Cc:  
Subject: Re: standards/171577: realpath(3) returns ENOTDIR instead of ENOENT
Date: Wed, 12 Sep 2012 13:14:50 -0400

 On 12 September 2012 12:56, Andrey Chernov <ache@freebsd.org> wrote:
 
 > 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.
 
 Hi Andrey, sorry I did not see your comment before I committed the
 change (or I would have held off to discuss first).
 
 I find the wording in the POSIX realpath errors section confusing, but
 believe it is clear from the description of ENOTDIR in section 2.3 and
 the general use of ENOENT and ENOTDIR that ENOENT must be used for
 this case.  This is also the behaviour of Solaris and glibc.
 
 I am going to try to get the realpath text clarified.
 
 -Ed



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