os/ossrv/genericopenlibs/openenvcore/include/sys/limits.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
sl@0
     1
/*-
sl@0
     2
 * Copyright (c) 1988, 1993
sl@0
     3
 *	The Regents of the University of California.  All rights reserved.
sl@0
     4
 *
sl@0
     5
 * Redistribution and use in source and binary forms, with or without
sl@0
     6
 * modification, are permitted provided that the following conditions
sl@0
     7
 * are met:
sl@0
     8
 * 1. Redistributions of source code must retain the above copyright
sl@0
     9
 *    notice, this list of conditions and the following disclaimer.
sl@0
    10
 * 2. Redistributions in binary form must reproduce the above copyright
sl@0
    11
 *    notice, this list of conditions and the following disclaimer in the
sl@0
    12
 *    documentation and/or other materials provided with the distribution.
sl@0
    13
 * 4. Neither the name of the University nor the names of its contributors
sl@0
    14
 *    may be used to endorse or promote products derived from this software
sl@0
    15
 *    without specific prior written permission.
sl@0
    16
 *
sl@0
    17
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
sl@0
    18
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
sl@0
    19
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
sl@0
    20
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
sl@0
    21
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
sl@0
    22
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
sl@0
    23
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
sl@0
    24
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
sl@0
    25
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
sl@0
    26
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
sl@0
    27
 * SUCH DAMAGE.
sl@0
    28
 *
sl@0
    29
 * $FreeBSD: src/sys/sys/limits.h,v 1.9 2005/01/07 02:29:23 imp Exp $
sl@0
    30
 */
sl@0
    31
sl@0
    32
#ifndef _SYS_LIMITS_H_
sl@0
    33
#define	_SYS_LIMITS_H_
sl@0
    34
sl@0
    35
#include <sys/cdefs.h>
sl@0
    36
#include <stdapis/machine/_limits.h>
sl@0
    37
sl@0
    38
#define	CHAR_BIT	__CHAR_BIT	/* number of bits in a char */
sl@0
    39
sl@0
    40
#define	SCHAR_MAX	__SCHAR_MAX	/* max value for a signed char */
sl@0
    41
#define	SCHAR_MIN	__SCHAR_MIN	/* min value for a signed char */
sl@0
    42
sl@0
    43
#define	UCHAR_MAX	__UCHAR_MAX	/* max value for an unsigned char */
sl@0
    44
sl@0
    45
#ifdef __CHAR_UNSIGNED__
sl@0
    46
#define	CHAR_MAX	UCHAR_MAX	/* max value for a char */
sl@0
    47
#define	CHAR_MIN	0		/* min value for a char */
sl@0
    48
#else
sl@0
    49
#define	CHAR_MAX	SCHAR_MAX
sl@0
    50
#define	CHAR_MIN	SCHAR_MIN
sl@0
    51
#endif
sl@0
    52
sl@0
    53
#define	USHRT_MAX	__USHRT_MAX	/* max value for an unsigned short */
sl@0
    54
#define	SHRT_MAX	__SHRT_MAX	/* max value for a short */
sl@0
    55
#define	SHRT_MIN	__SHRT_MIN	/* min value for a short */
sl@0
    56
sl@0
    57
#define	UINT_MAX	__UINT_MAX	/* max value for an unsigned int */
sl@0
    58
#define	INT_MAX		__INT_MAX	/* max value for an int */
sl@0
    59
#define	INT_MIN		__INT_MIN	/* min value for an int */
sl@0
    60
sl@0
    61
#define	ULONG_MAX	__ULONG_MAX	/* max for an unsigned long */
sl@0
    62
#define	LONG_MAX	__LONG_MAX	/* max for a long */
sl@0
    63
#define	LONG_MIN	__LONG_MIN	/* min for a long */
sl@0
    64
sl@0
    65
#ifdef __LONG_LONG_SUPPORTED
sl@0
    66
#define	ULLONG_MAX	__ULLONG_MAX	/* max for an unsigned long long */
sl@0
    67
#define	LLONG_MAX	__LLONG_MAX	/* max for a long long */
sl@0
    68
#define	LLONG_MIN	__LLONG_MIN	/* min for a long long */
sl@0
    69
#endif
sl@0
    70
sl@0
    71
#if __POSIX_VISIBLE || __XSI_VISIBLE
sl@0
    72
#define	SSIZE_MAX	__SSIZE_MAX	/* max value for an ssize_t */
sl@0
    73
#endif
sl@0
    74
sl@0
    75
#if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE
sl@0
    76
#define	SIZE_T_MAX	__SIZE_T_MAX	/* max value for a size_t */
sl@0
    77
sl@0
    78
#define	OFF_MAX		__OFF_MAX	/* max value for an off_t */
sl@0
    79
#define	OFF_MIN		__OFF_MIN	/* min value for an off_t */
sl@0
    80
#endif
sl@0
    81
sl@0
    82
#if __BSD_VISIBLE
sl@0
    83
#define	GID_MAX		UINT_MAX	/* max value for a gid_t */
sl@0
    84
#define	UID_MAX		UINT_MAX	/* max value for a uid_t */
sl@0
    85
sl@0
    86
#define	UQUAD_MAX	(__UQUAD_MAX)	/* max value for a uquad_t */
sl@0
    87
#define	QUAD_MAX	(__QUAD_MAX)	/* max value for a quad_t */
sl@0
    88
#define	QUAD_MIN	(__QUAD_MIN)	/* min value for a quad_t */
sl@0
    89
#endif
sl@0
    90
sl@0
    91
#if __XSI_VISIBLE
sl@0
    92
#define	LONG_BIT	__LONG_BIT
sl@0
    93
#define	WORD_BIT	__WORD_BIT
sl@0
    94
#endif
sl@0
    95
sl@0
    96
#endif /* !_SYS_LIMITS_H_ */