You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2021/11/25 04:49:18 UTC
[incubator-nuttx] branch master updated: add MAXHOSTNAMELEN in headfile
This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new 624b8d0 add MAXHOSTNAMELEN in headfile
624b8d0 is described below
commit 624b8d0776fd1180172916bbbfa7bfb492f04ea6
Author: anjiahao <an...@xiaomi.com>
AuthorDate: Wed Nov 24 16:57:16 2021 +0800
add MAXHOSTNAMELEN in headfile
Signed-off-by: anjiahao <an...@xiaomi.com>
---
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 9836f15..59f14a8 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 3839cdd..5d29d3c 100644
--- a/include/sys/param.h
+++ b/include/sys/param.h
@@ -25,10 +25,14 @@
* Included Files
****************************************************************************/
+#include <limits.h>
+
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
+#define MAXHOSTNAMELEN HOST_NAME_MAX
+
/****************************************************************************
* Public Type Definitions
****************************************************************************/
diff --git a/include/unistd.h b/include/unistd.h
index 41a5213..63e5cdd 100644
--- a/include/unistd.h
+++ b/include/unistd.h
@@ -27,6 +27,7 @@
#include <sys/types.h>
#include <nuttx/compiler.h>
+#include <limits.h>
/****************************************************************************
* 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))