diff options
author | Jonathan T. Looney <jtl@FreeBSD.org> | 2020-04-14 15:27:24 +0000 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2022-07-11 11:52:46 +0200 |
commit | 09e5cb57a0c837c0c442668a8dacea19a1d9522a (patch) | |
tree | 95134015b97e405e28ae3a6c8352b13249fd6b48 | |
parent | 86484e84d7be074b540c8e11650bed025692d71f (diff) | |
download | newlib-09e5cb57a0c837c0c442668a8dacea19a1d9522a.zip newlib-09e5cb57a0c837c0c442668a8dacea19a1d9522a.tar.gz newlib-09e5cb57a0c837c0c442668a8dacea19a1d9522a.tar.bz2 |
Make the path length of UNIX domain sockets
specified by a #define. Also, add a comment describing the historical context
for this length.
Reviewed by: bz, jhb, kbowling (previous version)
MFC after: 2 weeks
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D24272
-rw-r--r-- | newlib/libc/sys/rtems/include/sys/un.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/newlib/libc/sys/rtems/include/sys/un.h b/newlib/libc/sys/rtems/include/sys/un.h index f83652e..3c40862 100644 --- a/newlib/libc/sys/rtems/include/sys/un.h +++ b/newlib/libc/sys/rtems/include/sys/un.h @@ -44,12 +44,20 @@ typedef __sa_family_t sa_family_t; #endif /* + * Historically, (struct sockaddr) needed to fit inside an mbuf. + * For this reason, UNIX domain sockets were therefore limited to + * 104 bytes. While this limit is no longer necessary, it is kept for + * binary compatibility reasons. + */ +#define SUNPATHLEN 104 + +/* * Definitions for UNIX IPC domain. */ struct sockaddr_un { unsigned char sun_len; /* sockaddr len including null */ sa_family_t sun_family; /* AF_UNIX */ - char sun_path[104]; /* path name (gag) */ + char sun_path[SUNPATHLEN]; /* path name (gag) */ }; #if __BSD_VISIBLE |