42f4f46e7d0152ee3138ca583df4c0692092a07e
[platform/upstream/glibc.git] / sysdeps / mach / hurd / sys / param.h
1 /* Copyright (C) 1993,1994,1995,1997,1999,2011 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 Lesser General Public
6    License as published by the Free Software Foundation; either
7    version 2.1 of the 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    Lesser General Public License for more details.
13
14    You should have received a copy of the GNU Lesser General Public
15    License along with the GNU C Library; if not, see
16    <http://www.gnu.org/licenses/>.  */
17
18 /* This file is deprecated and is provided only for compatibility with
19    Unix systems.  It is unwise to include this file on programs which
20    are intended only for GNU systems.
21
22    Parts from:
23
24  * Copyright (c) 1982, 1986, 1989 The Regents of the University of California.
25  * All rights reserved.
26  *
27  * Redistribution and use in source and binary forms, with or without
28  * modification, are permitted provided that the following conditions
29  * are met:
30  * 1. Redistributions of source code must retain the above copyright
31  *    notice, this list of conditions and the following disclaimer.
32  * 2. Redistributions in binary form must reproduce the above copyright
33  *    notice, this list of conditions and the following disclaimer in the
34  *    documentation and/or other materials provided with the distribution.
35  * 4. Neither the name of the University nor the names of its contributors
36  *    may be used to endorse or promote products derived from this software
37  *    without specific prior written permission.
38  *
39  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
40  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
41  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
42  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
43  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
44  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
45  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
46  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
47  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
48  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
49  * SUCH DAMAGE.
50  *
51  *      @(#)param.h     7.23 (Berkeley) 5/6/91
52  */
53
54
55 #ifndef _SYS_PARAM_H
56
57 #define _SYS_PARAM_H    1
58 #include <features.h>
59
60 #define __need_NULL
61 #include <stddef.h>
62
63 #include <sys/types.h>
64 #include <errno.h>
65 #include <signal.h>
66 #include <endian.h>
67 #include <limits.h>
68 #ifdef notyet
69 # include <ufs/param.h>
70 #endif
71
72
73 /* What versions of BSD we are compatible with.  */
74 #define BSD     199306          /* System version (year & month). */
75 #define BSD4_3  1
76 #define BSD4_4  1
77
78 #define GNU     1994100         /* GNU version (year, month, and release).  */
79
80
81 /* BSD names for some <limits.h> values.  We do not define the BSD names
82    for the values which are not statically limited, such as NOFILE.  */
83
84 #define NBBY            CHAR_BIT
85 #define NGROUPS         NGROUPS_MAX
86 #define MAXSYMLINKS     SYMLOOP_MAX
87 #define CANBSIZ         MAX_CANON /* XXX ? */
88
89 /* ARG_MAX is unlimited, but we define NCARGS for BSD programs that want to
90    compare against some fixed limit.  */
91 #define NCARGS          INT_MAX
92
93 /* There is nothing quite equivalent in GNU to Unix "mounts", but there is
94    no limit on the number of simultaneously attached filesystems.  */
95 #define NMOUNT          INT_MAX
96
97
98 /* Magical constants.  */
99 #define NOGROUP 65535           /* Marker for empty group set member.  */
100 #define NODEV   ((dev_t) -1)    /* Non-existent device.  */
101
102
103 /* Bit map related macros.  */
104 #define setbit(a,i)     ((a)[(i)/NBBY] |= 1<<((i)%NBBY))
105 #define clrbit(a,i)     ((a)[(i)/NBBY] &= ~(1<<((i)%NBBY)))
106 #define isset(a,i)      ((a)[(i)/NBBY] & (1<<((i)%NBBY)))
107 #define isclr(a,i)      (((a)[(i)/NBBY] & (1<<((i)%NBBY))) == 0)
108
109 /* Macros for counting and rounding.  */
110 #ifndef howmany
111 # define howmany(x, y)  (((x)+((y)-1))/(y))
112 #endif
113 #define roundup(x, y)   ((((x)+((y)-1))/(y))*(y))
114 #define powerof2(x)     ((((x)-1)&(x))==0)
115
116 /* Macros for min/max.  */
117 #define MIN(a,b) (((a)<(b))?(a):(b))
118 #define MAX(a,b) (((a)>(b))?(a):(b))
119
120
121 /* Unit of `st_blocks'.  */
122 #define DEV_BSIZE       512
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 */