OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [newlib-1.18.0/] [newlib/] [libc/] [sys/] [linux/] [sysconf.c] - Blame information for rev 258

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 207 jeremybenn
/* libc/sys/linux/sysconf.c - The sysconf function */
2
 
3
/* Copyright 2002, Red Hat Inc. */
4
 
5
 
6
#include <unistd.h>
7
#include <limits.h>
8
#include <time.h>
9
#include <errno.h>
10
#include <sys/types.h>
11
 
12
long int
13
sysconf (int name)
14
{
15
  switch (name)
16
    {
17
    case _SC_AIO_LISTIO_MAX:
18
#ifdef AIO_LISTIO_MAX
19
      return AIO_LISTIO_MAX;
20
#else
21
      return -1;
22
#endif
23
 
24
    case _SC_AIO_MAX:
25
#ifdef AIO_MAX
26
      return AIO_MAX;
27
#else
28
      return -1;
29
#endif
30
 
31
    case _SC_AIO_PRIO_DELTA_MAX:
32
#ifdef AIO_PRIO_DELTA_MAX
33
      return AIO_PRIO_DELTA_MAX;
34
#else
35
      return -1;
36
#endif
37
 
38
    case _SC_ARG_MAX:
39
#ifdef ARG_MAX
40
      return ARG_MAX;
41
#else
42
      return -1;
43
#endif
44
 
45
    case _SC_CHILD_MAX:
46
#ifdef CHILD_MAX
47
      return CHILD_MAX;
48
#else
49
      return -1;
50
#endif
51
 
52
    case _SC_CLK_TCK:
53
      return CLK_TCK;
54
 
55
    case _SC_DELAYTIMER_MAX:
56
#ifdef DELAYTIMER_MAX
57
      return DELAYTIMER_MAX;
58
#else
59
      return -1;
60
#endif
61
 
62
    case _SC_GETGR_R_SIZE_MAX:
63
#ifdef _GETGR_R_SIZE_MAX
64
      return _GETGR_R_SIZE_MAX;
65
#else
66
      return -1;
67
#endif
68
 
69
    case _SC_GETPW_R_SIZE_MAX:
70
#ifdef _GETPW_R_SIZE_MAX
71
      return _GETPW_R_SIZE_MAX;
72
#else
73
      return -1;
74
#endif
75
 
76
    case _SC_LOGIN_NAME_MAX:
77
#ifdef LOGIN_NAME_MAX
78
      return LOGIN_NAME_MAX;
79
#else
80
      return -1;
81
#endif
82
 
83
    case _SC_MQ_OPEN_MAX:
84
#ifdef MQ_OPEN_MAX
85
      return MQ_OPEN_MAX;
86
#else
87
      return -1;
88
#endif
89
 
90
    case _SC_MQ_PRIO_MAX:
91
#ifdef MQ_PRIO_MAX
92
      return MQ_PRIO_MAX;
93
#else
94
      return -1;
95
#endif
96
 
97
    case _SC_NGROUPS_MAX:
98
#ifdef NGROUPS_MAX
99
      return NGROUPS_MAX;
100
#else
101
      return -1;
102
#endif
103
 
104
    case _SC_OPEN_MAX:
105
#ifdef OPEN_MAX
106
      return OPEN_MAX;
107
#else
108
      return -1;
109
#endif
110
 
111
    case _SC_PAGESIZE:
112
#ifdef PAGESIZE
113
      return PAGESIZE;
114
#else
115
      return -1;
116
#endif
117
 
118
    case _SC_RTSIG_MAX:
119
#ifdef RTSIG_MAX
120
      return RTSIG_MAX;
121
#else
122
      return -1;
123
#endif
124
 
125
    case _SC_SEM_NSEMS_MAX:
126
#ifdef SEM_NSEMS_MAX
127
      return SEM_NSEMS_MAX;
128
#else
129
      return -1;
130
#endif
131
 
132
    case _SC_SEM_VALUE_MAX:
133
#ifdef SEM_VALUE_MAX
134
      return SEM_VALUE_MAX;
135
#else
136
      return -1;
137
#endif
138
 
139
    case _SC_SIGQUEUE_MAX:
140
#ifdef SIGQUEUE_MAX
141
      return SIGQUEUE_MAX;
142
#else
143
      return -1;
144
#endif
145
 
146
    case _SC_STREAM_MAX:
147
#ifdef STREAM_MAX
148
      return STREAM_MAX;
149
#else
150
      return -1;
151
#endif
152
 
153
    case _SC_THREAD_DESTRUCTOR_ITERATIONS:
154
#ifdef PTHREAD_DESTRUCTOR_ITERATIONS
155
      return PTHREAD_DESTRUCTOR_ITERATIONS;
156
#else
157
      return -1;
158
#endif
159
 
160
    case _SC_THREAD_KEYS_MAX:
161
#ifdef PTHREAD_KEYS_MAX
162
      return PTHREAD_KEYS_MAX;
163
#else
164
      return -1;
165
#endif
166
 
167
    case _SC_THREAD_STACK_MIN:
168
#ifdef PTHREAD_STACK_MIN
169
      return PTHREAD_STACK_MIN;
170
#else
171
      return -1;
172
#endif
173
 
174
    case _SC_THREAD_THREADS_MAX:
175
#ifdef PTHREAD_THREADS_MAX
176
      return PTHREAD_THREADS_MAX;
177
#else
178
      return -1;
179
#endif
180
 
181
    case _SC_TIMER_MAX:
182
#ifdef TIMER_MAX
183
      return TIMER_MAX;
184
#else
185
      return -1;
186
#endif
187
 
188
    case _SC_TTY_NAME_MAX:
189
#ifdef TTY_NAME_MAX
190
      return TTY_NAME_MAX;
191
#else
192
      return -1;
193
#endif
194
 
195
    case _SC_TZNAME_MAX:
196
#ifdef TZNAME_MAX
197
      return TZNAME_MAX;
198
#else
199
      return -1;
200
#endif
201
 
202
    case _SC_ASYNCHRONOUS_IO:
203
#ifdef _POSIX_ASYNCHRONOUS_IO
204
      return 1;
205
#else
206
      return -1;
207
#endif
208
 
209
    case _SC_FSYNC:
210
#ifdef _POSIX_FSYNC
211
      return 1;
212
#else
213
      return -1;
214
#endif
215
 
216
    case _SC_JOB_CONTROL:
217
#ifdef _POSIX_JOB_CONTROL
218
      return 1;
219
#else
220
      return -1;
221
#endif
222
 
223
    case _SC_MAPPED_FILES:
224
#ifdef _POSIX_MAPPED_FILES
225
      return 1;
226
#else
227
      return -1;
228
#endif
229
 
230
    case _SC_MEMLOCK:
231
#ifdef _POSIX_MEMLOCK
232
      return 1;
233
#else
234
      return -1;
235
#endif
236
 
237
    case _SC_MEMLOCK_RANGE:
238
#ifdef _POSIX_MEMLOCK_RANGE
239
      return _POSIX_MEMLOCK_RANGE;
240
#else
241
      return -1;
242
#endif
243
 
244
    case _SC_MEMORY_PROTECTION:
245
#ifdef _POSIX_MEMORY_PROTECTION
246
      return 1;
247
#else
248
      return -1;
249
#endif
250
 
251
    case _SC_MESSAGE_PASSING:
252
#ifdef _POSIX_MESSAGE_PASSING
253
      return 1;
254
#else
255
      return -1;
256
#endif
257
 
258
    case _SC_PRIORITIZED_IO:
259
#ifdef _POSIX_PRIORITIZED_IO
260
      return 1;
261
#else
262
      return -1;
263
#endif
264
 
265
    case _SC_PRIORITY_SCHEDULING:
266
#ifdef _POSIX_PRIORITY_SCHEDULING
267
      return 1;
268
#else
269
      return -1;
270
#endif
271
 
272
    case _SC_REALTIME_SIGNALS:
273
#ifdef _POSIX_REALTIME_SIGNALS
274
      return 1;
275
#else
276
      return -1;
277
#endif
278
 
279
    case _SC_SAVED_IDS:
280
#ifdef _POSIX_SAVED_IDS
281
      return 1;
282
#else
283
      return -1;
284
#endif
285
 
286
    case _SC_SEMAPHORES:
287
#ifdef _POSIX_SEMAPHORES
288
      return 1;
289
#else
290
      return -1;
291
#endif
292
 
293
    case _SC_SHARED_MEMORY_OBJECTS:
294
#ifdef _POSIX_SHARED_MEMORY_OBJECTS
295
      return 1;
296
#else
297
      return -1;
298
#endif
299
 
300
    case _SC_SYNCHRONIZED_IO:
301
#ifdef _POSIX_SYNCHRONIZED_IO
302
      return 1;
303
#else
304
      return -1;
305
#endif
306
 
307
    case _SC_TIMERS:
308
#ifdef _POSIX_TIMERS
309
      return 1;
310
#else
311
      return -1;
312
#endif
313
 
314
    case _SC_THREADS:
315
#ifdef _POSIX_THREADS
316
      return 1;
317
#else
318
      return -1;
319
#endif
320
 
321
    case _SC_THREAD_ATTR_STACKADDR:
322
#ifdef _POSIX_THREAD_ATTR_STACKADDR
323
      return 1;
324
#else
325
      return -1;
326
#endif
327
 
328
    case _SC_THREAD_ATTR_STACKSIZE:
329
#ifdef _POSIX_THREAD_ATTR_STACKSIZE
330
      return 1;
331
#else
332
      return -1;
333
#endif
334
 
335
    case _SC_THREAD_PRIORITY_SCHEDULING:
336
#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING
337
      return 1;
338
#else
339
      return -1;
340
#endif
341
 
342
    case _SC_THREAD_PRIO_INHERIT:
343
#ifdef _POSIX_THREAD_PRIO_INHERIT
344
      return 1;
345
#else
346
      return -1;
347
#endif
348
 
349
    case _SC_THREAD_PRIO_PROTECT:
350
#ifdef _POSIX_THREAD_PRIO_PROTECT
351
      return 1;
352
#else
353
      return -1;
354
#endif
355
 
356
    case _SC_THREAD_PROCESS_SHARED:
357
#ifdef _POSIX_THREAD_PROCESS_SHARED
358
      return 1;
359
#else
360
      return -1;
361
#endif
362
 
363
    case _SC_THREAD_SAFE_FUNCTIONS:
364
#ifdef _POSIX_THREAD_SAFE_FUNCTIONS
365
      return 1;
366
#else
367
      return -1;
368
#endif
369
 
370
    case _SC_VERSION:
371
#ifdef _POSIX_VERSION
372
      return _POSIX_VERSION;
373
#else
374
      return -1;
375
#endif
376
 
377
    default:
378
      errno = EINVAL;
379
      return -1;
380
    }
381
 
382
  return -1; /* can't get here */
383
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.