From owner-svn-src-all@freebsd.org Sun Dec 4 15:56:00 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A989C66ADA; Sun, 4 Dec 2016 15:56:00 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 29BCE199; Sun, 4 Dec 2016 15:56:00 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB4FtxGt076027; Sun, 4 Dec 2016 15:55:59 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB4Ftx7J076026; Sun, 4 Dec 2016 15:55:59 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201612041555.uB4Ftx7J076026@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sun, 4 Dec 2016 15:55:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r309533 - stable/11/lib/libc/sys X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Dec 2016 15:56:00 -0000 Author: jilles Date: Sun Dec 4 15:55:59 2016 New Revision: 309533 URL: https://svnweb.freebsd.org/changeset/base/309533 Log: MFC r309026: open(2): Clarify non-POSIX error when opening a symlink with O_NOFOLLOW. We return [EMLINK] instead of [ELOOP] when trying to open a symlink with O_NOFOLLOW, so that the original case of [ELOOP] can be distinguished. Code like cmp -h and xz takes advantage of this. PR: 214633 Modified: stable/11/lib/libc/sys/open.2 Modified: stable/11/lib/libc/sys/open.2 ============================================================================== --- stable/11/lib/libc/sys/open.2 Sun Dec 4 15:28:30 2016 (r309532) +++ stable/11/lib/libc/sys/open.2 Sun Dec 4 15:55:59 2016 (r309533) @@ -28,7 +28,7 @@ .\" @(#)open.2 8.2 (Berkeley) 11/16/93 .\" $FreeBSD$ .\" -.Dd April 2, 2015 +.Dd November 22, 2016 .Dt OPEN 2 .Os .Sh NAME @@ -471,6 +471,22 @@ The .Fn openat function was introduced in .Fx 8.0 . +.Sh STANDARDS +These functions are specified by +.St -p1003.1-2008 . +.Fx +sets +.Va errno +to +.Er EMLINK instead of +.Er ELOOP +as specified by +.Tn POSIX +when +.Dv O_NOFOLLOW +is set in flags and the final component of pathname is a symbolic link +to distinguish it from the case of too many symbolic link traversals +in one of its non-final components. .Sh BUGS The Open Group Extended API Set 2 specification requires that the test for whether