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

Subversion Repositories or1k_old

[/] [or1k_old/] [trunk/] [linux/] [uClibc/] [libc/] [unistd/] [sysconf.c] - Blame information for rev 1765

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

Line No. Rev Author Line
1 1325 phoenix
/* Copyright (C) 1991, 93, 95, 96, 97, 2000 Free Software Foundation, Inc.
2
   This file is part of the GNU C Library.
3
 
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.
8
 
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.
13
 
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.  */
18
 
19
#define _XOPEN_SOURCE  500
20
#include <features.h>
21
#include <errno.h>
22
#include <limits.h>
23
#include <grp.h>
24
#include <pwd.h>
25
#include <stddef.h>
26
#include <stdio.h>
27
#include <stdlib.h>
28
#include <time.h>
29
#include <unistd.h>
30
#include <sys/sysinfo.h>
31
#include <sys/types.h>
32
#include <regex.h>
33
 
34
#ifndef __UCLIBC_CLK_TCK_CONST
35
#error __UCLIBC_CLK_TCK_CONST not defined!
36
#endif
37
 
38
extern int getpagesize (void);
39
extern int getdtablesize (void);
40
 
41
/***********************************************************************/
42
/*
43
 * Manuel Novoa III        Jan 2001
44
 *
45
 * On i386, the switch-based implementation generates 796 bytes of code.
46
 * However, many of the return values are repeats.  By collecting these
47
 * repeats and moving to a table-based implementation, we generate 283
48
 * bytes on i386 (-Os -fomit-frame-pointer).
49
 */
50
 
51
#ifdef _UCLIBC_GENERATE_SYSCONF_ARCH
52
/*
53
 * Set some errno's so the auto-gen code knows what it is dealing with.
54
 *    1) ENOSYS signifies that we're returning a default value.
55
 *       This is just extra info for development.
56
 *    2) EISNAM signifies that the value returned varies at runtime.
57
 *
58
 * Option: GETPAGESIZE_IS_DYNAMIC
59
 *    The current implementation of getpagesize in uClibc returns
60
 *    a constant.  The pagesize on the target arch should not vary,
61
 *    so it should be safe to set this as 0.
62
 */
63
#define RETURN_NEG_1 __set_errno(ENOSYS); return -1
64
#define RETURN_FUNCTION(f) __set_errno(EISNAM); return (long int) #f
65
#define GETPAGESIZE_IS_DYNAMIC 0
66
#else
67
#define RETURN_NEG_1 return -1
68
#define RETURN_FUNCTION(f) return f;
69
#endif /* _UCLIBC_GENERATE_SYSCONF_ARCH */
70
 
71
/* Get the value of the system variable NAME.  */
72
long int __sysconf(int name)
73
{
74
  switch (name)
75
    {
76
    default:
77
      __set_errno(EINVAL);
78
      return -1;
79
 
80
    case _SC_ARG_MAX:
81
#ifdef  ARG_MAX
82
      return ARG_MAX;
83
#else
84
      RETURN_NEG_1;
85
#endif
86
 
87
    case _SC_CHILD_MAX:
88
#ifdef  CHILD_MAX
89
      return CHILD_MAX;
90
#else
91
      RETURN_NEG_1;
92
#endif
93
 
94
    case _SC_CLK_TCK:
95
      /* Can't use CLK_TCK here since that calls __sysconf(_SC_CLK_TCK) */
96
      return __UCLIBC_CLK_TCK_CONST;
97
 
98
    case _SC_NGROUPS_MAX:
99
#ifdef  NGROUPS_MAX
100
      return NGROUPS_MAX;
101
#else
102
      RETURN_NEG_1;
103
#endif
104
 
105
    case _SC_OPEN_MAX:
106
#if 1
107
      RETURN_FUNCTION(getdtablesize());
108
#else
109
      RETURN_NEG_1;
110
#endif
111
 
112
    case _SC_STREAM_MAX:
113
#ifdef  STREAM_MAX
114
      return STREAM_MAX;
115
#else
116
      return FOPEN_MAX;
117
#endif
118
 
119
    case _SC_TZNAME_MAX:
120
#if 0
121
      RETURN_FUNCTION(tzname_max ());
122
#else
123
/*       RETURN_NEG_1; */
124
      return _POSIX_TZNAME_MAX;
125
#endif
126
 
127
    case _SC_JOB_CONTROL:
128
#ifdef  _POSIX_JOB_CONTROL
129
      return 1;
130
#else
131
      RETURN_NEG_1;
132
#endif
133
 
134
    case _SC_SAVED_IDS:
135
#ifdef  _POSIX_SAVED_IDS
136
      return 1;
137
#else
138
      RETURN_NEG_1;
139
#endif
140
 
141
    case _SC_REALTIME_SIGNALS:
142
#ifdef  _POSIX_REALTIME_SIGNALS
143
      return 1;
144
#else
145
      RETURN_NEG_1;
146
#endif
147
 
148
    case _SC_PRIORITY_SCHEDULING:
149
#ifdef  _POSIX_PRIORITY_SCHEDULING
150
      return 1;
151
#else
152
      RETURN_NEG_1;
153
#endif
154
 
155
    case _SC_TIMERS:
156
#ifdef  _POSIX_TIMERS
157
      return 1;
158
#else
159
      RETURN_NEG_1;
160
#endif
161
 
162
    case _SC_ASYNCHRONOUS_IO:
163
#ifdef  _POSIX_ASYNCHRONOUS_IO
164
      return 1;
165
#else
166
      RETURN_NEG_1;
167
#endif
168
 
169
    case _SC_PRIORITIZED_IO:
170
#ifdef  _POSIX_PRIORITIZED_IO
171
      return 1;
172
#else
173
      RETURN_NEG_1;
174
#endif
175
 
176
    case _SC_SYNCHRONIZED_IO:
177
#ifdef  _POSIX_SYNCHRONIZED_IO
178
      return 1;
179
#else
180
      RETURN_NEG_1;
181
#endif
182
 
183
    case _SC_FSYNC:
184
#ifdef  _POSIX_FSYNC
185
      return 1;
186
#else
187
      RETURN_NEG_1;
188
#endif
189
 
190
    case _SC_MAPPED_FILES:
191
#ifdef  _POSIX_MAPPED_FILES
192
      return 1;
193
#else
194
      RETURN_NEG_1;
195
#endif
196
 
197
    case _SC_MEMLOCK:
198
#ifdef  _POSIX_MEMLOCK
199
      return 1;
200
#else
201
      RETURN_NEG_1;
202
#endif
203
 
204
    case _SC_MEMLOCK_RANGE:
205
#ifdef  _POSIX_MEMLOCK_RANGE
206
      return 1;
207
#else
208
      RETURN_NEG_1;
209
#endif
210
 
211
    case _SC_MEMORY_PROTECTION:
212
#ifdef  _POSIX_MEMORY_PROTECTION
213
      return 1;
214
#else
215
      RETURN_NEG_1;
216
#endif
217
 
218
    case _SC_MESSAGE_PASSING:
219
#ifdef  _POSIX_MESSAGE_PASSING
220
      return 1;
221
#else
222
      RETURN_NEG_1;
223
#endif
224
 
225
    case _SC_SEMAPHORES:
226
#ifdef  _POSIX_SEMAPHORES
227
      return 1;
228
#else
229
      RETURN_NEG_1;
230
#endif
231
 
232
    case _SC_SHARED_MEMORY_OBJECTS:
233
#ifdef  _POSIX_SHARED_MEMORY_OBJECTS
234
      return 1;
235
#else
236
      RETURN_NEG_1;
237
#endif
238
 
239
    case _SC_VERSION:
240
      return _POSIX_VERSION;
241
 
242
    case _SC_PAGESIZE:
243
#if defined(GETPAGESIZE_IS_DYNAMIC) && (GETPAGESIZE_IS_DYNAMIC == 1)
244
      RETURN_FUNCTION(getpagesize());
245
#else
246
      return getpagesize();             /* note: currently this is not dynamic */
247
#endif
248
 
249
    case _SC_AIO_LISTIO_MAX:
250
#ifdef  AIO_LISTIO_MAX
251
      return AIO_LISTIO_MAX;
252
#else
253
      RETURN_NEG_1;
254
#endif
255
 
256
    case _SC_AIO_MAX:
257
#ifdef  AIO_MAX
258
      return AIO_MAX;
259
#else
260
      RETURN_NEG_1;
261
#endif
262
 
263
    case _SC_AIO_PRIO_DELTA_MAX:
264
#ifdef  AIO_PRIO_DELTA_MAX
265
      return AIO_PRIO_DELTA_MAX;
266
#else
267
      RETURN_NEG_1;
268
#endif
269
 
270
    case _SC_DELAYTIMER_MAX:
271
#ifdef  DELAYTIMER_MAX
272
      return DELAYTIMER_MAX;
273
#else
274
      RETURN_NEG_1;
275
#endif
276
 
277
    case _SC_MQ_OPEN_MAX:
278
#ifdef  MQ_OPEN_MAX
279
      return MQ_OPEN_MAX;
280
#else
281
      RETURN_NEG_1;
282
#endif
283
 
284
    case _SC_MQ_PRIO_MAX:
285
#ifdef  MQ_PRIO_MAX
286
      return MQ_PRIO_MAX;
287
#else
288
      RETURN_NEG_1;
289
#endif
290
 
291
    case _SC_RTSIG_MAX:
292
#ifdef  RTSIG_MAX
293
      return RTSIG_MAX;
294
#else
295
      RETURN_NEG_1;
296
#endif
297
 
298
    case _SC_SEM_NSEMS_MAX:
299
#ifdef  SEM_NSEMS_MAX
300
      return SEM_NSEMS_MAX;
301
#else
302
      RETURN_NEG_1;
303
#endif
304
 
305
    case _SC_SEM_VALUE_MAX:
306
#ifdef  SEM_VALUE_MAX
307
      return SEM_VALUE_MAX;
308
#else
309
      RETURN_NEG_1;
310
#endif
311
 
312
    case _SC_SIGQUEUE_MAX:
313
#ifdef  SIGQUEUE_MAX
314
      return SIGQUEUE_MAX;
315
#else
316
      RETURN_NEG_1;
317
#endif
318
 
319
    case _SC_TIMER_MAX:
320
#ifdef  TIMER_MAX
321
      return TIMER_MAX;
322
#else
323
      RETURN_NEG_1;
324
#endif
325
 
326
    case _SC_BC_BASE_MAX:
327
#ifdef  BC_BASE_MAX
328
      return BC_BASE_MAX;
329
#else
330
      RETURN_NEG_1;
331
#endif
332
 
333
    case _SC_BC_DIM_MAX:
334
#ifdef  BC_DIM_MAX
335
      return BC_DIM_MAX;
336
#else
337
      RETURN_NEG_1;
338
#endif
339
 
340
    case _SC_BC_SCALE_MAX:
341
#ifdef  BC_SCALE_MAX
342
      return BC_SCALE_MAX;
343
#else
344
      RETURN_NEG_1;
345
#endif
346
 
347
    case _SC_BC_STRING_MAX:
348
#ifdef  BC_STRING_MAX
349
      return BC_STRING_MAX;
350
#else
351
      RETURN_NEG_1;
352
#endif
353
 
354
    case _SC_COLL_WEIGHTS_MAX:
355
#ifdef  COLL_WEIGHTS_MAX
356
      return COLL_WEIGHTS_MAX;
357
#else
358
      RETURN_NEG_1;
359
#endif
360
 
361
    case _SC_EQUIV_CLASS_MAX:
362
#ifdef  EQUIV_CLASS_MAX
363
      return EQUIV_CLASS_MAX;
364
#else
365
      RETURN_NEG_1;
366
#endif
367
 
368
    case _SC_EXPR_NEST_MAX:
369
#ifdef  EXPR_NEST_MAX
370
      return EXPR_NEST_MAX;
371
#else
372
      RETURN_NEG_1;
373
#endif
374
 
375
    case _SC_LINE_MAX:
376
#ifdef  LINE_MAX
377
      return LINE_MAX;
378
#else
379
      RETURN_NEG_1;
380
#endif
381
 
382
    case _SC_RE_DUP_MAX:
383
#ifdef  RE_DUP_MAX
384
      return RE_DUP_MAX;
385
#else
386
      RETURN_NEG_1;
387
#endif
388
 
389
    case _SC_CHARCLASS_NAME_MAX:
390
#ifdef  CHARCLASS_NAME_MAX
391
      return CHARCLASS_NAME_MAX;
392
#else
393
      RETURN_NEG_1;
394
#endif
395
 
396
    case _SC_PII:
397
#ifdef  _POSIX_PII
398
      return 1;
399
#else
400
      RETURN_NEG_1;
401
#endif
402
 
403
    case _SC_PII_XTI:
404
#ifdef  _POSIX_PII_XTI
405
      return 1;
406
#else
407
      RETURN_NEG_1;
408
#endif
409
 
410
    case _SC_PII_SOCKET:
411
#ifdef  _POSIX_PII_SOCKET
412
      return 1;
413
#else
414
      RETURN_NEG_1;
415
#endif
416
 
417
    case _SC_PII_INTERNET:
418
#ifdef  _POSIX_PII_INTERNET
419
      return 1;
420
#else
421
      RETURN_NEG_1;
422
#endif
423
 
424
    case _SC_PII_OSI:
425
#ifdef  _POSIX_PII_OSI
426
      return 1;
427
#else
428
      RETURN_NEG_1;
429
#endif
430
 
431
    case _SC_POLL:
432
#ifdef  _POSIX_POLL
433
      return 1;
434
#else
435
      RETURN_NEG_1;
436
#endif
437
 
438
    case _SC_SELECT:
439
#ifdef  _POSIX_SELECT
440
      return 1;
441
#else
442
      RETURN_NEG_1;
443
#endif
444
 
445
    case _SC_UIO_MAXIOV:
446
#ifdef  UIO_MAXIOV
447
      return UIO_MAXIOV;
448
#else
449
      RETURN_NEG_1;
450
#endif
451
 
452
    case _SC_PII_INTERNET_STREAM:
453
#ifdef  _POSIX_PII_INTERNET_STREAM
454
      return 1;
455
#else
456
      RETURN_NEG_1;
457
#endif
458
 
459
    case _SC_PII_INTERNET_DGRAM:
460
#ifdef  _POSIX_PII_INTERNET_DGRAM
461
      return 1;
462
#else
463
      RETURN_NEG_1;
464
#endif
465
 
466
    case _SC_PII_OSI_COTS:
467
#ifdef  _POSIX_PII_OSI_COTS
468
      return 1;
469
#else
470
      RETURN_NEG_1;
471
#endif
472
 
473
    case _SC_PII_OSI_CLTS:
474
#ifdef  _POSIX_PII_OSI_CLTS
475
      return 1;
476
#else
477
      RETURN_NEG_1;
478
#endif
479
 
480
    case _SC_PII_OSI_M:
481
#ifdef  _POSIX_PII_OSI_M
482
      return 1;
483
#else
484
      RETURN_NEG_1;
485
#endif
486
 
487
    case _SC_T_IOV_MAX:
488
#ifdef  _T_IOV_MAX
489
      return _T_IOV_MAX;
490
#else
491
      RETURN_NEG_1;
492
#endif
493
 
494
    case _SC_2_VERSION:
495
      return _POSIX2_VERSION;
496
 
497
    case _SC_2_C_BIND:
498
#ifdef  _POSIX2_C_BIND
499
      return _POSIX2_C_BIND;
500
#else
501
      RETURN_NEG_1;
502
#endif
503
 
504
    case _SC_2_C_DEV:
505
#ifdef  _POSIX2_C_DEV
506
      return _POSIX2_C_DEV;
507
#else
508
      RETURN_NEG_1;
509
#endif
510
 
511
    case _SC_2_C_VERSION:
512
#ifdef  _POSIX2_C_VERSION
513
      return _POSIX2_C_VERSION;
514
#else
515
      RETURN_NEG_1;
516
#endif
517
 
518
    case _SC_2_FORT_DEV:
519
#ifdef  _POSIX2_FORT_DEV
520
      return _POSIX2_FORT_DEV;
521
#else
522
      RETURN_NEG_1;
523
#endif
524
 
525
    case _SC_2_FORT_RUN:
526
#ifdef  _POSIX2_FORT_RUN
527
      return _POSIX2_FORT_RUN;
528
#else
529
      RETURN_NEG_1;
530
#endif
531
 
532
    case _SC_2_LOCALEDEF:
533
#ifdef  _POSIX2_LOCALEDEF
534
      return _POSIX2_LOCALEDEF;
535
#else
536
      RETURN_NEG_1;
537
#endif
538
 
539
    case _SC_2_SW_DEV:
540
#ifdef  _POSIX2_SW_DEV
541
      return _POSIX2_SW_DEV;
542
#else
543
      RETURN_NEG_1;
544
#endif
545
 
546
    case _SC_2_CHAR_TERM:
547
#ifdef  _POSIX2_CHAR_TERM
548
      return _POSIX2_CHAR_TERM;
549
#else
550
      RETURN_NEG_1;
551
#endif
552
 
553
    case _SC_2_UPE:
554
#ifdef  _POSIX2_UPE
555
      return _POSIX2_UPE;
556
#else
557
      RETURN_NEG_1;
558
#endif
559
 
560
      /* POSIX 1003.1c (POSIX Threads).  */
561
    case _SC_THREADS:
562
#ifdef  _POSIX_THREADS
563
      return 1;
564
#else
565
      RETURN_NEG_1;
566
#endif
567
 
568
    case _SC_THREAD_SAFE_FUNCTIONS:
569
#ifdef  _POSIX_THREAD_SAFE_FUNCTIONS
570
      return 1;
571
#else
572
      RETURN_NEG_1;
573
#endif
574
 
575
    case _SC_GETGR_R_SIZE_MAX:
576
#ifdef  NSS_BUFLEN_GROUP
577
      return NSS_BUFLEN_GROUP;
578
#else
579
      RETURN_NEG_1;
580
#endif
581
 
582
    case _SC_GETPW_R_SIZE_MAX:
583
#ifdef  NSS_BUFLEN_PASSWD
584
      return NSS_BUFLEN_PASSWD;
585
#else
586
      RETURN_NEG_1;
587
#endif
588
 
589
    case _SC_LOGIN_NAME_MAX:
590
#ifdef  _POSIX_LOGIN_NAME_MAX
591
      return _POSIX_LOGIN_NAME_MAX;
592
#else
593
      RETURN_NEG_1;
594
#endif
595
 
596
    case _SC_TTY_NAME_MAX:
597
#ifdef  _POSIX_TTY_NAME_MAX
598
      return _POSIX_TTY_NAME_MAX;
599
#else
600
      RETURN_NEG_1;
601
#endif
602
 
603
    case _SC_THREAD_DESTRUCTOR_ITERATIONS:
604
#ifdef  _POSIX_THREAD_DESTRUCTOR_ITERATIONS
605
      return _POSIX_THREAD_DESTRUCTOR_ITERATIONS;
606
#else
607
      RETURN_NEG_1;
608
#endif
609
 
610
    case _SC_THREAD_KEYS_MAX:
611
#ifdef  PTHREAD_KEYS_MAX
612
      return PTHREAD_KEYS_MAX;
613
#else
614
      RETURN_NEG_1;
615
#endif
616
 
617
    case _SC_THREAD_STACK_MIN:
618
#ifdef  PTHREAD_STACK_MIN
619
      return PTHREAD_STACK_MIN;
620
#else
621
      RETURN_NEG_1;
622
#endif
623
 
624
    case _SC_THREAD_THREADS_MAX:
625
#ifdef  PTHREAD_THREADS_MAX
626
      return PTHREAD_THREADS_MAX;
627
#else
628
      RETURN_NEG_1;
629
#endif
630
 
631
    case _SC_THREAD_ATTR_STACKADDR:
632
#ifdef  _POSIX_THREAD_ATTR_STACKADDR
633
      return 1;
634
#else
635
      RETURN_NEG_1;
636
#endif
637
 
638
    case _SC_THREAD_ATTR_STACKSIZE:
639
#ifdef  _POSIX_THREAD_ATTR_STACKSIZE
640
      return 1;
641
#else
642
      RETURN_NEG_1;
643
#endif
644
 
645
    case _SC_THREAD_PRIORITY_SCHEDULING:
646
#ifdef  _POSIX_THREAD_PRIORITY_SCHEDULING
647
      return 1;
648
#else
649
      RETURN_NEG_1;
650
#endif
651
 
652
    case _SC_THREAD_PRIO_INHERIT:
653
#ifdef  _POSIX_THREAD_PRIO_INHERIT
654
      return 1;
655
#else
656
      RETURN_NEG_1;
657
#endif
658
 
659
    case _SC_THREAD_PRIO_PROTECT:
660
#ifdef  _POSIX_THREAD_PRIO_PROTECT
661
      return 1;
662
#else
663
      RETURN_NEG_1;
664
#endif
665
 
666
    case _SC_THREAD_PROCESS_SHARED:
667
#ifdef  _POSIX_THREAD_PROCESS_SHARED
668
      return 1;
669
#else
670
      RETURN_NEG_1;
671
#endif
672
 
673
    case _SC_NPROCESSORS_CONF:
674
#if 0
675
      RETURN_FUNCTION(get_nprocs_conf());
676
#else
677
      /* this is a hack.  for now always claim we have exactly one cpu */
678
      return 1;
679
#endif
680
 
681
    case _SC_NPROCESSORS_ONLN:
682
#if 0
683
      RETURN_FUNCTION(get_nprocs());
684
#else
685
      /* this is a hack.  for now always claim we have exactly one cpu */
686
      return 1;
687
#endif
688
 
689
    case _SC_PHYS_PAGES:
690
#if 0
691
      RETURN_FUNCTION(get_phys_pages());
692
#else
693
      RETURN_NEG_1;
694
#endif
695
 
696
    case _SC_AVPHYS_PAGES:
697
#if 0
698
      RETURN_FUNCTION(get_avphys_pages());
699
#else
700
      RETURN_NEG_1;
701
#endif
702
 
703
    case _SC_ATEXIT_MAX:
704
      return __UCLIBC_MAX_ATEXIT;
705
 
706
    case _SC_PASS_MAX:
707
      /* We have no limit but since the return value might be used to
708
         allocate a buffer we restrict the value.  */
709
      return BUFSIZ;
710
 
711
    case _SC_XOPEN_VERSION:
712
      return _XOPEN_VERSION;
713
 
714
    case _SC_XOPEN_XCU_VERSION:
715
      return _XOPEN_XCU_VERSION;
716
 
717
    case _SC_XOPEN_UNIX:
718
      return _XOPEN_UNIX;
719
 
720
    case _SC_XOPEN_CRYPT:
721
#ifdef  _XOPEN_CRYPT
722
      return _XOPEN_CRYPT;
723
#else
724
      RETURN_NEG_1;
725
#endif
726
 
727
    case _SC_XOPEN_ENH_I18N:
728
#ifdef  _XOPEN_ENH_I18N
729
      return _XOPEN_ENH_I18N;
730
#else
731
      RETURN_NEG_1;
732
#endif
733
 
734
    case _SC_XOPEN_SHM:
735
#ifdef  _XOPEN_SHM
736
      return _XOPEN_SHM;
737
#else
738
      RETURN_NEG_1;
739
#endif
740
 
741
    case _SC_XOPEN_XPG2:
742
#ifdef  _XOPEN_XPG2
743
      return _XOPEN_XPG2;
744
#else
745
      RETURN_NEG_1;
746
#endif
747
 
748
    case _SC_XOPEN_XPG3:
749
#ifdef  _XOPEN_XPG3
750
      return _XOPEN_XPG3;
751
#else
752
      RETURN_NEG_1;
753
#endif
754
 
755
    case _SC_XOPEN_XPG4:
756
#ifdef  _XOPEN_XPG4
757
      return _XOPEN_XPG4;
758
#else
759
      RETURN_NEG_1;
760
#endif
761
 
762
    case _SC_CHAR_BIT:
763
      return CHAR_BIT;
764
 
765
    case _SC_CHAR_MAX:
766
      return CHAR_MAX;
767
 
768
    case _SC_CHAR_MIN:
769
      return CHAR_MIN;
770
 
771
    case _SC_INT_MAX:
772
      return INT_MAX;
773
 
774
    case _SC_INT_MIN:
775
      return INT_MIN;
776
 
777
    case _SC_LONG_BIT:
778
      return sizeof (long int) * CHAR_BIT;
779
 
780
    case _SC_WORD_BIT:
781
      return sizeof (int) * CHAR_BIT;
782
 
783
    case _SC_MB_LEN_MAX:
784
      return MB_LEN_MAX;
785
 
786
    case _SC_NZERO:
787
      return NZERO;
788
 
789
    case _SC_SSIZE_MAX:
790
      return _POSIX_SSIZE_MAX;
791
 
792
    case _SC_SCHAR_MAX:
793
      return SCHAR_MAX;
794
 
795
    case _SC_SCHAR_MIN:
796
      return SCHAR_MIN;
797
 
798
    case _SC_SHRT_MAX:
799
      return SHRT_MAX;
800
 
801
    case _SC_SHRT_MIN:
802
      return SHRT_MIN;
803
 
804
    case _SC_UCHAR_MAX:
805
      return UCHAR_MAX;
806
 
807
    case _SC_UINT_MAX:
808
      return UINT_MAX;
809
 
810
    case _SC_ULONG_MAX:
811
      return ULONG_MAX;
812
 
813
    case _SC_USHRT_MAX:
814
      return USHRT_MAX;
815
 
816
    case _SC_NL_ARGMAX:
817
#ifdef  NL_ARGMAX
818
      return NL_ARGMAX;
819
#else
820
      RETURN_NEG_1;
821
#endif
822
 
823
    case _SC_NL_LANGMAX:
824
#ifdef  NL_LANGMAX
825
      return NL_LANGMAX;
826
#else
827
      RETURN_NEG_1;
828
#endif
829
 
830
    case _SC_NL_MSGMAX:
831
#ifdef  NL_MSGMAX
832
      return NL_MSGMAX;
833
#else
834
      RETURN_NEG_1;
835
#endif
836
 
837
    case _SC_NL_NMAX:
838
#ifdef  NL_NMAX
839
      return NL_NMAX;
840
#else
841
      RETURN_NEG_1;
842
#endif
843
 
844
    case _SC_NL_SETMAX:
845
#ifdef  NL_SETMAX
846
      return NL_SETMAX;
847
#else
848
      RETURN_NEG_1;
849
#endif
850
 
851
    case _SC_NL_TEXTMAX:
852
#ifdef  NL_TEXTMAX
853
      return NL_TEXTMAX;
854
#else
855
      RETURN_NEG_1;
856
#endif
857
 
858
    case _SC_XBS5_ILP32_OFF32:
859
#ifdef _XBS5_ILP32_OFF32
860
      return _XBS5_ILP32_OFF32;
861
#else
862
      RETURN_NEG_1;
863
#endif
864
    case _SC_XBS5_ILP32_OFFBIG:
865
#ifdef _XBS5_ILP32_OFFBIG
866
      return _XBS5_ILP32_OFFBIG;
867
#else
868
      RETURN_NEG_1;
869
#endif
870
    case _SC_XBS5_LP64_OFF64:
871
#ifdef _XBS5_LP64_OFF64
872
      return _XBS5_LP64_OFF64;
873
#else
874
      RETURN_NEG_1;
875
#endif
876
    case _SC_XBS5_LPBIG_OFFBIG:
877
#ifdef _XBS5_LPBIG_OFFBIG
878
      return _XBS5_LPBIG_OFFBIG;
879
#else
880
      RETURN_NEG_1;
881
#endif
882
 
883
    case _SC_XOPEN_LEGACY:
884
      return _XOPEN_LEGACY;
885
 
886
    case _SC_XOPEN_REALTIME:
887
#ifdef _XOPEN_REALTIME
888
      return _XOPEN_REALTIME;
889
#else
890
      RETURN_NEG_1;
891
#endif
892
    case _SC_XOPEN_REALTIME_THREADS:
893
#ifdef _XOPEN_REALTIME_THREADS
894
      return _XOPEN_REALTIME_THREADS;
895
#else
896
      RETURN_NEG_1;
897
#endif
898
    }
899
}
900
weak_alias(__sysconf, sysconf);
901
 

powered by: WebSVN 2.1.0

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