Back to index

glibc  2.9
param.h
Go to the documentation of this file.
00001 /* Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
00002    This file is part of the GNU C Library.
00003 
00004    The GNU C Library is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU Lesser General Public
00006    License as published by the Free Software Foundation; either
00007    version 2.1 of the License, or (at your option) any later version.
00008 
00009    The GNU C Library is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY; without even the implied warranty of
00011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012    Lesser General Public License for more details.
00013 
00014    You should have received a copy of the GNU Lesser General Public
00015    License along with the GNU C Library; if not, write to the Free
00016    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
00017    02111-1307 USA.  */
00018 
00019 #ifndef _SYS_PARAM_H
00020 #define _SYS_PARAM_H 1
00021 
00022 #include <limits.h>
00023 
00024 /* BSD names for some <limits.h> values.  */
00025 
00026 #define       NBBY          CHAR_BIT
00027 #ifndef       NGROUPS
00028 # define NGROUPS            NGROUPS_MAX
00029 #endif
00030 #define       MAXSYMLINKS   5
00031 #define       CANBSIZ              MAX_CANON
00032 #define       NCARGS        ARG_MAX
00033 #define MAXPATHLEN      PATH_MAX
00034 #define NOFILE          OPEN_MAX
00035 
00036 
00037 #include <sys/types.h>
00038 
00039 /* Bit map related macros.  */
00040 #define       setbit(a,i)   ((a)[(i)/NBBY] |= 1<<((i)%NBBY))
00041 #define       clrbit(a,i)   ((a)[(i)/NBBY] &= ~(1<<((i)%NBBY)))
00042 #define       isset(a,i)    ((a)[(i)/NBBY] & (1<<((i)%NBBY)))
00043 #define       isclr(a,i)    (((a)[(i)/NBBY] & (1<<((i)%NBBY))) == 0)
00044 
00045 /* Macros for counting and rounding.  */
00046 #ifndef howmany
00047 # define howmany(x, y)      (((x)+((y)-1))/(y))
00048 #endif
00049 #define       roundup(x, y) ((((x)+((y)-1))/(y))*(y))
00050 #define powerof2(x)  ((((x)-1)&(x))==0)
00051 
00052 /* Macros for min/max.  */
00053 #define       MIN(a,b) (((a)<(b))?(a):(b))
00054 #define       MAX(a,b) (((a)>(b))?(a):(b))
00055 
00056 /* Unit of `st_blocks'.  */
00057 #define DEV_BSIZE       512
00058 
00059 #endif /* sys/param.h */