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
This commit is contained in:
Ed Maste 2018-04-30 17:16:17 +00:00
parent 37e576b25e
commit e2811155f1
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=333119
2 changed files with 20 additions and 22 deletions

View File

@ -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

View File

@ -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