From owner-freebsd-standards@FreeBSD.ORG Wed Sep 12 17:20:10 2012 Return-Path: Delivered-To: freebsd-standards@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AA8B2106566B for ; Wed, 12 Sep 2012 17:20:10 +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 95C448FC08 for ; Wed, 12 Sep 2012 17:20:10 +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 q8CHKArr068333 for ; Wed, 12 Sep 2012 17:20:10 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q8CHKAHi068320; Wed, 12 Sep 2012 17:20:10 GMT (envelope-from gnats) Date: Wed, 12 Sep 2012 17:20:10 GMT Message-Id: <201209121720.q8CHKAHi068320@freefall.freebsd.org> To: freebsd-standards@FreeBSD.org From: Ed Maste 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: Ed Maste List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Sep 2012 17:20:10 -0000 The following reply was made to PR standards/171577; it has been noted by GNATS. From: Ed Maste To: Andrey Chernov , Ed Maste , 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 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- character and ends with one or > more trailing 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