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