2.3.3-74
[glibc.git] / sysdeps / unix / sysv / sysv4 / solaris2 / sys / param.h
blobbbd7b06a1188461fa4b15cc8d12eb1fac52de4ab
1 /* Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
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.
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.
14 You should have received a copy of the GNU Lesser General Public
15 License along with the GNU C Library; if not, write to the Free
16 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
17 02111-1307 USA. */
19 #ifndef _SYS_PARAM_H
20 #define _SYS_PARAM_H 1
22 #include <limits.h>
24 /* BSD names for some <limits.h> values. */
26 #define NBBY CHAR_BIT
27 #ifndef NGROUPS
28 # define NGROUPS NGROUPS_MAX
29 #endif
30 #define MAXSYMLINKS 5
31 #define CANBSIZ MAX_CANON
32 #define NCARGS ARG_MAX
33 #define MAXPATHLEN PATH_MAX
34 #define NOFILE OPEN_MAX
37 #include <sys/types.h>
39 /* Bit map related macros. */
40 #define setbit(a,i) ((a)[(i)/NBBY] |= 1<<((i)%NBBY))
41 #define clrbit(a,i) ((a)[(i)/NBBY] &= ~(1<<((i)%NBBY)))
42 #define isset(a,i) ((a)[(i)/NBBY] & (1<<((i)%NBBY)))
43 #define isclr(a,i) (((a)[(i)/NBBY] & (1<<((i)%NBBY))) == 0)
45 /* Macros for counting and rounding. */
46 #ifndef howmany
47 # define howmany(x, y) (((x)+((y)-1))/(y))
48 #endif
49 #define roundup(x, y) ((((x)+((y)-1))/(y))*(y))
50 #define powerof2(x) ((((x)-1)&(x))==0)
52 /* Macros for min/max. */
53 #define MIN(a,b) (((a)<(b))?(a):(b))
54 #define MAX(a,b) (((a)>(b))?(a):(b))
56 /* Unit of `st_blocks'. */
57 #define DEV_BSIZE 512
59 #endif /* sys/param.h */