modernc.org/cc@v1.0.1/v2/headers/linux_386/usr/include/i386-linux-gnu/sys/param.h (about)

     1  /* Compatibility header for old-style Unix parameters and limits.
     2     Copyright (C) 1995-2018 Free Software Foundation, Inc.
     3     This file is part of the GNU C Library.
     4  
     5     The GNU C Library is free software; you can redistribute it and/or
     6     modify it under the terms of the GNU Lesser General Public
     7     License as published by the Free Software Foundation; either
     8     version 2.1 of the License, or (at your option) any later version.
     9  
    10     The GNU C Library is distributed in the hope that it will be useful,
    11     but WITHOUT ANY WARRANTY; without even the implied warranty of
    12     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    13     Lesser General Public License for more details.
    14  
    15     You should have received a copy of the GNU Lesser General Public
    16     License along with the GNU C Library; if not, see
    17     <http://www.gnu.org/licenses/>.  */
    18  
    19  #ifndef _SYS_PARAM_H
    20  #define _SYS_PARAM_H    1
    21  
    22  #define __need_NULL
    23  #include <stddef.h>
    24  
    25  #include <sys/types.h>
    26  #include <limits.h>
    27  #include <endian.h>		/* Define BYTE_ORDER et al.  */
    28  #include <signal.h>		/* Define NSIG.  */
    29  
    30  /* This file defines some things in system-specific ways.  */
    31  #include <bits/param.h>
    32  
    33  /* BSD names for some <limits.h> values.  */
    34  
    35  #define NBBY		CHAR_BIT
    36  
    37  #if !defined NGROUPS && defined NGROUPS_MAX
    38  # define NGROUPS	NGROUPS_MAX
    39  #endif
    40  #if !defined MAXSYMLINKS && defined SYMLOOP_MAX
    41  # define MAXSYMLINKS	SYMLOOP_MAX
    42  #endif
    43  #if !defined CANBSIZ && defined MAX_CANON
    44  # define CANBSIZ	MAX_CANON
    45  #endif
    46  #if !defined MAXPATHLEN && defined PATH_MAX
    47  # define MAXPATHLEN	PATH_MAX
    48  #endif
    49  #if !defined NOFILE && defined OPEN_MAX
    50  # define NOFILE		OPEN_MAX
    51  #endif
    52  #if !defined MAXHOSTNAMELEN && defined HOST_NAME_MAX
    53  # define MAXHOSTNAMELEN	HOST_NAME_MAX
    54  #endif
    55  #ifndef NCARGS
    56  # ifdef ARG_MAX
    57  #  define NCARGS	ARG_MAX
    58  # else
    59  /* ARG_MAX is unlimited, but we define NCARGS for BSD programs that want to
    60     compare against some fixed limit.  */
    61  # define NCARGS		INT_MAX
    62  # endif
    63  #endif
    64  
    65  /* Magical constants.  */
    66  #ifndef NOGROUP
    67  # define NOGROUP	65535	/* Marker for empty group set member.  */
    68  #endif
    69  #ifndef NODEV
    70  # define NODEV		((dev_t) -1)	/* Non-existent device.  */
    71  #endif
    72  
    73  /* Unit of `st_blocks'.  */
    74  #ifndef DEV_BSIZE
    75  # define DEV_BSIZE	512
    76  #endif
    77  
    78  /* Bit map related macros.  */
    79  #define setbit(a,i)     ((a)[(i)/NBBY] |= 1<<((i)%NBBY))
    80  #define clrbit(a,i)     ((a)[(i)/NBBY] &= ~(1<<((i)%NBBY)))
    81  #define isset(a,i)      ((a)[(i)/NBBY] & (1<<((i)%NBBY)))
    82  #define isclr(a,i)      (((a)[(i)/NBBY] & (1<<((i)%NBBY))) == 0)
    83  
    84  /* Macros for counting and rounding.  */
    85  #ifndef howmany
    86  # define howmany(x, y)  (((x) + ((y) - 1)) / (y))
    87  #endif
    88  #ifdef __GNUC__
    89  # define roundup(x, y)  (__builtin_constant_p (y) && powerof2 (y)             \
    90                           ? (((x) + (y) - 1) & ~((y) - 1))                     \
    91                           : ((((x) + ((y) - 1)) / (y)) * (y)))
    92  #else
    93  # define roundup(x, y)  ((((x) + ((y) - 1)) / (y)) * (y))
    94  #endif
    95  #define powerof2(x)     ((((x) - 1) & (x)) == 0)
    96  
    97  /* Macros for min/max.  */
    98  #define MIN(a,b) (((a)<(b))?(a):(b))
    99  #define MAX(a,b) (((a)>(b))?(a):(b))
   100  
   101  #endif				/* sys/param.h */