aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libc/dns/include/resolv_private.h7
-rw-r--r--libc/include/netdb.h3
-rw-r--r--libc/include/sys/param.h2
-rw-r--r--libc/kernel/tools/defaults.py6
-rw-r--r--libc/kernel/uapi/asm-generic/param.h3
5 files changed, 12 insertions, 9 deletions
diff --git a/libc/dns/include/resolv_private.h b/libc/dns/include/resolv_private.h
index 4a832d0e3..0dab3d836 100644
--- a/libc/dns/include/resolv_private.h
+++ b/libc/dns/include/resolv_private.h
@@ -63,6 +63,13 @@
/* Despite this file's name, it's part of libresolv. On Android, that means it's part of libc :-( */
#pragma GCC visibility push(default)
+// Linux defines MAXHOSTNAMELEN as 64, while the domain name limit in
+// RFC 1034 and RFC 1035 is 255 octets.
+#ifdef MAXHOSTNAMELEN
+#undef MAXHOSTNAMELEN
+#endif
+#define MAXHOSTNAMELEN 256
+
/*
* Revision information. This is the release date in YYYYMMDD format.
* It can change every day so the right thing to do with it is use it
diff --git a/libc/include/netdb.h b/libc/include/netdb.h
index e16537629..3bb973c2d 100644
--- a/libc/include/netdb.h
+++ b/libc/include/netdb.h
@@ -73,9 +73,6 @@
#define _PATH_PROTOCOLS "/system/etc/protocols"
#define _PATH_SERVICES "/system/etc/services"
-#define MAXHOSTNAMELEN 256
-
-
/*
* Structures returned by network data base library. All addresses are
* supplied in host order, and returned in network order (suitable for
diff --git a/libc/include/sys/param.h b/libc/include/sys/param.h
index 03a462e98..e64d6ce3c 100644
--- a/libc/include/sys/param.h
+++ b/libc/include/sys/param.h
@@ -29,8 +29,8 @@
#define _SYS_PARAM_H_
#include <limits.h>
+#include <linux/param.h>
-#define HZ 100
#define MAXPATHLEN PATH_MAX
#define MAXSYMLINKS 8
diff --git a/libc/kernel/tools/defaults.py b/libc/kernel/tools/defaults.py
index 2efd45566..8aba9985a 100644
--- a/libc/kernel/tools/defaults.py
+++ b/libc/kernel/tools/defaults.py
@@ -118,10 +118,8 @@ kernel_known_statics = {
# the generated files.
#
kernel_ignored_macros = set(
- [ "MAXHOSTNAMELEN", # for some reason, Linux defines it to 64
- # while most of the BSD code expects this to be 256
- # so ignore the kernel-provided definition and
- # define it in the Bionic headers instead
+ [
+
]
)
diff --git a/libc/kernel/uapi/asm-generic/param.h b/libc/kernel/uapi/asm-generic/param.h
index aa2186408..6bde154ca 100644
--- a/libc/kernel/uapi/asm-generic/param.h
+++ b/libc/kernel/uapi/asm-generic/param.h
@@ -29,5 +29,6 @@
#ifndef NOGROUP
#define NOGROUP (- 1)
#endif
-#endif
+#define MAXHOSTNAMELEN 64
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#endif