Update.
[glibc.git] / sysdeps / posix / sysconf.c
blob05a9538271516b93891342a109394a65e9f7c641
1 /* Copyright (C) 1991,93,95,96,97,99,2000,2001 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 Lesser General Public
6 License as published by the Free Software Foundation; either
7 version 2.1 of the 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 Lesser General Public License for more details.
14 You should have received a copy of the GNU Lesser General Public
15 License along with the GNU C Library; if not, write to the Free
16 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
17 02111-1307 USA. */
19 #include <errno.h>
20 #include <limits.h>
21 #include <grp.h>
22 #include <pwd.h>
23 #include <stddef.h>
24 #include <stdio.h>
25 #include <time.h>
26 #include <unistd.h>
27 #include <sys/param.h>
28 #include <sys/sysinfo.h>
29 #include <sys/types.h>
30 #include <regex.h>
33 /* Get the value of the system variable NAME. */
34 long int
35 __sysconf (name)
36 int name;
38 switch (name)
40 default:
41 __set_errno (EINVAL);
42 return -1;
44 case _SC_ARG_MAX:
45 #ifdef ARG_MAX
46 return ARG_MAX;
47 #else
48 return -1;
49 #endif
51 case _SC_CHILD_MAX:
52 #ifdef CHILD_MAX
53 return CHILD_MAX;
54 #else
55 return -1;
56 #endif
58 case _SC_CLK_TCK:
59 return __getclktck ();
61 case _SC_NGROUPS_MAX:
62 #ifdef NGROUPS_MAX
63 return NGROUPS_MAX;
64 #else
65 return -1;
66 #endif
68 case _SC_OPEN_MAX:
69 return __getdtablesize ();
71 case _SC_STREAM_MAX:
72 #ifdef STREAM_MAX
73 return STREAM_MAX;
74 #else
75 return FOPEN_MAX;
76 #endif
78 case _SC_TZNAME_MAX:
79 return MAX (__tzname_max (), _POSIX_TZNAME_MAX);
81 case _SC_JOB_CONTROL:
82 #ifdef _POSIX_JOB_CONTROL
83 return 1;
84 #else
85 return -1;
86 #endif
88 case _SC_SAVED_IDS:
89 #ifdef _POSIX_SAVED_IDS
90 return 1;
91 #else
92 return -1;
93 #endif
95 case _SC_REALTIME_SIGNALS:
96 #ifdef _POSIX_REALTIME_SIGNALS
97 return 1;
98 #else
99 return -1;
100 #endif
102 case _SC_PRIORITY_SCHEDULING:
103 #ifdef _POSIX_PRIORITY_SCHEDULING
104 return 1;
105 #else
106 return -1;
107 #endif
109 case _SC_TIMERS:
110 #ifdef _POSIX_TIMERS
111 return 1;
112 #else
113 return -1;
114 #endif
116 case _SC_ASYNCHRONOUS_IO:
117 #ifdef _POSIX_ASYNCHRONOUS_IO
118 return 1;
119 #else
120 return -1;
121 #endif
123 case _SC_PRIORITIZED_IO:
124 #ifdef _POSIX_PRIORITIZED_IO
125 return 1;
126 #else
127 return -1;
128 #endif
130 case _SC_SYNCHRONIZED_IO:
131 #ifdef _POSIX_SYNCHRONIZED_IO
132 return 1;
133 #else
134 return -1;
135 #endif
137 case _SC_FSYNC:
138 #ifdef _POSIX_FSYNC
139 return 1;
140 #else
141 return -1;
142 #endif
144 case _SC_MAPPED_FILES:
145 #ifdef _POSIX_MAPPED_FILES
146 return 1;
147 #else
148 return -1;
149 #endif
151 case _SC_MEMLOCK:
152 #ifdef _POSIX_MEMLOCK
153 return 1;
154 #else
155 return -1;
156 #endif
158 case _SC_MEMLOCK_RANGE:
159 #ifdef _POSIX_MEMLOCK_RANGE
160 return 1;
161 #else
162 return -1;
163 #endif
165 case _SC_MEMORY_PROTECTION:
166 #ifdef _POSIX_MEMORY_PROTECTION
167 return 1;
168 #else
169 return -1;
170 #endif
172 case _SC_MESSAGE_PASSING:
173 #ifdef _POSIX_MESSAGE_PASSING
174 return 1;
175 #else
176 return -1;
177 #endif
179 case _SC_SEMAPHORES:
180 #ifdef _POSIX_SEMAPHORES
181 return 1;
182 #else
183 return -1;
184 #endif
186 case _SC_SHARED_MEMORY_OBJECTS:
187 #ifdef _POSIX_SHARED_MEMORY_OBJECTS
188 return 1;
189 #else
190 return -1;
191 #endif
193 case _SC_VERSION:
194 return _POSIX_VERSION;
196 case _SC_PAGESIZE:
197 return __getpagesize ();
199 case _SC_AIO_LISTIO_MAX:
200 #ifdef AIO_LISTIO_MAX
201 return AIO_LISTIO_MAX;
202 #else
203 return -1;
204 #endif
206 case _SC_AIO_MAX:
207 #ifdef AIO_MAX
208 return AIO_MAX;
209 #else
210 return -1;
211 #endif
213 case _SC_AIO_PRIO_DELTA_MAX:
214 #ifdef AIO_PRIO_DELTA_MAX
215 return AIO_PRIO_DELTA_MAX;
216 #else
217 return -1;
218 #endif
220 case _SC_DELAYTIMER_MAX:
221 #ifdef DELAYTIMER_MAX
222 return DELAYTIMER_MAX;
223 #else
224 return -1;
225 #endif
227 case _SC_MQ_OPEN_MAX:
228 #ifdef MQ_OPEN_MAX
229 return MQ_OPEN_MAX;
230 #else
231 return -1;
232 #endif
234 case _SC_MQ_PRIO_MAX:
235 #ifdef MQ_PRIO_MAX
236 return MQ_PRIO_MAX;
237 #else
238 return -1;
239 #endif
241 case _SC_RTSIG_MAX:
242 #ifdef RTSIG_MAX
243 return RTSIG_MAX;
244 #else
245 return -1;
246 #endif
248 case _SC_SEM_NSEMS_MAX:
249 #ifdef SEM_NSEMS_MAX
250 return SEM_NSEMS_MAX;
251 #else
252 return -1;
253 #endif
255 case _SC_SEM_VALUE_MAX:
256 #ifdef SEM_VALUE_MAX
257 return SEM_VALUE_MAX;
258 #else
259 return -1;
260 #endif
262 case _SC_SIGQUEUE_MAX:
263 #ifdef SIGQUEUE_MAX
264 return SIGQUEUE_MAX;
265 #else
266 return -1;
267 #endif
269 case _SC_TIMER_MAX:
270 #ifdef TIMER_MAX
271 return TIMER_MAX;
272 #else
273 return -1;
274 #endif
276 case _SC_BC_BASE_MAX:
277 #ifdef BC_BASE_MAX
278 return BC_BASE_MAX;
279 #else
280 return -1;
281 #endif
283 case _SC_BC_DIM_MAX:
284 #ifdef BC_DIM_MAX
285 return BC_DIM_MAX;
286 #else
287 return -1;
288 #endif
290 case _SC_BC_SCALE_MAX:
291 #ifdef BC_SCALE_MAX
292 return BC_SCALE_MAX;
293 #else
294 return -1;
295 #endif
297 case _SC_BC_STRING_MAX:
298 #ifdef BC_STRING_MAX
299 return BC_STRING_MAX;
300 #else
301 return -1;
302 #endif
304 case _SC_COLL_WEIGHTS_MAX:
305 #ifdef COLL_WEIGHTS_MAX
306 return COLL_WEIGHTS_MAX;
307 #else
308 return -1;
309 #endif
311 case _SC_EXPR_NEST_MAX:
312 #ifdef EXPR_NEST_MAX
313 return EXPR_NEST_MAX;
314 #else
315 return -1;
316 #endif
318 case _SC_LINE_MAX:
319 #ifdef LINE_MAX
320 return LINE_MAX;
321 #else
322 return -1;
323 #endif
325 case _SC_RE_DUP_MAX:
326 #ifdef RE_DUP_MAX
327 return RE_DUP_MAX;
328 #else
329 return -1;
330 #endif
332 case _SC_CHARCLASS_NAME_MAX:
333 #ifdef CHARCLASS_NAME_MAX
334 return CHARCLASS_NAME_MAX;
335 #else
336 return -1;
337 #endif
339 case _SC_PII:
340 #ifdef _POSIX_PII
341 return 1;
342 #else
343 return -1;
344 #endif
346 case _SC_PII_XTI:
347 #ifdef _POSIX_PII_XTI
348 return 1;
349 #else
350 return -1;
351 #endif
353 case _SC_PII_SOCKET:
354 #ifdef _POSIX_PII_SOCKET
355 return 1;
356 #else
357 return -1;
358 #endif
360 case _SC_PII_INTERNET:
361 #ifdef _POSIX_PII_INTERNET
362 return 1;
363 #else
364 return -1;
365 #endif
367 case _SC_PII_OSI:
368 #ifdef _POSIX_PII_OSI
369 return 1;
370 #else
371 return -1;
372 #endif
374 case _SC_POLL:
375 #ifdef _POSIX_POLL
376 return 1;
377 #else
378 return -1;
379 #endif
381 case _SC_SELECT:
382 #ifdef _POSIX_SELECT
383 return 1;
384 #else
385 return -1;
386 #endif
388 case _SC_UIO_MAXIOV:
389 #ifdef UIO_MAXIOV
390 return UIO_MAXIOV;
391 #else
392 return -1;
393 #endif
395 case _SC_PII_INTERNET_STREAM:
396 #ifdef _POSIX_PII_INTERNET_STREAM
397 return 1;
398 #else
399 return -1;
400 #endif
402 case _SC_PII_INTERNET_DGRAM:
403 #ifdef _POSIX_PII_INTERNET_DGRAM
404 return 1;
405 #else
406 return -1;
407 #endif
409 case _SC_PII_OSI_COTS:
410 #ifdef _POSIX_PII_OSI_COTS
411 return 1;
412 #else
413 return -1;
414 #endif
416 case _SC_PII_OSI_CLTS:
417 #ifdef _POSIX_PII_OSI_CLTS
418 return 1;
419 #else
420 return -1;
421 #endif
423 case _SC_PII_OSI_M:
424 #ifdef _POSIX_PII_OSI_M
425 return 1;
426 #else
427 return -1;
428 #endif
430 case _SC_T_IOV_MAX:
431 #ifdef _T_IOV_MAX
432 return _T_IOV_MAX;
433 #else
434 return -1;
435 #endif
437 case _SC_2_VERSION:
438 return _POSIX2_VERSION;
440 case _SC_2_C_BIND:
441 #ifdef _POSIX2_C_BIND
442 return _POSIX2_C_BIND;
443 #else
444 return -1;
445 #endif
447 case _SC_2_C_DEV:
448 #ifdef _POSIX2_C_DEV
449 return _POSIX2_C_DEV;
450 #else
451 return -1;
452 #endif
454 case _SC_2_C_VERSION:
455 #ifdef _POSIX2_C_VERSION
456 return _POSIX2_C_VERSION;
457 #else
458 return -1;
459 #endif
461 case _SC_2_FORT_DEV:
462 #ifdef _POSIX2_FORT_DEV
463 return _POSIX2_FORT_DEV;
464 #else
465 return -1;
466 #endif
468 case _SC_2_LOCALEDEF:
469 #ifdef _POSIX2_LOCALEDEF
470 return _POSIX2_LOCALEDEF;
471 #else
472 return -1;
473 #endif
475 case _SC_2_SW_DEV:
476 #ifdef _POSIX2_SW_DEV
477 return _POSIX2_SW_DEV;
478 #else
479 return -1;
480 #endif
482 case _SC_2_CHAR_TERM:
483 #ifdef _POSIX2_CHAR_TERM
484 return _POSIX2_CHAR_TERM;
485 #else
486 return -1;
487 #endif
489 case _SC_2_UPE:
490 #ifdef _POSIX2_UPE
491 return _POSIX2_UPE;
492 #else
493 return -1;
494 #endif
496 /* POSIX 1003.1c (POSIX Threads). */
497 case _SC_THREADS:
498 #ifdef _POSIX_THREADS
499 return 1;
500 #else
501 return -1;
502 #endif
504 case _SC_THREAD_SAFE_FUNCTIONS:
505 #ifdef _POSIX_THREAD_SAFE_FUNCTIONS
506 return 1;
507 #else
508 return -1;
509 #endif
511 case _SC_GETGR_R_SIZE_MAX:
512 #ifdef NSS_BUFLEN_GROUP
513 return NSS_BUFLEN_GROUP;
514 #else
515 return -1;
516 #endif
518 case _SC_GETPW_R_SIZE_MAX:
519 #ifdef NSS_BUFLEN_PASSWD
520 return NSS_BUFLEN_PASSWD;
521 #else
522 return -1;
523 #endif
525 case _SC_LOGIN_NAME_MAX:
526 #ifdef _POSIX_LOGIN_NAME_MAX
527 return _POSIX_LOGIN_NAME_MAX;
528 #else
529 return -1;
530 #endif
532 case _SC_TTY_NAME_MAX:
533 #ifdef _POSIX_TTY_NAME_MAX
534 return _POSIX_TTY_NAME_MAX;
535 #else
536 return -1;
537 #endif
539 case _SC_THREAD_DESTRUCTOR_ITERATIONS:
540 #ifdef _POSIX_THREAD_DESTRUCTOR_ITERATIONS
541 return _POSIX_THREAD_DESTRUCTOR_ITERATIONS;
542 #else
543 return -1;
544 #endif
546 case _SC_THREAD_KEYS_MAX:
547 #ifdef PTHREAD_KEYS_MAX
548 return PTHREAD_KEYS_MAX;
549 #else
550 return -1;
551 #endif
553 case _SC_THREAD_STACK_MIN:
554 #ifdef PTHREAD_STACK_MIN
555 return PTHREAD_STACK_MIN;
556 #else
557 return -1;
558 #endif
560 case _SC_THREAD_THREADS_MAX:
561 #ifdef PTHREAD_THREADS_MAX
562 return PTHREAD_THREADS_MAX;
563 #else
564 return -1;
565 #endif
567 case _SC_THREAD_ATTR_STACKADDR:
568 #ifdef _POSIX_THREAD_ATTR_STACKADDR
569 return 1;
570 #else
571 return -1;
572 #endif
574 case _SC_THREAD_ATTR_STACKSIZE:
575 #ifdef _POSIX_THREAD_ATTR_STACKSIZE
576 return 1;
577 #else
578 return -1;
579 #endif
581 case _SC_THREAD_PRIORITY_SCHEDULING:
582 #ifdef _POSIX_THREAD_PRIORITY_SCHEDULING
583 return 1;
584 #else
585 return -1;
586 #endif
588 case _SC_THREAD_PRIO_INHERIT:
589 #ifdef _POSIX_THREAD_PRIO_INHERIT
590 return 1;
591 #else
592 return -1;
593 #endif
595 case _SC_THREAD_PRIO_PROTECT:
596 #ifdef _POSIX_THREAD_PRIO_PROTECT
597 return 1;
598 #else
599 return -1;
600 #endif
602 case _SC_THREAD_PROCESS_SHARED:
603 #ifdef _POSIX_THREAD_PROCESS_SHARED
604 return 1;
605 #else
606 return -1;
607 #endif
609 case _SC_NPROCESSORS_CONF:
610 return __get_nprocs_conf ();
612 case _SC_NPROCESSORS_ONLN:
613 return __get_nprocs ();
615 case _SC_PHYS_PAGES:
616 return __get_phys_pages ();
618 case _SC_AVPHYS_PAGES:
619 return __get_avphys_pages ();
621 case _SC_ATEXIT_MAX:
622 /* We have no limit since we use lists. */
623 return INT_MAX;
625 case _SC_PASS_MAX:
626 /* We have no limit but since the return value might be used to
627 allocate a buffer we restrict the value. */
628 return BUFSIZ;
630 case _SC_XOPEN_VERSION:
631 return _XOPEN_VERSION;
633 case _SC_XOPEN_XCU_VERSION:
634 return _XOPEN_XCU_VERSION;
636 case _SC_XOPEN_UNIX:
637 return _XOPEN_UNIX;
639 case _SC_XOPEN_CRYPT:
640 #ifdef _XOPEN_CRYPT
641 return _XOPEN_CRYPT;
642 #else
643 return -1;
644 #endif
646 case _SC_XOPEN_ENH_I18N:
647 #ifdef _XOPEN_ENH_I18N
648 return _XOPEN_ENH_I18N;
649 #else
650 return -1;
651 #endif
653 case _SC_XOPEN_SHM:
654 #ifdef _XOPEN_SHM
655 return _XOPEN_SHM;
656 #else
657 return -1;
658 #endif
660 case _SC_XOPEN_XPG2:
661 #ifdef _XOPEN_XPG2
662 return _XOPEN_XPG2;
663 #else
664 return -1;
665 #endif
667 case _SC_XOPEN_XPG3:
668 #ifdef _XOPEN_XPG3
669 return _XOPEN_XPG3;
670 #else
671 return -1;
672 #endif
674 case _SC_XOPEN_XPG4:
675 #ifdef _XOPEN_XPG4
676 return _XOPEN_XPG4;
677 #else
678 return -1;
679 #endif
681 case _SC_CHAR_BIT:
682 return CHAR_BIT;
684 case _SC_CHAR_MAX:
685 return CHAR_MAX;
687 case _SC_CHAR_MIN:
688 return CHAR_MIN;
690 case _SC_INT_MAX:
691 return INT_MAX;
693 case _SC_INT_MIN:
694 return INT_MIN;
696 case _SC_LONG_BIT:
697 return sizeof (long int) * CHAR_BIT;
699 case _SC_WORD_BIT:
700 return sizeof (int) * CHAR_BIT;
702 case _SC_MB_LEN_MAX:
703 return MB_LEN_MAX;
705 case _SC_NZERO:
706 return NZERO;
708 case _SC_SSIZE_MAX:
709 return _POSIX_SSIZE_MAX;
711 case _SC_SCHAR_MAX:
712 return SCHAR_MAX;
714 case _SC_SCHAR_MIN:
715 return SCHAR_MIN;
717 case _SC_SHRT_MAX:
718 return SHRT_MAX;
720 case _SC_SHRT_MIN:
721 return SHRT_MIN;
723 case _SC_UCHAR_MAX:
724 return UCHAR_MAX;
726 case _SC_UINT_MAX:
727 return UINT_MAX;
729 case _SC_ULONG_MAX:
730 return ULONG_MAX;
732 case _SC_USHRT_MAX:
733 return USHRT_MAX;
735 case _SC_NL_ARGMAX:
736 #ifdef NL_ARGMAX
737 return NL_ARGMAX;
738 #else
739 return -1;
740 #endif
742 case _SC_NL_LANGMAX:
743 #ifdef NL_LANGMAX
744 return NL_LANGMAX;
745 #else
746 return -1;
747 #endif
749 case _SC_NL_MSGMAX:
750 #ifdef NL_MSGMAX
751 return NL_MSGMAX;
752 #else
753 return -1;
754 #endif
756 case _SC_NL_NMAX:
757 #ifdef NL_NMAX
758 return NL_NMAX;
759 #else
760 return -1;
761 #endif
763 case _SC_NL_SETMAX:
764 #ifdef NL_SETMAX
765 return NL_SETMAX;
766 #else
767 return -1;
768 #endif
770 case _SC_NL_TEXTMAX:
771 #ifdef NL_TEXTMAX
772 return NL_TEXTMAX;
773 #else
774 return -1;
775 #endif
777 case _SC_XBS5_ILP32_OFF32:
778 #ifdef _XBS5_ILP32_OFF32
779 return _XBS5_ILP32_OFF32;
780 #else
781 return -1;
782 #endif
783 case _SC_XBS5_ILP32_OFFBIG:
784 #ifdef _XBS5_ILP32_OFFBIG
785 return _XBS5_ILP32_OFFBIG;
786 #else
787 return -1;
788 #endif
789 case _SC_XBS5_LP64_OFF64:
790 #ifdef _XBS5_LP64_OFF64
791 return _XBS5_LP64_OFF64;
792 #else
793 return -1;
794 #endif
795 case _SC_XBS5_LPBIG_OFFBIG:
796 #ifdef _XBS5_LPBIG_OFFBIG
797 return _XBS5_LPBIG_OFFBIG;
798 #else
799 return -1;
800 #endif
802 case _SC_V6_ILP32_OFF32:
803 #ifdef _POSIX_V6_ILP32_OFF32
804 return _POSIX_V6_ILP32_OFF32;
805 #else
806 return -1;
807 #endif
808 case _SC_V6_ILP32_OFFBIG:
809 #ifdef _POSIX_V6_ILP32_OFFBIG
810 return _POSIX_V6_ILP32_OFFBIG;
811 #else
812 return -1;
813 #endif
814 case _SC_V6_LP64_OFF64:
815 #ifdef _POSIX_V6_LP64_OFF64
816 return _POSIX_V6_LP64_OFF64;
817 #else
818 return -1;
819 #endif
820 case _SC_V6_LPBIG_OFFBIG:
821 #ifdef _POSIX_V6_LPBIG_OFFBIG
822 return _POSIX_V6_LPBIG_OFFBIG;
823 #else
824 return -1;
825 #endif
827 case _SC_XOPEN_LEGACY:
828 return _XOPEN_LEGACY;
830 case _SC_XOPEN_REALTIME:
831 #ifdef _XOPEN_REALTIME
832 return _XOPEN_REALTIME;
833 #else
834 return -1;
835 #endif
836 case _SC_XOPEN_REALTIME_THREADS:
837 #ifdef _XOPEN_REALTIME_THREADS
838 return _XOPEN_REALTIME_THREADS;
839 #else
840 return -1;
841 #endif
843 case _SC_ADVISORY_INFO:
844 #ifdef _POSIX_ADVISORY_INFO
845 return _POSIX_ADVISORY_INFO;
846 #else
847 return -1;
848 #endif
850 case _SC_BARRIERS:
851 #ifdef _POSIX_BARRIERS
852 return _POSIX_BARRIERS;
853 #else
854 return -1;
855 #endif
857 case _SC_BASE:
858 #ifdef _POSIX_BASE
859 return _POSIX_BASE;
860 #else
861 return -1;
862 #endif
863 case _SC_C_LANG_SUPPORT:
864 #ifdef _POSIX_C_LANG_SUPPORT
865 return _POSIX_C_LANG_SUPPORT;
866 #else
867 return -1;
868 #endif
869 case _SC_C_LANG_SUPPORT_R:
870 #ifdef _POSIX_C_LANG_SUPPORT_R
871 return _POSIX_C_LANG_SUPPORT_R;
872 #else
873 return -1;
874 #endif
876 case _SC_CLOCK_SELECTION:
877 #ifdef _POSIX_CLOCK_SELECTION
878 return _POSIX_CLOCK_SELECTION;
879 #else
880 return -1;
881 #endif
883 case _SC_CPUTIME:
884 #ifdef _POSIX_CPUTIME
885 return _POSIX_CPUTIME;
886 #else
887 return -1;
888 #endif
890 case _SC_DEVICE_IO:
891 #ifdef _POSIX_DEVICE_IO
892 return _POSIX_DEVICE_IO;
893 #else
894 return -1;
895 #endif
896 case _SC_DEVICE_SPECIFIC:
897 #ifdef _POSIX_DEVICE_SPCIFIC
898 return _POSIX_DEVICE_SPECIFIC;
899 #else
900 return -1;
901 #endif
902 case _SC_DEVICE_SPECIFIC_R:
903 #ifdef _POSIX_DEVICE_SPCIFIC_R
904 return _POSIX_DEVICE_SPECIFIC_R;
905 #else
906 return -1;
907 #endif
909 case _SC_FD_MGMT:
910 #ifdef _POSIX_FD_MGMT
911 return _POSIX_FD_MGMT;
912 #else
913 return -1;
914 #endif
916 case _SC_FIFO:
917 #ifdef _POSIX_FIFO
918 return _POSIX_FIFO;
919 #else
920 return -1;
921 #endif
922 case _SC_PIPE:
923 #ifdef _POSIX_PIPE
924 return _POSIX_PIPE;
925 #else
926 return -1;
927 #endif
929 case _SC_FILE_ATTRIBUTES:
930 #ifdef _POSIX_FILE_ATTRIBUTES
931 return _POSIX_FILE_ATTRIBUTES;
932 #else
933 return -1;
934 #endif
935 case _SC_FILE_LOCKING:
936 #ifdef _POSIX_FILE_LOCKING
937 return _POSIX_FILE_LOCKING;
938 #else
939 return -1;
940 #endif
941 case _SC_FILE_SYSTEM:
942 #ifdef _POSIX_FILE_SYSTEM
943 return _POSIX_FILE_SYSTEM;
944 #else
945 return -1;
946 #endif
948 case _SC_MONOTONIC_CLOCK:
949 #ifdef _POSIX_MONOTONIC_CLOCK
950 return _POSIX_MONOTONIC_CLOCK;
951 #else
952 return -1;
953 #endif
955 case _SC_MULTI_PROCESS:
956 #ifdef _POSIX_MULTI_PROCESS
957 return _POSIX_MULTI_PROCESS;
958 #else
959 return -1;
960 #endif
961 case _SC_SINGLE_PROCESS:
962 #ifdef _POSIX_SINGLE_PROCESS
963 return _POSIX_SINGLE_PROCESS;
964 #else
965 return -1;
966 #endif
968 case _SC_NETWORKING:
969 #ifdef _POSIX_NETWORKING
970 return _POSIX_NETWORKING;
971 #else
972 return -1;
973 #endif
975 case _SC_READER_WRITER_LOCKS:
976 #ifdef _POSIX_READER_WRITER_LOCKS
977 return _POSIX_READER_WRITER_LOCKS;
978 #else
979 return -1;
980 #endif
981 case _SC_SPIN_LOCKS:
982 #ifdef _POSIX_SPIN_LOCKS
983 return _POSIX_SPIN_LOCKS;
984 #else
985 return -1;
986 #endif
988 case _SC_REGEXP:
989 #ifdef _POSIX_REGEXP
990 return _POSIX_REGEXP;
991 #else
992 return -1;
993 #endif
994 case _SC_REGEX_VERSION:
995 #ifdef _POSIX_REGEX_VERSION
996 return _POSIX_REGEX_VERSION;
997 #else
998 return -1;
999 #endif
1001 case _SC_SHELL:
1002 #ifdef _POSIX_SHELL
1003 return _POSIX_SHELL;
1004 #else
1005 return -1;
1006 #endif
1008 case _SC_SIGNALS:
1009 #ifdef _POSUX_SIGNALS
1010 return _POSIX_SIGNALS;
1011 #else
1012 return -1;
1013 #endif
1015 case _SC_SPAWN:
1016 #ifdef _POSIX_SPAWN
1017 return _POSIX_SPAWN;
1018 #else
1019 return -1;
1020 #endif
1022 case _SC_SPORADIC_SERVER:
1023 #ifdef _POSIX_SPORADIC_SERVER
1024 return _POSIX_SPORADIC_SERVER;
1025 #else
1026 return -1;
1027 #endif
1028 case _SC_THREAD_SPORADIC_SERVER:
1029 #ifdef _POSIX_THREAD_SPORADIC_SERVER
1030 return _POSIX_THREAD_SPORADIC_SERVER;
1031 #else
1032 return -1;
1033 #endif
1035 case _SC_SYSTEM_DATABASE:
1036 #ifdef _POSIX_SYSTEM_DATABASE
1037 return _POSIX_SYSTEM_DATABASE;
1038 #else
1039 return -1;
1040 #endif
1041 case _SC_SYSTEM_DATABASE_R:
1042 #ifdef _POSIX_SYSTEM_DATABASE_R
1043 return _POSIX_SYSTEM_DATABASE_R;
1044 #else
1045 return -1;
1046 #endif
1048 case _SC_THREAD_CPUTIME:
1049 #ifdef _POSIX_THREAD_CPUTIME
1050 return _POSIX_THREAD_CPUTIME;
1051 #else
1052 return -1;
1053 #endif
1055 case _SC_TIMEOUTS:
1056 #ifdef _POSIX_TIMEOUTS
1057 return _POSIX_TIMEOUTS;
1058 #else
1059 return -1;
1060 #endif
1062 case _SC_TYPED_MEMORY_OBJECTS:
1063 #ifdef _POSIX_TYPED_MEMORY_OBJECTS
1064 return _POSIX_TYPED_MEMORY_OBJECTS;
1065 #else
1066 return -1;
1067 #endif
1069 case _SC_USER_GROUPS:
1070 #ifdef _POSIX_USER_GROUPS
1071 return _POSIX_USER_GROUPS;
1072 #else
1073 return -1;
1074 #endif
1075 case _SC_USER_GROUPS_R:
1076 #ifdef _POSIX_USER_GROUPS_R
1077 return _POSIX_USER_GROUPS_R;
1078 #else
1079 return -1;
1080 #endif
1082 case _SC_2_PBS:
1083 #ifdef _POSIX2_PBS
1084 return _POSIX2_PBS;
1085 #else
1086 return -1;
1087 #endif
1088 case _SC_2_PBS_ACCOUNTING:
1089 #ifdef _POSIX2_PBS_ACCOUNTING
1090 return _POSIX2_PBS_ACCOUNTING;
1091 #else
1092 return -1;
1093 #endif
1094 case _SC_2_PBS_CHECKPOINT:
1095 #ifdef _POSIX2_PBS_CHECKPOINT
1096 return _POSIX2_PBS_CHECKPOINT;
1097 #else
1098 return -1;
1099 #endif
1100 case _SC_2_PBS_LOCATE:
1101 #ifdef _POSIX2_PBS_LOCATE
1102 return _POSIX2_PBS_LOCATE;
1103 #else
1104 return -1;
1105 #endif
1106 case _SC_2_PBS_TRACK:
1107 #ifdef _POSIX2_PBS_TRACK
1108 return _POSIX2_PBS_TRACK;
1109 #else
1110 return -1;
1111 #endif
1113 case _SC_SYMLOOP_MAX:
1114 #ifdef SYMLOOP_MAX
1115 return SYMLOOP_MAX;
1116 #else
1117 return -1;
1118 #endif
1120 case _SC_STREAMS:
1121 #ifdef _XOPEN_STREAMS
1122 return _XOPEN_STREAMS;
1123 #else
1124 return -1;
1125 #endif
1129 #undef __sysconf
1130 weak_alias (__sysconf, sysconf)