home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 4: GNU Archives / Linux Cubed Series 4 - GNU Archives.iso / gnu / glibc-1.09 / glibc-1 / glibc-1.09.1 / sysdeps / mach / hurd / sys / param.h
Encoding:
C/C++ Source or Header  |  1994-10-14  |  5.0 KB  |  136 lines

  1. /* Copyright (C) 1993, 1994 Free Software Foundation, Inc.
  2. This file is part of the GNU C Library.
  3.  
  4. The GNU C Library is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU Library General Public License as
  6. published by the Free Software Foundation; either version 2 of the
  7. License, or (at your option) any later version.
  8.  
  9. The GNU C Library is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  12. Library General Public License for more details.
  13.  
  14. You should have received a copy of the GNU Library General Public
  15. License along with the GNU C Library; see the file COPYING.LIB.  If
  16. not, write to the Free Software Foundation, Inc., 675 Mass Ave,
  17. Cambridge, MA 02139, USA.  */
  18.  
  19. /* This file is deprecated and is provided only for compatibility with
  20.    Unix systems.  It is unwise to include this file on programs which
  21.    are intended only for GNU systems.
  22.  
  23.    Parts from:
  24.  
  25.  * Copyright (c) 1982, 1986, 1989 The Regents of the University of California.
  26.  * All rights reserved.
  27.  *
  28.  * Redistribution and use in source and binary forms, with or without
  29.  * modification, are permitted provided that the following conditions
  30.  * are met:
  31.  * 1. Redistributions of source code must retain the above copyright
  32.  *    notice, this list of conditions and the following disclaimer.
  33.  * 2. Redistributions in binary form must reproduce the above copyright
  34.  *    notice, this list of conditions and the following disclaimer in the
  35.  *    documentation and/or other materials provided with the distribution.
  36.  * 3. All advertising materials mentioning features or use of this software
  37.  *    must display the following acknowledgement:
  38.  *    This product includes software developed by the University of
  39.  *    California, Berkeley and its contributors.
  40.  * 4. Neither the name of the University nor the names of its contributors
  41.  *    may be used to endorse or promote products derived from this software
  42.  *    without specific prior written permission.
  43.  *
  44.  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  45.  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  46.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  47.  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  48.  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  49.  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  50.  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  51.  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  52.  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  53.  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  54.  * SUCH DAMAGE.
  55.  *
  56.  *    @(#)param.h    7.23 (Berkeley) 5/6/91
  57.  */
  58.  
  59.  
  60. #ifndef    _SYS_PARAM_H
  61.  
  62. #define    _SYS_PARAM_H    1
  63. #include <features.h>
  64.  
  65. #define __need_NULL
  66. #include <stddef.h>
  67.  
  68. #include <sys/types.h>
  69. #include <errno.h>
  70. #include <signal.h>
  71. #include <endian.h>
  72. #include <limits.h>
  73. #ifdef notyet
  74. #include <ufs/param.h>
  75. #endif
  76.  
  77.  
  78. /* What versions of BSD we are compatible with.  */
  79. #define    BSD    199306        /* System version (year & month). */
  80. #define BSD4_3    1
  81. #define BSD4_4    1
  82.  
  83. #define    GNU    1994100        /* GNU version (year, month, and release).  */
  84.  
  85.  
  86. /* BSD names for some <limits.h> values.  We do not define the BSD names
  87.    for the values which are not statically limited, such as NOFILE.  */
  88.  
  89. #define    NGROUPS        NGROUPS_MAX
  90. #define    MAXSYMLINKS    SYMLOOP_MAX
  91. #define    CANBSIZ        MAX_CANON /* XXX ? */
  92.  
  93. /* ARG_MAX is unlimited, but we define NCARGS for BSD programs that want to
  94.    compare against some fixed limit.  */
  95. #define    NCARGS        INT_MAX
  96.  
  97. /* There is nothing quite equivalent in GNU to Unix "mounts", but there is
  98.    no limit on the number of simultaneously attached filesystems.  */
  99. #define NMOUNT        INT_MAX
  100.  
  101.  
  102. /* Magical constants.  */
  103. #define    NOGROUP    65535        /* Marker for empty group set member.  */
  104. #define    NODEV    ((dev_t) -1)    /* Non-existent device.  */
  105.  
  106.  
  107. /* Bit map related macros.  */
  108. #define    setbit(a,i)    ((a)[(i)/NBBY] |= 1<<((i)%NBBY))
  109. #define    clrbit(a,i)    ((a)[(i)/NBBY] &= ~(1<<((i)%NBBY)))
  110. #define    isset(a,i)    ((a)[(i)/NBBY] & (1<<((i)%NBBY)))
  111. #define    isclr(a,i)    (((a)[(i)/NBBY] & (1<<((i)%NBBY))) == 0)
  112.  
  113. /* Macros for counting and rounding.  */
  114. #ifndef howmany
  115. #define    howmany(x, y)    (((x)+((y)-1))/(y))
  116. #endif
  117. #define    roundup(x, y)    ((((x)+((y)-1))/(y))*(y))
  118. #define powerof2(x)    ((((x)-1)&(x))==0)
  119.  
  120. /* Macros for min/max.  */
  121. #define    MIN(a,b) (((a)<(b))?(a):(b))
  122. #define    MAX(a,b) (((a)>(b))?(a):(b))
  123.  
  124.  
  125. /* Scale factor for scaled integers used to count %cpu time and load avgs.
  126.  
  127.    The number of CPU `tick's that map to a unique `%age' can be expressed
  128.    by the formula (1 / (2 ^ (FSHIFT - 11))).  The maximum load average that
  129.    can be calculated (assuming 32 bits) can be closely approximated using
  130.    the formula (2 ^ (2 * (16 - FSHIFT))) for (FSHIFT < 15).  */
  131.  
  132. #define    FSHIFT    11        /* Bits to right of fixed binary point.  */
  133. #define FSCALE    (1<<FSHIFT)
  134.  
  135. #endif     /* sys/param.h */
  136.