xref: /titanic_52/usr/src/cmd/sendmail/include/sm/limits.h (revision e1c679fa4b0ab8c4bcaa6263974ca0c46e5b027f)
1 /*
2  * Copyright (c) 2000-2001 Sendmail, Inc. and its suppliers.
3  *	All rights reserved.
4  *
5  * By using this file, you agree to the terms and conditions set
6  * forth in the LICENSE file which can be found at the top level of
7  * the sendmail distribution.
8  *
9  *	$Id: limits.h,v 1.6 2001/03/08 03:23:08 ca Exp $
10  */
11 
12 #pragma ident	"%Z%%M%	%I%	%E% SMI"
13 
14 /*
15 **  <sm/limits.h>
16 **  This header file is a portability wrapper for <limits.h>.
17 **  It includes <limits.h>, then it ensures that the following macros
18 **  from the C 1999 standard for <limits.h> are defined:
19 **	LLONG_MIN, LLONG_MAX
20 **	ULLONG_MAX
21 */
22 
23 #ifndef SM_LIMITS_H
24 # define SM_LIMITS_H
25 
26 # include <limits.h>
27 # include <sm/types.h>
28 # include <sys/param.h>
29 
30 /*
31 **  The following assumes two's complement binary arithmetic.
32 */
33 
34 # ifndef LLONG_MIN
35 #  define LLONG_MIN	((LONGLONG_T)(~(ULLONG_MAX >> 1)))
36 # endif /* ! LLONG_MIN */
37 # ifndef LLONG_MAX
38 #  define LLONG_MAX	((LONGLONG_T)(ULLONG_MAX >> 1))
39 # endif /* ! LLONG_MAX */
40 # ifndef ULLONG_MAX
41 #  define ULLONG_MAX	((ULONGLONG_T)(-1))
42 # endif /* ! ULLONG_MAX */
43 
44 /*
45 **  PATH_MAX is defined by the POSIX standard.  All modern systems
46 **  provide it.  Older systems define MAXPATHLEN in <sys/param.h> instead.
47 */
48 
49 # ifndef PATH_MAX
50 #  ifdef MAXPATHLEN
51 #   define PATH_MAX	MAXPATHLEN
52 #  else /* MAXPATHLEN */
53 #   define PATH_MAX	2048
54 #  endif /* MAXPATHLEN */
55 # endif /* ! PATH_MAX */
56 
57 #endif /* ! SM_LIMITS_H */
58