aboutsummaryrefslogtreecommitdiffstats
path: root/man7/unix.7
diff options
context:
space:
mode:
authorMichael Kerrisk <mtk.manpages@gmail.com>2010-10-10 07:10:59 +0200
committerMichael Kerrisk <mtk.manpages@gmail.com>2010-10-10 07:25:45 +0200
commit6ed236d51adf6d0a848e7bf882d6ee4d138fe663 (patch)
tree6d8b260e6c6d754297aa02dda911570080837437 /man7/unix.7
parent156a0e0d7e874a835f27d1a6b5946a5544af7582 (diff)
downloadman-pages-6ed236d51adf6d0a848e7bf882d6ee4d138fe663.tar.gz
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>
Diffstat (limited to 'man7/unix.7')
-rw-r--r--man7/unix.72
1 files changed, 1 insertions, 1 deletions
diff --git a/man7/unix.7 b/man7/unix.7
index 4a1b46a8f6..60570b9d0a 100644
--- a/man7/unix.7
+++ b/man7/unix.7
@@ -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.