Rev 2 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
2 | pj | 1 | /* |
2 | * Project: S.Ha.R.K. |
||
3 | * |
||
4 | * Coordinators: |
||
5 | * Giorgio Buttazzo <giorgio@sssup.it> |
||
6 | * Paolo Gai <pj@gandalf.sssup.it> |
||
7 | * |
||
8 | * Authors : |
||
9 | * Paolo Gai <pj@gandalf.sssup.it> |
||
10 | * Massimiliano Giorgi <massy@gandalf.sssup.it> |
||
11 | * Luca Abeni <luca@gandalf.sssup.it> |
||
12 | * (see the web pages for full authors list) |
||
13 | * |
||
14 | * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy) |
||
15 | * |
||
16 | * http://www.sssup.it |
||
17 | * http://retis.sssup.it |
||
18 | * http://shark.sssup.it |
||
19 | */ |
||
20 | |||
21 | /** |
||
22 | ------------ |
||
23 | CVS : $Id: sysconf.c,v 1.1.1.1 2002-03-29 14:12:53 pj Exp $ |
||
24 | |||
25 | File: $File$ |
||
26 | Revision: $Revision: 1.1.1.1 $ |
||
27 | Last update: $Date: 2002-03-29 14:12:53 $ |
||
28 | ------------ |
||
29 | |||
30 | |||
31 | **/ |
||
32 | |||
33 | /* |
||
34 | * Copyright (C) 2000 Paolo Gai |
||
35 | * |
||
36 | * This program is free software; you can redistribute it and/or modify |
||
37 | * it under the terms of the GNU General Public License as published by |
||
38 | * the Free Software Foundation; either version 2 of the License, or |
||
39 | * (at your option) any later version. |
||
40 | * |
||
41 | * This program is distributed in the hope that it will be useful, |
||
42 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
||
43 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||
44 | * GNU General Public License for more details. |
||
45 | * |
||
46 | * You should have received a copy of the GNU General Public License |
||
47 | * along with this program; if not, write to the Free Software |
||
48 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
||
49 | * |
||
50 | */ |
||
51 | |||
52 | |||
53 | #include <errno.h> |
||
54 | #include <limits.h> |
||
55 | #include <time.h> |
||
56 | #include <unistd.h> |
||
57 | |||
58 | long sysconf(int name) |
||
59 | { |
||
60 | switch (name) { |
||
61 | case _SC_AIO_LISTIO_MAX : return AIO_LISTIO_MAX; |
||
62 | case _SC_AIO_MAX : return AIO_MAX; |
||
63 | case _SC_AIO_PRIO_DELTA_MAX : return AIO_PRIO_DELTA_MAX; |
||
64 | case _SC_ARG_MAX : return ARG_MAX; |
||
65 | case _SC_CHILD_MAX : return -1; // !!! |
||
66 | case _SC_CLK_TICK : return CLK_TCK; |
||
67 | case _SC_DELAYTIMER_MAX : return DELAYTIMER_MAX; |
||
68 | case _SC_GETGR_R_SIZE_MAX : return -1; // !!! |
||
69 | case _SC_GETPW_R_SIZE_MAX : return -1; // !!! |
||
70 | case _SC_LOGIN_NAME_MAX : return LOGIN_NAME_MAX; |
||
71 | case _SC_MQ_OPEN_MAX : return MQ_OPEN_MAX; |
||
72 | case _SC_MQ_PRIO_MAX : return MQ_PRIO_MAX; |
||
73 | case _SC_NGROUPS_MAX : return NGROUPS_MAX; |
||
74 | case _SC_OPEN_MAX : return OPEN_MAX; |
||
75 | case _SC_PAGESIZE : return PAGESIZE; |
||
76 | case _SC_RTSIG_MAX : return RTSIG_MAX; |
||
77 | case _SC_SEM_NSEMS_MAX : return SEM_NSEMS_MAX; |
||
78 | case _SC_SEM_VALUE_MAX : return SEM_VALUE_MAX; |
||
79 | case _SC_SIGQUEUE_MAX : return SIGQUEUE_MAX; |
||
80 | case _SC_STREAM_MAX : return STREAM_MAX; |
||
81 | case _SC_THREAD_DESTRUCTOR_ITERATIONS : return PTHREAD_DESTRUCTOR_ITERATIONS; |
||
82 | case _SC_THREAD_KEYS_MAX : return PTHREAD_KEYS_MAX; |
||
83 | case _SC_THREAD_STACK_MIN : return PTHREAD_STACK_MIN; |
||
84 | case _SC_THREAD_THREADS_MAX : return PTHREAD_THREADS_MAX; |
||
85 | case _SC_TIMER_MAX : return TIMER_MAX; |
||
86 | case _SC_TTY_NAME_MAX : return TTY_NAME_MAX; |
||
87 | case _SC_TZNAME_MAX : return TZNAME_MAX; |
||
88 | |||
89 | case _SC_ASYNCHRONOUS_IO : return -1; |
||
90 | case _SC_FSYNC : return -1; |
||
91 | case _SC_JOB_CONTROL : return -1; |
||
92 | case _SC_MAPPED_FILES : return -1; |
||
93 | case _SC_MEMLOCK : return -1; |
||
94 | case _SC_MEMLOCK_RANGE : return -1; |
||
95 | case _SC_MEMORY_PROTECTION : return -1; |
||
96 | case _SC_MESSAGE_PASSING : return 0; |
||
97 | case _SC_PRIORITIZED_IO : return -1; |
||
98 | case _SC_PRIORITY_SCHEDULING : return -1; |
||
99 | case _SC_REALTIME_SIGNALS : return 0; |
||
100 | case _SC_SAVED_IDS : return -1; |
||
101 | case _SC_SEMAPHORES : return 0; |
||
102 | case _SC_SHARED_MEMORY_OBJECTS : return -1; |
||
103 | case _SC_SYNCHRONIZED_IO : return -1; |
||
104 | case _SC_TIMERS : return 0; |
||
105 | case _SC_THREADS : return 0; |
||
106 | case _SC_THREAD_ATTR_STACKADDR : return 0; |
||
107 | case _SC_THREAD_ATTR_STACKSIZE : return 0; |
||
108 | case _SC_THREAD_PRIORITY_SCHEDULING : return 0; |
||
109 | case _SC_THREAD_PRIO_INHERIT : return 0; |
||
110 | case _SC_THREAD_PRIO_PROTECT : return 0; |
||
111 | case _SC_THREAD_PROCESS_SHARED : return -1; |
||
112 | case _SC_THREAD_SAFE_FUNCTIONS : return -1; |
||
113 | case _SC_VERSION : return _POSIX_VERSION; |
||
114 | |||
115 | default : errno = EINVAL; return -1; |
||
116 | } |
||
117 | } |