[PATCH] POSIX01: implement mandatory constants in limits.h

Andy Shevchenko <[email protected]>
Newsgroups gmane.os.netbsd.devel.general
Message-ID <[email protected]>
Implement mandatory _POSIX_SYMLOOP_MAX and _POSIX_HOST_NAME_MAX constants. So,
MAXSYMLINKS and MAXHOSTNAMELEN should be synchronized somehow with them.
---
 include/limits.h |    2 ++
 sys/sys/param.h  |    3 +++
 2 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/include/limits.h b/include/limits.h
index ea8d96d..7a1985b 100644
--- a/include/limits.h
+++ b/include/limits.h
@@ -42,6 +42,7 @@
 #define	_POSIX_AIO_MAX		1
 #define	_POSIX_ARG_MAX		4096
 #define	_POSIX_CHILD_MAX	25
+#define	_POSIX_HOST_NAME_MAX	255
 #define	_POSIX_LINK_MAX		8
 #define	_POSIX_LOGIN_NAME_MAX	9
 #define	_POSIX_MAX_CANON	255
@@ -57,6 +58,7 @@
 #define	_POSIX_SSIZE_MAX	32767
 #define	_POSIX_STREAM_MAX	8
 #define	_POSIX_SYMLINK_MAX	255
+#define	_POSIX_SYMLOOP_MAX	8
 #define	_POSIX_THREAD_DESTRUCTOR_ITERATIONS	4
 #define	_POSIX_THREAD_KEYS_MAX	128
 #define	_POSIX_THREAD_THREADS_MAX		64
diff --git a/sys/sys/param.h b/sys/sys/param.h
index 561938b..e97e885 100644
--- a/sys/sys/param.h
+++ b/sys/sys/param.h
@@ -94,6 +94,7 @@
  * Redefined constants are from POSIX 1003.1 limits file.
  *
  * MAXCOMLEN should be >= sizeof(ac_comm) (see <acct.h>)
+ * MAXHOSTNAMELEN should be >= (_POSIX_HOST_NAME_MAX + 1) (see <limits.h>)
  * MAXLOGNAME should be >= UT_NAMESIZE (see <utmp.h>)
  */
 #include <sys/syslimits.h>
@@ -310,6 +311,8 @@
  * maximum number of symbolic links that may be expanded in a path name.
  * It should be set high enough to allow all legitimate uses, but halt
  * infinite loops reasonably quickly.
+ *
+ * MAXSYMLINKS should be >= _POSIX_SYMLOOP_MAX (see <limits.h>)
  */
 #define	MAXPATHLEN	PATH_MAX
 #define	MAXSYMLINKS	32
-- 
1.5.2.5
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.