Date: Mon, 30 Apr 2018 17:16:17 +0000 (UTC) From: Ed Maste <emaste@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333119 - head/lib/libc/sys Message-ID: <201804301716.w3UHGH3j014862@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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 <jan.kokemueller@gmail.com> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201804301716.w3UHGH3j014862>