1*39ef54bdSmillert /* $OpenBSD: limits.h,v 1.14 2015/04/30 13:42:08 millert Exp $ */ 29c0b8818Smickey 39c0b8818Smickey /* 49c0b8818Smickey * Copyright (c) 1988, 1993 59c0b8818Smickey * The Regents of the University of California. All rights reserved. 69c0b8818Smickey * 79c0b8818Smickey * Redistribution and use in source and binary forms, with or without 89c0b8818Smickey * modification, are permitted provided that the following conditions 99c0b8818Smickey * are met: 109c0b8818Smickey * 1. Redistributions of source code must retain the above copyright 119c0b8818Smickey * notice, this list of conditions and the following disclaimer. 129c0b8818Smickey * 2. Redistributions in binary form must reproduce the above copyright 139c0b8818Smickey * notice, this list of conditions and the following disclaimer in the 149c0b8818Smickey * documentation and/or other materials provided with the distribution. 1529295d1cSmillert * 3. Neither the name of the University nor the names of its contributors 169c0b8818Smickey * may be used to endorse or promote products derived from this software 179c0b8818Smickey * without specific prior written permission. 189c0b8818Smickey * 199c0b8818Smickey * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 209c0b8818Smickey * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 219c0b8818Smickey * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 229c0b8818Smickey * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 239c0b8818Smickey * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 249c0b8818Smickey * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 259c0b8818Smickey * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 269c0b8818Smickey * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 279c0b8818Smickey * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 289c0b8818Smickey * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 299c0b8818Smickey * SUCH DAMAGE. 309c0b8818Smickey * 319c0b8818Smickey * @(#)limits.h 8.3 (Berkeley) 1/4/94 329c0b8818Smickey */ 339c0b8818Smickey 34b5036baaSmiod #ifndef _MACHINE_LIMITS_H_ 35b5036baaSmiod #define _MACHINE_LIMITS_H_ 36b5036baaSmiod 377c2ef5d9Smillert #include <sys/cdefs.h> 387c2ef5d9Smillert 397c2ef5d9Smillert #if __POSIX_VISIBLE || __XPG_VISIBLE 408bc47e72Skettenis #define SSIZE_MAX LONG_MAX /* max value for a ssize_t */ 417c2ef5d9Smillert #endif 429c0b8818Smickey 437c2ef5d9Smillert #if __BSD_VISIBLE 448bc47e72Skettenis #define SIZE_T_MAX ULONG_MAX /* max value for a size_t (historic) */ 459c0b8818Smickey 469c0b8818Smickey /* GCC requires that quad constants be written as expressions. */ 479c0b8818Smickey #define UQUAD_MAX ((u_quad_t)0-1) /* max value for a uquad_t */ 489c0b8818Smickey /* max value for a quad_t */ 499c0b8818Smickey #define QUAD_MAX ((quad_t)(UQUAD_MAX >> 1)) 509c0b8818Smickey #define QUAD_MIN (-QUAD_MAX-1) /* min value for a quad_t */ 519c0b8818Smickey 527c2ef5d9Smillert #endif /* __BSD_VISIBLE */ 53b5036baaSmiod 54b5036baaSmiod #endif /* _MACHINE_LIMITS_H_ */ 55