From 624b8d0776fd1180172916bbbfa7bfb492f04ea6 Mon Sep 17 00:00:00 2001 From: anjiahao Date: Wed, 24 Nov 2021 16:57:16 +0800 Subject: [PATCH] add MAXHOSTNAMELEN in headfile Signed-off-by: anjiahao --- include/limits.h | 2 ++ include/sys/param.h | 4 ++++ include/unistd.h | 3 +-- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/include/limits.h b/include/limits.h index 9836f159c2..59f14a8f0d 100644 --- a/include/limits.h +++ b/include/limits.h @@ -303,4 +303,6 @@ #define IOV_MAX INT_MAX +#define HOST_NAME_MAX 32 + #endif /* __INCLUDE_LIMITS_H */ diff --git a/include/sys/param.h b/include/sys/param.h index 3839cdd29d..5d29d3ce34 100644 --- a/include/sys/param.h +++ b/include/sys/param.h @@ -25,10 +25,14 @@ * Included Files ****************************************************************************/ +#include + /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ +#define MAXHOSTNAMELEN HOST_NAME_MAX + /**************************************************************************** * Public Type Definitions ****************************************************************************/ diff --git a/include/unistd.h b/include/unistd.h index 41a5213a7d..63e5cdd506 100644 --- a/include/unistd.h +++ b/include/unistd.h @@ -27,6 +27,7 @@ #include #include +#include /**************************************************************************** * Pre-processor Definitions @@ -256,8 +257,6 @@ #define STDIN_FILENO 0 /* File number of stdin */ #define STDOUT_FILENO 1 /* File number of stdout */ -#define HOST_NAME_MAX 32 - /* Helpers and legacy compatibility definitions */ #define link(p1, p2) symlink((p1), (p2))