Back to index

glibc  2.9
param.h
Go to the documentation of this file.
00001 /* Copyright (C) 1993, 1994, 1995, 1997, 1999 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 /* This file is deprecated and is provided only for compatibility with
00020    Unix systems.  It is unwise to include this file on programs which
00021    are intended only for GNU systems.
00022 
00023    Parts from:
00024 
00025  * Copyright (c) 1982, 1986, 1989 The Regents of the University of California.
00026  * All rights reserved.
00027  *
00028  * Redistribution and use in source and binary forms, with or without
00029  * modification, are permitted provided that the following conditions
00030  * are met:
00031  * 1. Redistributions of source code must retain the above copyright
00032  *    notice, this list of conditions and the following disclaimer.
00033  * 2. Redistributions in binary form must reproduce the above copyright
00034  *    notice, this list of conditions and the following disclaimer in the
00035  *    documentation and/or other materials provided with the distribution.
00036  * 4. Neither the name of the University nor the names of its contributors
00037  *    may be used to endorse or promote products derived from this software
00038  *    without specific prior written permission.
00039  *
00040  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
00041  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00042  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00043  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
00044  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00045  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
00046  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
00047  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
00048  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
00049  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
00050  * SUCH DAMAGE.
00051  *
00052  *     @(#)param.h   7.23 (Berkeley) 5/6/91
00053  */
00054 
00055 
00056 #ifndef       _SYS_PARAM_H
00057 
00058 #define       _SYS_PARAM_H  1
00059 #include <features.h>
00060 
00061 #define __need_NULL
00062 #include <stddef.h>
00063 
00064 #include <sys/types.h>
00065 #include <errno.h>
00066 #include <signal.h>
00067 #include <endian.h>
00068 #include <limits.h>
00069 #ifdef notyet
00070 # include <ufs/param.h>
00071 #endif
00072 
00073 
00074 /* What versions of BSD we are compatible with.  */
00075 #define       BSD    199306        /* System version (year & month). */
00076 #define BSD4_3       1
00077 #define BSD4_4       1
00078 
00079 #define       GNU    1994100              /* GNU version (year, month, and release).  */
00080 
00081 
00082 /* BSD names for some <limits.h> values.  We do not define the BSD names
00083    for the values which are not statically limited, such as NOFILE.  */
00084 
00085 #define       NBBY          CHAR_BIT
00086 #define       NGROUPS              NGROUPS_MAX
00087 #define       MAXSYMLINKS   SYMLOOP_MAX
00088 #define       CANBSIZ              MAX_CANON /* XXX ? */
00089 
00090 /* ARG_MAX is unlimited, but we define NCARGS for BSD programs that want to
00091    compare against some fixed limit.  */
00092 #define       NCARGS        INT_MAX
00093 
00094 /* There is nothing quite equivalent in GNU to Unix "mounts", but there is
00095    no limit on the number of simultaneously attached filesystems.  */
00096 #define NMOUNT              INT_MAX
00097 
00098 
00099 /* Magical constants.  */
00100 #define       NOGROUP       65535         /* Marker for empty group set member.  */
00101 #define       NODEV  ((dev_t) -1)  /* Non-existent device.  */
00102 
00103 
00104 /* Bit map related macros.  */
00105 #define       setbit(a,i)   ((a)[(i)/NBBY] |= 1<<((i)%NBBY))
00106 #define       clrbit(a,i)   ((a)[(i)/NBBY] &= ~(1<<((i)%NBBY)))
00107 #define       isset(a,i)    ((a)[(i)/NBBY] & (1<<((i)%NBBY)))
00108 #define       isclr(a,i)    (((a)[(i)/NBBY] & (1<<((i)%NBBY))) == 0)
00109 
00110 /* Macros for counting and rounding.  */
00111 #ifndef howmany
00112 # define howmany(x, y)      (((x)+((y)-1))/(y))
00113 #endif
00114 #define       roundup(x, y) ((((x)+((y)-1))/(y))*(y))
00115 #define powerof2(x)  ((((x)-1)&(x))==0)
00116 
00117 /* Macros for min/max.  */
00118 #define       MIN(a,b) (((a)<(b))?(a):(b))
00119 #define       MAX(a,b) (((a)>(b))?(a):(b))
00120 
00121 
00122 /* Scale factor for scaled integers used to count %cpu time and load avgs.
00123 
00124    The number of CPU `tick's that map to a unique `%age' can be expressed
00125    by the formula (1 / (2 ^ (FSHIFT - 11))).  The maximum load average that
00126    can be calculated (assuming 32 bits) can be closely approximated using
00127    the formula (2 ^ (2 * (16 - FSHIFT))) for (FSHIFT < 15).  */
00128 
00129 #define       FSHIFT 11            /* Bits to right of fixed binary point.  */
00130 #define FSCALE       (1<<FSHIFT)
00131 
00132 #endif  /* sys/param.h */