Update.
[glibc.git] / sysdeps / unix / sysv / linux / sys / param.h
blobc2a56a2c29a75435bb4d4afd6e9a797541746135
1 /* Copyright (C) 1995, 1996, 1997 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 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.
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.
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 not,
16 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 Boston, MA 02111-1307, USA. */
19 #ifndef _SYS_PARAM_H
21 #define _SYS_PARAM_H 1
23 #include <limits.h>
24 #include <linux/limits.h>
25 #include <linux/param.h>
27 /* BSD names for some <limits.h> values. */
29 #define NBBY CHAR_BIT
30 #ifndef NGROUPS
31 # define NGROUPS NGROUPS_MAX
32 #endif
33 #define MAXSYMLINKS 5
34 #define CANBSIZ MAX_CANON
35 #define NCARGS ARG_MAX
36 #define MAXPATHLEN PATH_MAX
37 #define NOFILE OPEN_MAX
40 #include <sys/types.h>
42 /* Bit map related macros. */
43 #define setbit(a,i) ((a)[(i)/NBBY] |= 1<<((i)%NBBY))
44 #define clrbit(a,i) ((a)[(i)/NBBY] &= ~(1<<((i)%NBBY)))
45 #define isset(a,i) ((a)[(i)/NBBY] & (1<<((i)%NBBY)))
46 #define isclr(a,i) (((a)[(i)/NBBY] & (1<<((i)%NBBY))) == 0)
48 /* Macros for counting and rounding. */
49 #ifndef howmany
50 # define howmany(x, y) (((x)+((y)-1))/(y))
51 #endif
52 #define roundup(x, y) ((((x)+((y)-1))/(y))*(y))
53 #define powerof2(x) ((((x)-1)&(x))==0)
55 /* Macros for min/max. */
56 #define MIN(a,b) (((a)<(b))?(a):(b))
57 #define MAX(a,b) (((a)>(b))?(a):(b))
60 /* Unit of `st_blocks'. */
61 #define DEV_BSIZE 512
64 #endif /* sys/param.h */