summaryrefslogtreecommitdiff
path: root/ace/os_include/limits.h
diff options
context:
space:
mode:
Diffstat (limited to 'ace/os_include/limits.h')
-rw-r--r--ace/os_include/limits.h69
1 files changed, 64 insertions, 5 deletions
diff --git a/ace/os_include/limits.h b/ace/os_include/limits.h
index b0637b318a3..6abbae3263b 100644
--- a/ace/os_include/limits.h
+++ b/ace/os_include/limits.h
@@ -2,19 +2,19 @@
//=============================================================================
/**
- * @file limits.h
+ * @file os_limits.h
*
* implementation-defined constants
*
* $Id$
*
- * @author Don Hinton <dhinton@ieee.org>
+ * @author Don Hinton <dhinton@dresystems.com>
* @author This code was originally in various places including ace/OS.h.
*/
//=============================================================================
-#ifndef ACE_OS_INCLUDE_LIMITS_H
-#define ACE_OS_INCLUDE_LIMITS_H
+#ifndef ACE_OS_INCLUDE_OS_LIMITS_H
+#define ACE_OS_INCLUDE_OS_LIMITS_H
#include "ace/pre.h"
@@ -30,5 +30,64 @@
# include /**/ <limits.h>
#endif /* !ACE_LACKS_LIMITS_H */
+#if !defined (ACE_LACKS_PARAM_H)
+# include /**/ <sys/param.h>
+#endif /* ACE_LACKS_PARAM_H */
+
+// Place all additions (especially function declarations) within extern "C" {}
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+#if ! defined (howmany)
+# define howmany(x, y) (((x)+((y)-1))/(y))
+#endif /* howmany */
+
+#if !defined (NAME_MAX)
+# if defined (MAXNAMLEN)
+# define NAME_MAX MAXNAMLEN
+# elif defined (MAXNAMELEN)
+# define NAME_MAX MAXNAMELEN
+# elif defined (FILENAME_MAX)
+# define NAME_MAX FILENAME_MAX
+# elif defined (_MAX_FNAME)
+# define NAME_MAX _MAX_FNAME
+# else /* _MAX_FNAME */
+# define NAME_MAX 256
+# endif /* MAXNAMLEN */
+#endif /* !NAME_MAX */
+
+#if !defined (MAXNAMELEN)
+# define MAXNAMELEN NAME_MAX
+#endif /* MAXNAMELEN */
+
+#if !defined (HOST_NAME_MAX)
+# define HOST_NAME_MAX 256
+#endif /* !HOST_NAME_MAX */
+
+// Note that we are using PATH_MAX instead of _POSIX_PATH_MAX, since
+// _POSIX_PATH_MAX is the *minimun* maximum value for PATH_MAX and is
+// defined by POSIX as 256.
+#if !defined (PATH_MAX)
+# if defined (_MAX_PATH)
+# define PATH_MAX _MAX_PATH
+# elif defined (MAX_PATH)
+# define PATH_MAX MAX_PATH
+# else /* !_MAX_PATH */
+# define PATH_MAX 1024
+# endif /* _MAX_PATH */
+#endif /* !PATH_MAX */
+
+// Leaving this for backward compatibility, but PATH_MAX should always be
+// used directly.
+#if !defined (MAXPATHLEN)
+# define MAXPATHLEN PATH_MAX
+#endif /* !MAXPATHLEN */
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
#include "ace/post.h"
-#endif /* ACE_OS_INCLUDE_LIMITS_H */
+#endif /* ACE_OS_INCLUDE_OS_LIMITS_H */