This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH roland/maxhostnamelen] Use HOST_NAME_MAX for MAXHOSTNAMELEN in <sys/param.h>.
- From: Roland McGrath <roland at hack dot frob dot com>
- To: "GNU C. Library" <libc-alpha at sourceware dot org>
- Date: Mon, 14 Sep 2015 11:18:17 -0700 (PDT)
- Subject: [PATCH roland/maxhostnamelen] Use HOST_NAME_MAX for MAXHOSTNAMELEN in <sys/param.h>.
- Authentication-results: sourceware.org; auth=none
This is a generic change, but in fact it only affects *-nacl
configurations. For Linux configurations, <bits/param.h> (via the
kernel's <asm/param.h>) defines MAXHOSTNAMELEN already. For Hurd,
nothing defines HOST_NAME_MAX, so this won't change anything.
If there are no objections soon, I'll put this on both trunk and
2.22 branch. It is a user-visible change and I didn't bother filing
in bugzilla, because no NaCl application developer will actually see
the 2.22-release version before this change.
Thanks,
Roland
2015-09-14 Roland McGrath <roland@hack.frob.com>
* misc/sys/param.h [!MAXHOSTNAMELEN && HOST_NAME_MAX]
(MAXHOSTNAMELEN): Define it to HOST_NAME_MAX.
diff --git a/misc/sys/param.h b/misc/sys/param.h
index 62b7ed2..1908b93 100644
--- a/misc/sys/param.h
+++ b/misc/sys/param.h
@@ -50,6 +50,9 @@
#if !defined NOFILE && defined OPEN_MAX
# define NOFILE OPEN_MAX
#endif
+#if !defined MAXHOSTNAMELEN && defined HOST_NAME_MAX
+# define MAXHOSTNAMELEN HOST_NAME_MAX
+#endif
#ifndef NCARGS
# ifdef ARG_MAX
# define NCARGS ARG_MAX