public inbox for newlib-cvs@sourceware.org
help / color / mirror / Atom feed
From: Sebastian Huber <sh@sourceware.org>
To: newlib-cvs@sourceware.org
Subject: [newlib-cygwin] Make the path length of UNIX domain sockets
Date: Mon, 11 Jul 2022 11:51:39 +0000 (GMT)	[thread overview]
Message-ID: <20220711115139.150473854159@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=09e5cb57a0c837c0c442668a8dacea19a1d9522a

commit 09e5cb57a0c837c0c442668a8dacea19a1d9522a
Author: Jonathan T. Looney <jtl@FreeBSD.org>
Date:   Tue Apr 14 15:27:24 2020 +0000

    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

Diff:
---
 newlib/libc/sys/rtems/include/sys/un.h | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/newlib/libc/sys/rtems/include/sys/un.h b/newlib/libc/sys/rtems/include/sys/un.h
index f83652e07..3c408628c 100644
--- a/newlib/libc/sys/rtems/include/sys/un.h
+++ b/newlib/libc/sys/rtems/include/sys/un.h
@@ -43,13 +43,21 @@ typedef	__sa_family_t	sa_family_t;
 #define	_SA_FAMILY_T_DECLARED
 #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


                 reply	other threads:[~2022-07-11 11:51 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220711115139.150473854159@sourceware.org \
    --to=sh@sourceware.org \
    --cc=newlib-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).