From owner-svn-src-head@freebsd.org Mon Apr 30 17:16:18 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 86298FB0FF3; Mon, 30 Apr 2018 17:16:18 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3368973A39; Mon, 30 Apr 2018 17:16:18 +0000 (UTC) (envelope-from emaste@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0F5C11623D; Mon, 30 Apr 2018 17:16:18 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3UHGH8D014864; Mon, 30 Apr 2018 17:16:17 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3UHGH3j014862; Mon, 30 Apr 2018 17:16:17 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804301716.w3UHGH3j014862@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 30 Apr 2018 17:16:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333119 - head/lib/libc/sys X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/lib/libc/sys X-SVN-Commit-Revision: 333119 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Apr 2018 17:16:18 -0000 Author: emaste Date: Mon Apr 30 17:16:17 2018 New Revision: 333119 URL: https://svnweb.freebsd.org/changeset/base/333119 Log: Clarify bindat/connectat use with AT_FDCWD Discovered during investigation into the PR - the description of AT_FDCWD was somewhat confusing. PR: 222632 Submitted by: Jan Kokemüller MFC after: 1 week Modified: head/lib/libc/sys/bindat.2 head/lib/libc/sys/connectat.2 Modified: head/lib/libc/sys/bindat.2 ============================================================================== --- head/lib/libc/sys/bindat.2 Mon Apr 30 15:55:58 2018 (r333118) +++ head/lib/libc/sys/bindat.2 Mon Apr 30 17:16:17 2018 (r333119) @@ -46,7 +46,15 @@ The .Fn bindat system call assigns the local protocol address to a socket. -It works just like the +When passed the special value +.Dv AT_FDCWD +in the +.Fa fd +parameter, the behavior is identical to a call to +.Xr bind 2 . +Otherwise, +.Fn bindat +works like the .Xr bind 2 system call with two exceptions: .Pp @@ -60,15 +68,6 @@ If the file path stored in the field of the sockaddr_un structure is a relative path, it is located relative to the directory associated with the file descriptor .Fa fd . -If -.Fn bindat -is passed the special value -.Dv AT_FDCWD -in the -.Fa fd -parameter, the current working directory is used and the behavior is identical -to a call to -.Xr bind 2 . .El .Sh RETURN VALUES .Rv -std bindat @@ -77,7 +76,7 @@ The .Fn bindat system call may fail with the same errors as the .Xr bind 2 -system call for a UNIX domain socket or with the following errors: +system call or with the following errors: .Bl -tag -width Er .It Bq Er EBADF The Modified: head/lib/libc/sys/connectat.2 ============================================================================== --- head/lib/libc/sys/connectat.2 Mon Apr 30 15:55:58 2018 (r333118) +++ head/lib/libc/sys/connectat.2 Mon Apr 30 17:16:17 2018 (r333119) @@ -46,7 +46,15 @@ The .Fn connectat system call initiates a connection on a socket. -It works just like the +When passed the special value +.Dv AT_FDCWD +in the +.Fa fd +parameter, the behavior is identical to a call to +.Xr connect 2 . +Otherwise, +.Fn connectat +works like the .Xr connect 2 system call with two exceptions: .Pp @@ -60,15 +68,6 @@ If the file path stored in the field of the sockaddr_un structure is a relative path, it is located relative to the directory associated with the file descriptor .Fa fd . -If -.Fn connectat -is passed the special value -.Dv AT_FDCWD -in the -.Fa fd -parameter, the current working directory is used and the behavior is identical -to a call to -.Xr connect 2 . .El .Sh RETURN VALUES .Rv -std connectat @@ -77,7 +76,7 @@ The .Fn connectat system call may fail with the same errors as the .Xr connect 2 -system call for a UNIX domain socket or with the following errors: +system call or with the following errors: .Bl -tag -width Er .It Bq Er EBADF The