Lacking <limits.h> (Was: Re: PAX won't make on my UNIX PC)

Mark H. Colburn mark at jhereg.Jhereg.MN.ORG
Sun Feb 12 02:15:58 AEST 1989


In article <17934 at vax5.CIT.CORNELL.EDU> jhc at vax5.cit.cornell.edu (James H. Cloos, Jr.) writes:
>It appears that the NeXTs are also lacking <limits.h>.  And that with gcc as
>the standard compiler.

I beleive it is not included because some of the values are somewhat
hardware dependant.  I have a limits.h which is the minimum required by
ANSI and POSIX, you may use it if you like...

/* $Source: /u/mark/src/ansi/RCS/limits.h,v $
 *
 * $Revision: 1.1 $
 *
 * limits.h - ANSI/POSIX compatible defnitions
 *
 * DESCRIPTION
 *
 * 	These values where taken from ANSI C (X3J11-10/88) and the IEEE 
 *	1003.1-88 standard.  All of the values below are the MINIMUM values 
 *	allowed by the standards. 
 *
 * AUTHOR
 *
 *     Mark H. Colburn, Minnetech Consulting, Inc. (mark at jhereg.mn.org)
 */

#ifndef __LIMITS_H
#define __LIMITS_H

/* Defines */

#define CHAR_BIT	8		/* number of bits in a "char" */
#define CHAR_MAX	UCHAR_MAX	/* max value for "char" */
/* #define CHAR_MAX	SCHAR_MAX 	/* */
#define CHAR_MIN	0		/* min value for "char" */
/* #define CHAR_MIN	SCHAR_MIN	/* */
#define INT_MAX		32767		/* max value for "int" */
#define INT_MIN		-32767		/* min value for "int" */
#define LONG_MAX	2147483647	/* max value for "long int" */
#define LONG_MIN	-2147483647	/* min value for "long int" */
#define MB_LEN_MAX	1		/* max bytes in a multibyte char */
#define SCHAR_MAX	127		/* max value for "signed char" */
#define SCHAR_MIN	-127		/* min value for "signed char" */
#define SHRT_MAX	32767		/* max value for "short int" */
#define SHRT_MIN	-32767		/* min value for "short int" */
#define UCHAR_MAX	255		/* max value for "unsigned char" */
#define UINT_MAX	65535		/* max value for "unsigned int" */
#define ULONG_MAX	4294967295	/* max value for "unsigned long" */
#define USHRT_MAX	65535		/* max value for "unsigned short" */

#ifdef _POSIX_SOURCE

#define MAX_INPUT	256	/* Max numbef of bytes in terminal input */
#define NGROUPS_MAX	1	/* Max number of suplemental group id's */
#define PASS_MAX	8	/* Max number of bytes in a password */
#define PID_MAX		30000	/* Max value for a process ID */
#define UID_MAX		32000	/* Max value for a user or group ID */
#define ARG_MAX		4096	/* Nax number of bytes passed to exec */
#define CHILD_MAX	6	/* Max number of simultaneous processes */
#define MAX_CANON	256	/* Max numbef of bytes in a cononical queue */
#define OPEN_MAX	16	/* Nax number of open files per process */
#define NAME_MAX	14	/* Max number of bytes in a file name */
#define PATH_MAX	255	/* Max number of bytes in pathname */
#define LINK_MAX	8	/* Max value of a file's link count */
#define PIPE_BUF	512	/* Max number of bytes for pipe reads */

#endif /* _POSIX_SOURCE */
#endif /* __LIMITS_H */
-- 
Mark H. Colburn                  "Look into a child's eye;
Minnetech Consulting, Inc.        there's no hate and there's no lie;
mark at jhereg.mn.org                there's no black and there's no white."



More information about the Comp.sources.bugs mailing list