os/ossrv/genericopenlibs/openenvcore/include/sys/limits.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/ossrv/genericopenlibs/openenvcore/include/sys/limits.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,96 @@
     1.4 +/*-
     1.5 + * Copyright (c) 1988, 1993
     1.6 + *	The Regents of the University of California.  All rights reserved.
     1.7 + *
     1.8 + * Redistribution and use in source and binary forms, with or without
     1.9 + * modification, are permitted provided that the following conditions
    1.10 + * are met:
    1.11 + * 1. Redistributions of source code must retain the above copyright
    1.12 + *    notice, this list of conditions and the following disclaimer.
    1.13 + * 2. Redistributions in binary form must reproduce the above copyright
    1.14 + *    notice, this list of conditions and the following disclaimer in the
    1.15 + *    documentation and/or other materials provided with the distribution.
    1.16 + * 4. Neither the name of the University nor the names of its contributors
    1.17 + *    may be used to endorse or promote products derived from this software
    1.18 + *    without specific prior written permission.
    1.19 + *
    1.20 + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
    1.21 + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
    1.22 + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
    1.23 + * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
    1.24 + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
    1.25 + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
    1.26 + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
    1.27 + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
    1.28 + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
    1.29 + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    1.30 + * SUCH DAMAGE.
    1.31 + *
    1.32 + * $FreeBSD: src/sys/sys/limits.h,v 1.9 2005/01/07 02:29:23 imp Exp $
    1.33 + */
    1.34 +
    1.35 +#ifndef _SYS_LIMITS_H_
    1.36 +#define	_SYS_LIMITS_H_
    1.37 +
    1.38 +#include <sys/cdefs.h>
    1.39 +#include <stdapis/machine/_limits.h>
    1.40 +
    1.41 +#define	CHAR_BIT	__CHAR_BIT	/* number of bits in a char */
    1.42 +
    1.43 +#define	SCHAR_MAX	__SCHAR_MAX	/* max value for a signed char */
    1.44 +#define	SCHAR_MIN	__SCHAR_MIN	/* min value for a signed char */
    1.45 +
    1.46 +#define	UCHAR_MAX	__UCHAR_MAX	/* max value for an unsigned char */
    1.47 +
    1.48 +#ifdef __CHAR_UNSIGNED__
    1.49 +#define	CHAR_MAX	UCHAR_MAX	/* max value for a char */
    1.50 +#define	CHAR_MIN	0		/* min value for a char */
    1.51 +#else
    1.52 +#define	CHAR_MAX	SCHAR_MAX
    1.53 +#define	CHAR_MIN	SCHAR_MIN
    1.54 +#endif
    1.55 +
    1.56 +#define	USHRT_MAX	__USHRT_MAX	/* max value for an unsigned short */
    1.57 +#define	SHRT_MAX	__SHRT_MAX	/* max value for a short */
    1.58 +#define	SHRT_MIN	__SHRT_MIN	/* min value for a short */
    1.59 +
    1.60 +#define	UINT_MAX	__UINT_MAX	/* max value for an unsigned int */
    1.61 +#define	INT_MAX		__INT_MAX	/* max value for an int */
    1.62 +#define	INT_MIN		__INT_MIN	/* min value for an int */
    1.63 +
    1.64 +#define	ULONG_MAX	__ULONG_MAX	/* max for an unsigned long */
    1.65 +#define	LONG_MAX	__LONG_MAX	/* max for a long */
    1.66 +#define	LONG_MIN	__LONG_MIN	/* min for a long */
    1.67 +
    1.68 +#ifdef __LONG_LONG_SUPPORTED
    1.69 +#define	ULLONG_MAX	__ULLONG_MAX	/* max for an unsigned long long */
    1.70 +#define	LLONG_MAX	__LLONG_MAX	/* max for a long long */
    1.71 +#define	LLONG_MIN	__LLONG_MIN	/* min for a long long */
    1.72 +#endif
    1.73 +
    1.74 +#if __POSIX_VISIBLE || __XSI_VISIBLE
    1.75 +#define	SSIZE_MAX	__SSIZE_MAX	/* max value for an ssize_t */
    1.76 +#endif
    1.77 +
    1.78 +#if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE
    1.79 +#define	SIZE_T_MAX	__SIZE_T_MAX	/* max value for a size_t */
    1.80 +
    1.81 +#define	OFF_MAX		__OFF_MAX	/* max value for an off_t */
    1.82 +#define	OFF_MIN		__OFF_MIN	/* min value for an off_t */
    1.83 +#endif
    1.84 +
    1.85 +#if __BSD_VISIBLE
    1.86 +#define	GID_MAX		UINT_MAX	/* max value for a gid_t */
    1.87 +#define	UID_MAX		UINT_MAX	/* max value for a uid_t */
    1.88 +
    1.89 +#define	UQUAD_MAX	(__UQUAD_MAX)	/* max value for a uquad_t */
    1.90 +#define	QUAD_MAX	(__QUAD_MAX)	/* max value for a quad_t */
    1.91 +#define	QUAD_MIN	(__QUAD_MIN)	/* min value for a quad_t */
    1.92 +#endif
    1.93 +
    1.94 +#if __XSI_VISIBLE
    1.95 +#define	LONG_BIT	__LONG_BIT
    1.96 +#define	WORD_BIT	__WORD_BIT
    1.97 +#endif
    1.98 +
    1.99 +#endif /* !_SYS_LIMITS_H_ */