summaryrefslogtreecommitdiffstats
path: root/include/c.h
diff options
context:
space:
mode:
authorKarel Zak2012-05-29 10:08:25 +0200
committerKarel Zak2012-05-29 10:08:25 +0200
commit3a9c3f3fb757dd04b8ac44c575c65dda6bae054b (patch)
treecb920932374f707a4083d3db1205e52c86aac0fd /include/c.h
parentlogger: use memcpy instead of bcopy (diff)
downloadkernel-qcow2-util-linux-3a9c3f3fb757dd04b8ac44c575c65dda6bae054b.tar.gz
kernel-qcow2-util-linux-3a9c3f3fb757dd04b8ac44c575c65dda6bae054b.tar.xz
kernel-qcow2-util-linux-3a9c3f3fb757dd04b8ac44c575c65dda6bae054b.zip
include/c: move fallback for MAXHOSTNAMELEN to c.h
Reported-by: Thomas Schwinge <thomas@codesourcery.com> Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'include/c.h')
-rw-r--r--include/c.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/c.h b/include/c.h
index 8c8db7332..40d289bf7 100644
--- a/include/c.h
+++ b/include/c.h
@@ -223,6 +223,17 @@ static inline int dirfd(DIR *d)
#endif
/*
+ * Fallback for MAXHOSTNAMELEN
+ */
+#ifndef MAXHOSTNAMELEN
+# ifdef HOST_NAME_MAX
+# define MAXHOSTNAMELEN HOST_NAME_MAX
+# else
+# define MAXHOSTNAMELEN 64
+# endif
+#endif
+
+/*
* Constant strings for usage() functions. For more info see
* Documentation/howto-usage-function.txt and sys-utils/arch.c
*/