mirror of https://github.com/mkerrisk/man-pages
unix.7: Fix description of "pathname" sockets
As reported by Lennart Poettering: The part about "pathname" sockets suggests usage of sizeof(sa_family_t) + strlen(sun_path) + 1 for calculating the sockaddr size. Due to alignment/padding this is probably not a good idea. Instead, one should use offsetof(struct sockaddr_un, sun_path) + strlen() + 1 or something like that. See https://bugzilla.kernel.org/show_bug.cgi?id=19812 Reported-by: Lennart Poettering <mzxreary@0pointer.de> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
parent
156a0e0d7e
commit
6ed236d51a
|
@ -80,7 +80,7 @@ When the address of the socket is returned by
|
|||
and
|
||||
.BR accept (2),
|
||||
its length is
|
||||
.IR "sizeof(sa_family_t) + strlen(sun_path) + 1" ,
|
||||
.IR "offsetof(struct sockaddr_un, sun_path) + strlen(sun_path) + 1" ,
|
||||
and
|
||||
.I sun_path
|
||||
contains the null-terminated pathname.
|
||||
|
|
Loading…
Reference in New Issue