Print this page
5880 Increase IOV_MAX to at least 1024
Portions contributed by: Jerry Jelinek <jerry.jelinek@joyent.com>


   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 
  22 /*
  23  * Copyright (c) 2013 Gary Mills
  24  * Copyright 2017 RackTop Systems.
  25  *
  26  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
  27  * Use is subject to license terms.

  28  */
  29 
  30 /*      Copyright (c) 1988 AT&T     */
  31 /*        All Rights Reserved   */
  32 
  33 
  34 #ifndef _LIMITS_H
  35 #define _LIMITS_H
  36 
  37 #include <sys/feature_tests.h>
  38 #include <sys/isa_defs.h>
  39 #include <iso/limits_iso.h>

  40 
  41 /*
  42  * Include fixed width type limits as proposed by the ISO/JTC1/SC22/WG14 C
  43  * committee's working draft for the revision of the current ISO C standard,
  44  * ISO/IEC 9899:1990 Programming language - C.  These are not currently
  45  * required by any standard but constitute a useful, general purpose set
  46  * of type definitions and limits which is namespace clean with respect to
  47  * all standards.
  48  */
  49 #if defined(__EXTENSIONS__) || !defined(_STRICT_STDC) || \
  50         defined(__XOPEN_OR_POSIX)
  51 #include <sys/int_limits.h>
  52 #endif
  53 
  54 #ifdef  __cplusplus
  55 extern "C" {
  56 #endif
  57 
  58 #if defined(__EXTENSIONS__) || !defined(_STRICT_STDC) || \
  59         defined(__XOPEN_OR_POSIX)


 226                                                         /* of a double */
 227 #define FLT_DIG         6               /* digits of precision of a "float" */
 228 #define FLT_MAX         3.4028234663852885981170E+38F   /* max decimal value */
 229                                                         /* of a "float" */
 230 #endif
 231 
 232 /* Marked as LEGACY in SUSv1 and removed in SUSv2 */
 233 #ifndef _XPG5
 234 #define DBL_MIN         2.2250738585072013830903E-308   /* min decimal value */
 235                                                         /* of a double */
 236 #define FLT_MIN         1.1754943508222875079688E-38F   /* min decimal value */
 237                                                         /* of a float */
 238 #endif
 239 
 240 #endif  /* defined(__EXTENSIONS__) || (!defined(_STRICT_STDC) ... */
 241 
 242 #define _XOPEN_IOV_MAX  16      /* max # iovec/process with readv()/writev() */
 243 #define _XOPEN_NAME_MAX 255     /* max # bytes in filename excluding null */
 244 #define _XOPEN_PATH_MAX 1024    /* max # bytes in a pathname */
 245 
 246 #define IOV_MAX         _XOPEN_IOV_MAX
 247 
 248 #if defined(__EXTENSIONS__) || \
 249         (!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX))
 250 
 251 #define FCHR_MAX        1048576         /* max size of a file in bytes */
 252 #define PID_MAX         999999          /* max value for a process ID */
 253 
 254 /*
 255  * POSIX 1003.1a, section 2.9.5, table 2-5 contains [NAME_MAX] and the
 256  * related text states:
 257  *
 258  * A definition of one of the values from Table 2-5 shall be omitted from the
 259  * <limits.h> on specific implementations where the corresponding value is
 260  * equal to or greater than the stated minimum, but where the value can vary
 261  * depending on the file to which it is applied. The actual value supported for
 262  * a specific pathname shall be provided by the pathconf() (5.7.1) function.
 263  *
 264  * This is clear that any machine supporting multiple file system types
 265  * and/or a network should not include this define, regardless of protection
 266  * by the _POSIX_SOURCE and _POSIX_C_SOURCE flags. We chose to ignore that
 267  * and provide it anyway for compatibility with other platforms that don't




   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 
  22 /*
  23  * Copyright (c) 2013 Gary Mills
  24  * Copyright 2017 RackTop Systems.
  25  *
  26  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
  27  * Use is subject to license terms.
  28  * Copyright 2015 Joyent, Inc.  All rights reserved.
  29  */
  30 
  31 /*      Copyright (c) 1988 AT&T     */
  32 /*        All Rights Reserved   */
  33 
  34 
  35 #ifndef _LIMITS_H
  36 #define _LIMITS_H
  37 
  38 #include <sys/feature_tests.h>
  39 #include <sys/isa_defs.h>
  40 #include <iso/limits_iso.h>
  41 #include <sys/limits.h>
  42 
  43 /*
  44  * Include fixed width type limits as proposed by the ISO/JTC1/SC22/WG14 C
  45  * committee's working draft for the revision of the current ISO C standard,
  46  * ISO/IEC 9899:1990 Programming language - C.  These are not currently
  47  * required by any standard but constitute a useful, general purpose set
  48  * of type definitions and limits which is namespace clean with respect to
  49  * all standards.
  50  */
  51 #if defined(__EXTENSIONS__) || !defined(_STRICT_STDC) || \
  52         defined(__XOPEN_OR_POSIX)
  53 #include <sys/int_limits.h>
  54 #endif
  55 
  56 #ifdef  __cplusplus
  57 extern "C" {
  58 #endif
  59 
  60 #if defined(__EXTENSIONS__) || !defined(_STRICT_STDC) || \
  61         defined(__XOPEN_OR_POSIX)


 228                                                         /* of a double */
 229 #define FLT_DIG         6               /* digits of precision of a "float" */
 230 #define FLT_MAX         3.4028234663852885981170E+38F   /* max decimal value */
 231                                                         /* of a "float" */
 232 #endif
 233 
 234 /* Marked as LEGACY in SUSv1 and removed in SUSv2 */
 235 #ifndef _XPG5
 236 #define DBL_MIN         2.2250738585072013830903E-308   /* min decimal value */
 237                                                         /* of a double */
 238 #define FLT_MIN         1.1754943508222875079688E-38F   /* min decimal value */
 239                                                         /* of a float */
 240 #endif
 241 
 242 #endif  /* defined(__EXTENSIONS__) || (!defined(_STRICT_STDC) ... */
 243 
 244 #define _XOPEN_IOV_MAX  16      /* max # iovec/process with readv()/writev() */
 245 #define _XOPEN_NAME_MAX 255     /* max # bytes in filename excluding null */
 246 #define _XOPEN_PATH_MAX 1024    /* max # bytes in a pathname */
 247 


 248 #if defined(__EXTENSIONS__) || \
 249         (!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX))
 250 
 251 #define FCHR_MAX        1048576         /* max size of a file in bytes */
 252 #define PID_MAX         999999          /* max value for a process ID */
 253 
 254 /*
 255  * POSIX 1003.1a, section 2.9.5, table 2-5 contains [NAME_MAX] and the
 256  * related text states:
 257  *
 258  * A definition of one of the values from Table 2-5 shall be omitted from the
 259  * <limits.h> on specific implementations where the corresponding value is
 260  * equal to or greater than the stated minimum, but where the value can vary
 261  * depending on the file to which it is applied. The actual value supported for
 262  * a specific pathname shall be provided by the pathconf() (5.7.1) function.
 263  *
 264  * This is clear that any machine supporting multiple file system types
 265  * and/or a network should not include this define, regardless of protection
 266  * by the _POSIX_SOURCE and _POSIX_C_SOURCE flags. We chose to ignore that
 267  * and provide it anyway for compatibility with other platforms that don't