1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
|
/* Copyright (C) 1995, 1996, 1997, 1998, 2008 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
#ifndef _SYS_PARAM_H
#define _SYS_PARAM_H 1
#include <limits.h>
#include <bits/local_lim.h>
#include <features.h>
#include <sys/isa_defs.h>
#ifndef MIN
# define MIN(a,b) (((a)<(b))?(a):(b))
#endif
#ifndef MAX
# define MAX(a,b) (((a)>(b))?(a):(b))
#endif
/* BSD names for some <limits.h> values. */
#define NBBY CHAR_BIT
#ifndef NGROUPS
# define NGROUPS NGROUPS_MAX
#endif
#define MAXSYMLINKS 20
#define CANBSIZ MAX_CANON
#define NCARGS ARG_MAX
#define MAXPATHLEN PATH_MAX
#define NOFILE OPEN_MAX
#include <sys/types.h>
/* Bit map related macros. */
#define setbit(a,i) ((a)[(i)/NBBY] |= 1<<((i)%NBBY))
#define clrbit(a,i) ((a)[(i)/NBBY] &= ~(1<<((i)%NBBY)))
#define isset(a,i) ((a)[(i)/NBBY] & (1<<((i)%NBBY)))
#define isclr(a,i) (((a)[(i)/NBBY] & (1<<((i)%NBBY))) == 0)
/* Macros for counting and rounding. */
#ifndef howmany
# define howmany(x, y) (((x)+((y)-1))/(y))
#endif
#define roundup(x, y) ((((x)+((y)-1))/(y))*(y))
#define powerof2(x) ((((x)-1)&(x))==0)
#define NODEV (dev_t)(-1l)
/* Unit of `st_blocks'. */
#define DEV_BSIZE 512
/* Maximum hostname length. */
#define MAXHOSTNAMELEN 256
#define PAGESIZE sysconf(_SC_PAGESIZE)
#define MAXPID (pid_t)sysconf(_SC_MAXPID)
#define MAXEPHUID (uid_t)sysconf(_SC_EPHID_MAX)
#define MAXNAMELEN 256
#define TYPICALMAXPATHLEN 64
#define MAXLINKNAMELEN 32
#define UID_NOBODY 60001
#define GID_NOBODY UID_NOBODY
#define GID_SYS 3
#define UID_DLADM 15
#define MAXUID 2147483647
#define MAXPROJID MAXUID
#define NS_PACKETSZ 512
#define NS_MAXDNAME 1025
#define NS_MAXMSG 65535
#define NS_MAXCDNAME 255
#define NS_MAXLABEL 63
#define NS_HFIXEDSZ 12
#define NS_QFIXEDSZ 4
#define NS_RRFIXEDSZ 10
#define NS_INT32SZ 4
#define NS_INT16SZ 2
#define NS_INT8SZ 1
#define NS_INADDRSZ 4
#define NS_IN6ADDRSZ 16
#define NS_CMPRSFLGS 0xc0
#define NS_DEFAULTPORT 53
#define NGROUPS_UMIN 0
#define NGROUPS_UMAX 32
#define NGROUPS_MAX_DEFAULT 16
#define MAXBSIZE 8192
#define DEV_BSIZE 512
#define DEV_BSHIFT 9
#define MAXFRAG 8
#ifdef _LP64
# define MAXOFF_T 0x7fffffffffffffffl
# define MAXOFFSET_T 0x7fffffffffffffffl
#else
# define MAXOFF_T 0x7fffffffl
# define MAXOFFSET_T 0x7fffffffffffffffLL
#endif
#ifdef _LITTLE_ENDIAN
# define lobyte(X) (((unsigned char *)&(X))[0])
# define hibyte(X) (((unsigned char *)&(X))[1])
# define loword(X) (((ushort_t *)&(X))[0])
# define hiword(X) (((ushort_t *)&(X))[1])
#endif
#ifdef _BIG_ENDIAN
# define lobyte(X) (((unsigned char *)&(X))[1])
# define hibyte(X) (((unsigned char *)&(X))[0])
# define loword(X) (((ushort_t *)&(X))[1])
# define hiword(X) (((ushort_t *)&(X))[0])
#endif
#ifndef __USE_XOPEN
# define NZERO 20
#endif
__BEGIN_DECLS
extern long int sysconf (int __name) __THROW;
__END_DECLS
#endif /* sys/param.h */
|