190792Sgshapiro/*
2261363Sgshapiro * Copyright (c) 2000-2001 Proofpoint, Inc. and its suppliers.
390792Sgshapiro *	All rights reserved.
490792Sgshapiro *
590792Sgshapiro * By using this file, you agree to the terms and conditions set
690792Sgshapiro * forth in the LICENSE file which can be found at the top level of
790792Sgshapiro * the sendmail distribution.
890792Sgshapiro *
9266692Sgshapiro *	$Id: limits.h,v 1.7 2013-11-22 20:51:31 ca Exp $
1090792Sgshapiro */
1190792Sgshapiro
1290792Sgshapiro/*
1390792Sgshapiro**  <sm/limits.h>
1490792Sgshapiro**  This header file is a portability wrapper for <limits.h>.
1590792Sgshapiro**  It includes <limits.h>, then it ensures that the following macros
1690792Sgshapiro**  from the C 1999 standard for <limits.h> are defined:
1790792Sgshapiro**	LLONG_MIN, LLONG_MAX
1890792Sgshapiro**	ULLONG_MAX
1990792Sgshapiro*/
2090792Sgshapiro
2190792Sgshapiro#ifndef SM_LIMITS_H
2290792Sgshapiro# define SM_LIMITS_H
2390792Sgshapiro
2490792Sgshapiro# include <limits.h>
2590792Sgshapiro# include <sm/types.h>
2690792Sgshapiro# include <sys/param.h>
2790792Sgshapiro
2890792Sgshapiro/*
2990792Sgshapiro**  The following assumes two's complement binary arithmetic.
3090792Sgshapiro*/
3190792Sgshapiro
3290792Sgshapiro# ifndef LLONG_MIN
3390792Sgshapiro#  define LLONG_MIN	((LONGLONG_T)(~(ULLONG_MAX >> 1)))
3490792Sgshapiro# endif /* ! LLONG_MIN */
3590792Sgshapiro# ifndef LLONG_MAX
3690792Sgshapiro#  define LLONG_MAX	((LONGLONG_T)(ULLONG_MAX >> 1))
3790792Sgshapiro# endif /* ! LLONG_MAX */
3890792Sgshapiro# ifndef ULLONG_MAX
3990792Sgshapiro#  define ULLONG_MAX	((ULONGLONG_T)(-1))
4090792Sgshapiro# endif /* ! ULLONG_MAX */
4190792Sgshapiro
4290792Sgshapiro/*
4390792Sgshapiro**  PATH_MAX is defined by the POSIX standard.  All modern systems
4490792Sgshapiro**  provide it.  Older systems define MAXPATHLEN in <sys/param.h> instead.
4590792Sgshapiro*/
4690792Sgshapiro
4790792Sgshapiro# ifndef PATH_MAX
4890792Sgshapiro#  ifdef MAXPATHLEN
4990792Sgshapiro#   define PATH_MAX	MAXPATHLEN
5090792Sgshapiro#  else /* MAXPATHLEN */
5190792Sgshapiro#   define PATH_MAX	2048
5290792Sgshapiro#  endif /* MAXPATHLEN */
5390792Sgshapiro# endif /* ! PATH_MAX */
5490792Sgshapiro
5590792Sgshapiro#endif /* ! SM_LIMITS_H */
56