aboutsummaryrefslogtreecommitdiffstats
path: root/man7/unix.7
diff options
context:
space:
mode:
authorAlejandro Colomar <alx.manpages@gmail.com>2022-03-18 20:25:09 +0100
committerAlejandro Colomar <alx.manpages@gmail.com>2022-03-20 02:36:25 +0100
commit1ae6b2c7b818e5d8804cf8d3abfdb6fba32119db (patch)
treeed237286398c7c8d9eb4f763b171895f84a38c11 /man7/unix.7
parent3d58eb6da4c3468ca8184b1d8317c6ae7d080d7a (diff)
downloadman-pages-1ae6b2c7b818e5d8804cf8d3abfdb6fba32119db.tar.gz
Many pages: Fix style issues reported by `make lint-groff`
Plus some other found in the process. Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Diffstat (limited to 'man7/unix.7')
-rw-r--r--man7/unix.752
1 files changed, 31 insertions, 21 deletions
diff --git a/man7/unix.7 b/man7/unix.7
index 2dc96fea10..767937326c 100644
--- a/man7/unix.7
+++ b/man7/unix.7
@@ -105,7 +105,11 @@ When the address of a pathname socket is returned
(by one of the system calls noted above),
its length is
.IP
- offsetof(struct sockaddr_un, sun_path) + strlen(sun_path) + 1
+.in +4n
+.EX
+offsetof(struct sockaddr_un, sun_path) + strlen(sun_path) + 1
+.EE
+.in
.IP
and
.I sun_path
@@ -141,11 +145,11 @@ should not be inspected.
.IR abstract :
an abstract socket address is distinguished (from a pathname socket)
by the fact that
-.IR sun_path[0]
+.I sun_path[0]
is a null byte (\(aq\e0\(aq).
The socket's address in this namespace is given by the additional
bytes in
-.IR sun_path
+.I sun_path
that are covered by the specified length of the address structure.
(Null bytes in the name have no special significance.)
The name has no connection with filesystem pathnames.
@@ -153,10 +157,10 @@ When the address of an abstract socket is returned,
the returned
.I addrlen
is greater than
-.IR "sizeof(sa_family_t)"
+.I sizeof(sa_family_t)
(i.e., greater than 2), and the name of the socket is contained in
the first
-.IR "(addrlen \- sizeof(sa_family_t))"
+.I (addrlen \- sizeof(sa_family_t))
bytes of
.IR sun_path .
.SS Pathname sockets
@@ -177,9 +181,11 @@ argument that describes the enclosing
.I sockaddr_un
structure should have a value of at least:
.IP
-.nf
- offsetof(struct sockaddr_un, sun_path)+strlen(addr.sun_path)+1
-.fi
+.in +4n
+.EX
+offsetof(struct sockaddr_un, sun_path)+strlen(addr.sun_path)+1
+.EE
+.in
.IP
or, more simply,
.I addrlen
@@ -303,7 +309,7 @@ is an integer boolean flag.
.B SO_PASSSEC
Enables receiving of the SELinux security label of the peer socket
in an ancillary message of type
-.BR SCM_SECURITY
+.B SCM_SECURITY
(see below).
.IP
The value given as an argument to
@@ -321,7 +327,7 @@ support for UNIX domain stream sockets was added
.\" commit 37a9a8df8ce9de6ea73349c9ac8bdf6ba4ec4f70
in Linux 4.2.
.TP
-.BR SO_PEEK_OFF
+.B SO_PEEK_OFF
See
.BR socket (7).
.TP
@@ -371,7 +377,7 @@ to
and returns the required length via
.IR optlen .
The caller should allocate at least
-.BR NAME_MAX
+.B NAME_MAX
bytes for the buffer initially, although this is not guaranteed
to be sufficient.
Resizing the buffer to the returned length
@@ -403,7 +409,7 @@ as
.IR sizeof(sa_family_t) ,
.\" i.e., sizeof(short)
or the
-.BR SO_PASSCRED
+.B SO_PASSCRED
socket option was specified for a socket that was
not explicitly bound to an address,
then the socket is autobound to an abstract address.
@@ -505,13 +511,13 @@ the excess file descriptors are automatically closed
in the receiving process.
.IP
The kernel constant
-.BR SCM_MAX_FD
+.B SCM_MAX_FD
defines a limit on the number of file descriptors in the array.
Attempting to send an array larger than this limit causes
.BR sendmsg (2)
to fail with the error
.BR EINVAL .
-.BR SCM_MAX_FD
+.B SCM_MAX_FD
has the value 253
(or 255 in kernels
.\" commit bba14de98753cb6599a2dae0e520714b2153522d
@@ -567,7 +573,7 @@ of the peer socket.
The received ancillary data is a null-terminated string containing
the security context.
The receiver should allocate at least
-.BR NAME_MAX
+.B NAME_MAX
bytes in the data portion of the ancillary message for this data.
.IP
To receive the security context, the
@@ -616,7 +622,7 @@ The next call will receive the remaining four bytes of data.
If the space allocated for receiving incoming ancillary data is too small
then the ancillary data is truncated to the number of headers
that will fit in the supplied buffer (or, in the case of an
-.BR SCM_RIGHTS
+.B SCM_RIGHTS
file descriptor list, the list of file descriptors may be truncated).
If no buffer is provided for incoming ancillary data (i.e., the
.I msg_control
@@ -627,7 +633,7 @@ structure supplied to
is NULL),
then the incoming ancillary data is discarded.
In both of these cases, the
-.BR MSG_CTRUNC
+.B MSG_CTRUNC
flag will be set in the
.I msg.msg_flags
value returned by
@@ -783,7 +789,7 @@ above).
It occurs if the number of "in-flight" file descriptors exceeds the
.B RLIMIT_NOFILE
resource limit and the caller does not have the
-.BR CAP_SYS_RESOURCE
+.B CAP_SYS_RESOURCE
capability.
An in-flight file descriptor is one that has been sent using
.BR sendmsg (2)
@@ -820,7 +826,7 @@ at any time and will be finally removed from the filesystem when the last
reference to it is closed.
.PP
To pass file descriptors or credentials over a
-.BR SOCK_STREAM
+.B SOCK_STREAM
socket, you must
send or receive at least one byte of nonancillary data in the same
.BR sendmsg (2)
@@ -868,10 +874,14 @@ there is no null terminator in
.PP
Applications that retrieve socket addresses can (portably) code
to handle the possibility that there is no null terminator in
-.IR sun_path
+.I sun_path
by respecting the fact that the number of valid bytes in the pathname is:
.PP
- strnlen(addr.sun_path, addrlen \- offsetof(sockaddr_un, sun_path))
+.in +4n
+.EX
+strnlen(addr.sun_path, addrlen \- offsetof(sockaddr_un, sun_path))
+.EE
+.in
.\" The following patch to amend kernel behavior was rejected:
.\" http://thread.gmane.org/gmane.linux.kernel.api/2437
.\" Subject: [patch] Fix handling of overlength pathname in AF_UNIX sun_path