limits.h: add define for HOST_NAME_MAX

according to the rules defined here:
    http://pubs.opengroup.org/onlinepubs/009695399/basedefs/limits.h.html
add the definition for HOST_NAME_MAX to limits.h file,
and set the default value to _POSIX_HOST_NAME_MAX as 255

Change-Id: Iddd5c6c569f4e0a14994c7a7c54985f3e7809fc4
Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
This commit is contained in:
Yongqin Liu 2014-10-29 14:47:47 +08:00
parent e23f564b52
commit 0589777a33
2 changed files with 2 additions and 0 deletions

View File

@ -97,4 +97,5 @@
/* POSIX says these belong in <unistd.h> but BSD has some in <limits.h>. */
#include <machine/posix_limits.h>
#define HOST_NAME_MAX _POSIX_HOST_NAME_MAX
#endif /* !_LIMITS_H_ */

View File

@ -37,6 +37,7 @@
#define _POSIX_CHOWN_RESTRICTED 1 /* yes, chown requires appropriate privileges */
#define _POSIX_FSYNC 1 /* fdatasync() supported */
#define _POSIX_JOB_CONTROL 1 /* job control is a Linux feature */
#define _POSIX_HOST_NAME_MAX 255
#define _POSIX_LINK_MAX 8
#define _POSIX_LOGIN_NAME_MAX 9 /* includes trailing NUL */
#define _POSIX_MAPPED_FILES 1 /* mmap-ed files supported */