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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
|
%{
/*
* Copyright is disclaimed as to the contents of this file.
*
* $FreeBSD$
*/
#include <sys/types.h>
#include <limits.h>
#include <string.h>
#include <unistd.h>
#include "getconf.h"
/*
* Stuff that isn't defined right now -- we want this file to work
* unmodified once it is defined.
*/
#ifndef _SC_ATEXIT_MAX
#define _SC_ATEXIT_MAX -1
#endif
#ifndef _SC_TTY_NAME_MAX
#define _SC_TTY_NAME_MAX -1
#endif
#ifndef _SC_MQ_PRIO_MAX
#define _SC_MQ_PRIO_MAX -1
#endif
#ifndef _SC_IOV_MAX
#define _SC_IOV_MAX -1
#endif
#ifndef _SC_XOPEN_REALTIME
#define _SC_XOPEN_REALTIME -1
#endif
#ifndef _SC_XOPEN_LEGACY
#define _SC_XOPEN_LEGACY -1
#endif
#ifndef _SC_XCU_VERSION
#define _SC_XCU_VERSION -1
#endif
#ifndef _SC_PASS_MAX
#define _SC_PASS_MAX -1
#endif
#ifndef _SC_XOPEN_REALTIME_THREADS
#define _SC_XOPEN_REALTIME_THREADS -1
#endif
#ifndef _SC_LOGIN_NAME_MAX
#define _SC_LOGIN_NAME_MAX -1
#endif
#ifndef _SC_XBS5_LP64_OFF64
#define _SC_XBS5_LP64_OFF64 -1
#endif
#ifndef _SC_XOPEN_SHM
#define _SC_XOPEN_SHM -1
#endif
#ifndef _SC_XOPEN_CRYPT
#define _SC_XOPEN_CRYPT -1
#endif
#ifndef _SC_XOPEN_UNIX
#define _SC_XOPEN_UNIX -1
#endif
#ifndef _SC_XOPEN_VERSION
#define _SC_XOPEN_VERSION -1
#endif
#ifndef _SC_THREAD_DESTRUCTOR_ITERATIONS
#define _SC_THREAD_DESTRUCTOR_ITERATIONS -1
#endif
#ifndef _SC_THREAD_KEYS_MAX
#define _SC_THREAD_KEYS_MAX -1
#endif
#ifndef _SC_2_C_VERSION
#define _SC_2_C_VERSION -1
#endif
#ifndef _SC_XBS5_LPBIG_OFFBIG
#define _SC_XBS5_LPBIG_OFFBIG -1
#endif
#ifndef _SC_THREAD_THREADS_MAX
#define _SC_THREAD_THREADS_MAX -1
#endif
#ifndef _SC_XBS5_ILP32_OFF32
#define _SC_XBS5_ILP32_OFF32 -1
#endif
#ifndef _SC_XBS5_ILP32_OFFBIG
#define _SC_XBS5_ILP32_OFFBIG -1
#endif
#ifndef _SC_THREAD_STACK_MIN
#define _SC_THREAD_STACK_MIN -1
#endif
#ifndef _SC_XOPEN_ENH_I18N
#define _SC_XOPEN_ENH_I18N -1
#endif
#ifndef _SC_THREAD_ATTR_STACKSIZE
#define _SC_THREAD_ATTR_STACKSIZE -1
#endif
#ifndef _SC_THREAD_PRIORITY_SCHEDULING
#define _SC_THREAD_PRIORITY_SCHEDULING -1
#endif
#ifndef _SC_THREADS
#define _SC_THREADS -1
#endif
#ifndef _SC_THREAD_PROCESS_SHARED
#define _SC_THREAD_PROCESS_SHARED -1
#endif
#ifndef _SC_THREAD_SAFE_FUNCTIONS
#define _SC_THREAD_SAFE_FUNCTIONS -1
#endif
#ifndef _SC_THREAD_PRIO_PROTECT
#define _SC_THREAD_PRIO_PROTECT -1
#endif
#ifndef _SC_THREAD_ATTR_STACKADDR
#define _SC_THREAD_ATTR_STACKADDR -1
#endif
#ifndef _SC_THREAD_PRIO_INHERIT
#define _SC_THREAD_PRIO_INHERIT -1
#endif
/*
* Override gperf's built-in external scope.
*/
static const struct map *in_word_set(const char *str, unsigned int len);
%}
struct map { char *name; int key; };
%%
AIO_LISTIO_MAX, _SC_AIO_LISTIO_MAX
AIO_MAX, _SC_AIO_MAX
AIO_PRIO_DELTA_MAX, _SC_AIO_PRIO_DELTA_MAX
ARG_MAX, _SC_ARG_MAX
ATEXIT_MAX, _SC_ATEXIT_MAX
BC_BASE_MAX, _SC_BC_BASE_MAX
BC_DIM_MAX, _SC_BC_DIM_MAX
BC_SCALE_MAX, _SC_BC_SCALE_MAX
BC_STRING_MAX, _SC_BC_STRING_MAX
CHILD_MAX, _SC_CHILD_MAX
CLK_TCK, _SC_CLK_TCK
COLL_WEIGHTS_MAX, _SC_COLL_WEIGHTS_MAX
DELAYTIMER_MAX, _SC_DELAYTIMER_MAX
EXPR_NEST_MAX, _SC_EXPR_NEST_MAX
IOV_MAX, _SC_IOV_MAX
LINE_MAX, _SC_LINE_MAX
LOGIN_NAME_MAX, _SC_LOGIN_NAME_MAX
MQ_OPEN_MAX, _SC_MQ_OPEN_MAX
MQ_PRIO_MAX, _SC_MQ_PRIO_MAX
NGROUPS_MAX, _SC_NGROUPS_MAX
OPEN_MAX, _SC_OPEN_MAX
PAGESIZE, _SC_PAGESIZE
PAGE_SIZE, _SC_PAGESIZE
PASS_MAX, _SC_PASS_MAX
PTHREAD_DESTRUCTOR_ITERATIONS, _SC_THREAD_DESTRUCTOR_ITERATIONS
PTHREAD_KEYS_MAX, _SC_THREAD_KEYS_MAX
PTHREAD_STACK_MIN, _SC_THREAD_STACK_MIN
PTHREAD_THREADS_MAX, _SC_THREAD_THREADS_MAX
RE_DUP_MAX, _SC_RE_DUP_MAX
RTSIG_MAX, _SC_RTSIG_MAX
SEM_NSEMS_MAX, _SC_SEM_NSEMS_MAX
SEM_VALUE_MAX, _SC_SEM_VALUE_MAX
SIGQUEUE_MAX, _SC_SIGQUEUE_MAX
STREAM_MAX, _SC_STREAM_MAX
TIMER_MAX, _SC_TIMER_MAX
TTY_NAME_MAX, _SC_TTY_NAME_MAX
TZNAME_MAX, _SC_TZNAME_MAX
_POSIX2_CHAR_TERM, _SC_2_CHAR_TERM
_POSIX2_C_BIND, _SC_2_C_BIND
_POSIX2_C_DEV, _SC_2_C_DEV
_POSIX2_C_VERSION, _SC_2_C_VERSION
_POSIX2_FORT_DEV, _SC_2_FORT_DEV
_POSIX2_FORT_RUN, _SC_2_FORT_RUN
_POSIX2_LOCALEDEF, _SC_2_LOCALEDEF
_POSIX2_SW_DEV, _SC_2_SW_DEV
_POSIX2_UPE, _SC_2_UPE
_POSIX2_VERSION, _SC_2_VERSION
_POSIX_ASYNCHRONOUS_IO, _SC_ASYNCHRONOUS_IO
_POSIX_FSYNC, _SC_FSYNC
_POSIX_JOB_CONTROL, _SC_JOB_CONTROL
_POSIX_MAPPED_FILES, _SC_MAPPED_FILES
_POSIX_MEMLOCK, _SC_MEMLOCK
_POSIX_MEMLOCK_RANGE, _SC_MEMLOCK_RANGE
_POSIX_MEMORY_PROTECTION, _SC_MEMORY_PROTECTION
_POSIX_MESSAGE_PASSING, _SC_MESSAGE_PASSING
_POSIX_PRIORITIZED_IO, _SC_PRIORITIZED_IO
_POSIX_PRIORITY_SCHEDULING, _SC_PRIORITY_SCHEDULING
_POSIX_REALTIME_SIGNALS, _SC_REALTIME_SIGNALS
_POSIX_SAVED_IDS, _SC_SAVED_IDS
_POSIX_SEMAPHORES, _SC_SEMAPHORES
_POSIX_SHARED_MEMORY_OBJECTS, _SC_SHARED_MEMORY_OBJECTS
_POSIX_SYNCHRONIZED_IO, _SC_SYNCHRONIZED_IO
_POSIX_THREADS, _SC_THREADS
_POSIX_THREAD_ATTR_STACKADDR, _SC_THREAD_ATTR_STACKADDR
_POSIX_THREAD_ATTR_STACKSIZE, _SC_THREAD_ATTR_STACKSIZE
_POSIX_THREAD_PRIORITY_SCHEDULING, _SC_THREAD_PRIORITY_SCHEDULING
_POSIX_THREAD_PRIO_INHERIT, _SC_THREAD_PRIO_INHERIT
_POSIX_THREAD_PRIO_PROTECT, _SC_THREAD_PRIO_PROTECT
_POSIX_THREAD_PROCESS_SHARED, _SC_THREAD_PROCESS_SHARED
_POSIX_THREAD_SAFE_FUNCTIONS, _SC_THREAD_SAFE_FUNCTIONS
_POSIX_TIMERS, _SC_TIMERS
_POSIX_VERSION, _SC_VERSION
_XBS5_ILP32_OFF32, _SC_XBS5_ILP32_OFF32
_XBS5_ILP32_OFFBIG, _SC_XBS5_ILP32_OFFBIG
_XBS5_LP64_OFF64, _SC_XBS5_LP64_OFF64
_XBS5_LPBIG_OFFBIG, _SC_XBS5_LPBIG_OFFBIG
_XOPEN_CRYPT, _SC_XOPEN_CRYPT
_XOPEN_ENH_I18N, _SC_XOPEN_ENH_I18N
_XOPEN_LEGACY, _SC_XOPEN_LEGACY
_XOPEN_REALTIME, _SC_XOPEN_REALTIME
_XOPEN_REALTIME_THREADS, _SC_XOPEN_REALTIME_THREADS
_XOPEN_SHM, _SC_XOPEN_SHM
_XOPEN_UNIX, _SC_XOPEN_UNIX
_XOPEN_VERSION, _SC_XOPEN_VERSION
_XOPEN_XCU_VERSION, _SC_XCU_VERSION
%%
int
find_sysconf(const char *name)
{
const struct map *rv;
rv = in_word_set(name, strlen(name));
if (rv != 0)
return rv->key;
else
return -1;
}
|