33 #ifndef _POSIX_VERSION
34 printf(
"No support for POSIX on this system!\n");
35 #else //see what POSIX version
39 #if defined(POSIX_VERSION)
40 printf(
"POSIX_VERSION = %d.\n",_POSIX_VERSION);
42 #if defined(POSIX2_VERSION)
43 printf(
"POSIX2_VERSION = %d.\n",_POSIX2_VERSION);
45 #if defined(POSIX2_C_VERSION)
46 printf(
"POSIX2_C_VERSION = %d.\n",_POSIX2_C_VERSION);
48 #if _POSIX_VERSION == 199009
49 printf(
"This system supports POSIX.1 without support for POSIX.4.\n");
51 #if _POSIX_VERSION >= 199309
52 printf (
"This system has Posix Version %ld. \n", _POSIX_VERSION);
53 printf (
"POSIX.1 and POSIX.4 are both supported. \n");
55 printf(
"This system supports a strange POSIX version between 199009 and 199309.\n");
58 printf (
"POSIX.4 Options Test Results:\n");
59 #ifdef _POSIX_REALTIME_SIGNALS
60 printf(
" POSIX.4 Additional real time signals are supported.\n");
61 #ifdef _POSIX_RTSIG_MAX
62 printf(
" _POSIX_RTSIG_MAX=%d Max real time signals.\n",_POSIX_RTSIG_MAX);
64 printf(
" No _POSIX_RTSIG_MAX value exists.\n");
66 #ifdef _POSIX_SIGQUEUE_MAX
67 printf(
" _POSIX_SIGQUEUE_MAX=%d Max real time signals at once per process.\n",_POSIX_SIGQUEUE_MAX);
69 printf(
" No _POSIX_SIGQUEUE_MAX value exists.\n");
72 printf(
" POSIX.4 Additional real time signals are not supported.\n");
74 #ifdef _POSIX_PRIORITY_SCHEDULING
75 printf(
" POSIX.4 Priority scheduling is supported.\n");
77 printf(
" POSIX.4 Priority scheduling is not supported.\n");
80 printf(
" POSIX.4 Clocks and timers are supported.\n");
81 #ifdef _POSIX_TIMER_MAX
82 printf(
" _POSIX_TIMER_MAX=%d Max number of concurrent timers a process can have.\n",_POSIX_TIMER_MAX);
84 printf(
" No _POSIX_TIMER_MAX value exists.\n");
86 #ifdef _POSIX_DELAYTIMER_MAX
87 printf(
" _POSIX_DELAYTIMER_MAX=%d Max number of times a timer can have a detectable overrun.\n",_POSIX_DELAYTIMER_MAX);
89 printf(
" No _POSIX_DELAYTIMER_MAX value exists.\n");
92 printf(
" POSIX.4 Clocks and timers are not supported.\n");
94 #ifdef _POSIX_ASYNCHRONOUS_IO
95 printf(
" POSIX.4 Asynchronous I/O is supported.\n");
96 #ifdef _POSIX_AIO_LISTIO_MAX
97 printf(
" _POSIX_AIO_LISTIO_MAX=%d Max operations in one call\n",_POSIX_AIO_LISTIO_MAX);
99 printf(
" No _POSIX_AIO_LISTIO_MAX value exists.\n");
101 #ifdef _POSIX_AIO_MAX
102 printf(
" _POSIX_AIO_MAX=%d Max concurrent Async I/Os\n",_POSIX_AIO_MAX);
104 printf(
" No _POSIX_AIO_MAX value exists.\n");
107 printf(
" POSIX.4 Asynchronous I/O is not supported.\n");
109 #ifdef _POSIX_SYNCHRONIZED_IO //Only supported if Asynchronous I/O is supported
110 printf(
" POSIX.4 Synchronized I/O is supported.\n");
112 printf(
" POSIX.4 Synchronized I/O is not supported.\n");
114 #ifdef _POSIX_PRIORITIZED_IO
115 printf(
" POSIX.4 Prioritized asynchronous I/O is supported.\n");
116 #ifdef _POSIX_AIO_PRIO_DELTA_MAX
117 printf(
" _POSIX_AIO_PRIO_DELTA_MAX=%d Max amount AIO priority can be decreased.\n",_POSIX_AIO_PRIO_DELTA_MAX);
119 printf(
" No _POSIX_AIO_PRIO_DELTA_MAX value exists.\n");
122 printf(
" POSIX.4 Prioritized asynchronous I/O is not supported.\n");
125 printf(
" POSIX.4 The fsync function is supported.\n");
127 printf(
" POSIX.4 The fsync function is not supported.\n");
129 #ifdef _POSIX_MAPPED_FILES
130 printf(
" POSIX.4 Mapping files as memory is supported.\n");
132 printf(
" POSIX.4 Mapping files as memory is not supported.\n");
134 #ifdef _POSIX_MEMLOCK
135 printf(
" POSIX.4 Locking memory is supported.\n");
137 printf(
" POSIX.4 Locking memory is not supported.\n");
139 #ifdef _POSIX_MEMLOCK_RANGE
140 printf(
" POSIX.4 Locking memory ranges is supported.\n");
142 printf(
" POSIX.4 Locking memory ranges is not supported.\n");
144 #ifdef _POSIX_MEMORY_PROTECTION
145 printf(
" POSIX.4 Setting memory protection is supported.\n");
147 printf(
" POSIX.4 Setting memory protection is not supported.\n");
149 #ifdef _POSIX_MESSAGE_PASSING
150 printf(
" POSIX.4 Message Queues are supported.\n");
151 #ifdef _POSIX_MQ_OPEN_MAX
152 printf(
" _POSIX_MQ_OPEN_MAX=%d Max # of message queues per process.\n",_POSIX_MQ_OPEN_MAX);
154 printf(
" No _POSIX_MQ_OPEN_MAX value exists.\n");
156 #ifdef _POSIX_MQ_PRIO_MAX
157 printf(
" _POSIX_MQ_PRIO_MAX=%d Max # of message priorities.\n",_POSIX_MQ_PRIO_MAX);
159 printf(
" No _POSIX_MQ_PRIO_MAX value exists.\n");
162 printf(
" POSIX.4 Message Queues are not supported.\n");
164 #ifdef _POSIX_SEMAPHORES
165 printf(
" POSIX.4 Semaphores are supported.\n");
166 #ifdef _POSIX_SEM_NSEMS_MAX
167 printf(
" _POSIX_SEM_NSEMS_MAX=%d Max # of open semaphores per process.\n",_POSIX_SEM_NSEMS_MAX);
169 printf(
" No _POSIX_SEM_NSEMS_MAX value exists.\n");
171 #ifdef _POSIX_SEM_VALUE_MAX
172 printf(
" _POSIX_SEM_VALUE_MAX=%d Maximum semaphore value.\n",_POSIX_SEM_VALUE_MAX);
174 printf(
" No _POSIX_SEM_VALUE_MAX value exists.\n");
177 printf(
" POSIX.4 Semaphores are not supported.\n");
179 #ifdef _POSIX_SHARED_MEMORY_OBJECTS
180 printf(
" POSIX.4 Shared memory objects are supported.\n");
182 printf(
" POSIX.4 Shared memory objects are not supported.\n");
185 #ifdef _POSIX_THREADS
186 printf(
" POSIX.1c pthreads are supported.\n");
188 printf(
" POSIX.1c pthreads are not supported.\n");
190 #ifdef _POSIX_THREAD_ATTR_STACKADDRTHREAD_ATTR_STACKADDR
191 printf(
" POSIX.4 Thread stack address attribute option is supported.\n");
193 printf(
" POSIX.4 Thread stack address attribute option is not supported.\n");
195 #ifdef _POSIX_THREAD_ATTR_STACKSIZE
196 printf(
" POSIX.4 Thread stack size attribute option is supported.\n");
198 printf(
" POSIX.4 Thread stack size attribute option is not supported.\n");
200 #ifdef _POSIX_THREAD_SAFE_FUNCTIONS
201 printf(
" POSIX.4 Thread-safe functions are supported.\n");
203 printf(
" POSIX.4 Thread-safe functions are not supported.\n");
205 #ifdef _POSIX_THREAD_PRIORITY_SCHEDULING
206 printf(
" POSIX.1c thread execution scheduling is supported.\n");
208 printf(
" POSIX.1c thread execution scheduling is not supported.\n");
210 #ifdef _POSIX_THREAD_PRIO_INHERIT
211 printf(
" POSIX.4 Thread priority inheritance option is supported.\n");
213 printf(
" POSIX.4 Thread priority inheritance option is not supported.\n");
215 #ifdef _POSIX_THREAD_PROCESS_SHARED
216 printf(
" POSIX.4 Process-shared synchronization is supported.\n");
218 printf(
" POSIX.4 Process-shared synchronization is not supported.\n");
220 #ifdef _POSIX_POSIX_PII
221 printf(
" Protocol-independent interfaces are supported.\n");
223 printf(
" Protocol-independent interfaces are not supported.\n");
225 #ifdef _POSIX_PII_XTI
226 printf(
" XTI protocol-indep. interfaces are supported.\n");
228 printf(
" XTI protocol-indep. interfaces are not supported.\n");
230 #ifdef _POSIX_PII_SOCKET
231 printf(
" Socket protocol-indep. interfaces are supported.\n");
233 printf(
" Socket protocol-indep. interfaces are not supported.\n");
235 #ifdef _POSIX_PII_INTERNET
236 printf(
" Internet family of protocols is supported.\n");
238 printf(
" Internet family of protocols is not supported.\n");
240 #ifdef _POSIX_PII_INTERNET_STREAM
241 printf(
" Connection-mode Internet protocol is supported.\n");
243 printf(
" Connection-mode Internet protocol is not supported.\n");
245 #ifdef _POSIX_PII_INTERNET_DGRAM
246 printf(
" Connectionless Internet protocol is supported.\n");
248 printf(
" Connectionless Internet protocol is not supported.\n");
250 #ifdef _POSIX_PII_OSI
251 printf(
" ISO/OSI family of protocols is supported.\n");
253 printf(
" ISO/OSI family of protocols is not supported.\n");
255 #ifdef _POSIX_PII_OSI_COTS
256 printf(
" Connection-mode ISO/OSI service is supported.\n");
258 printf(
" Connection-mode ISO/OSI service is not supported.\n");
260 #ifdef _POSIX_PII_OSI_CLTS
261 printf(
" Connectionless ISO/OSI service is supported.\n");
263 printf(
" Connectionless ISO/OSI service is not supported.\n");
266 printf(
" Implementation supports `poll' function.\n");
268 printf(
" poll function is not supported.\n");
271 printf(
" Implementation supports `select' and `pselect'.\n");
273 printf(
" Implementation does not support `select' and `pselect'.\n");
275 #ifdef _XOPEN_REALTIME
276 printf(
" X/Open realtime support is available.\n");
278 printf(
" X/Open realtime support is not available..\n");
280 #ifdef _XOPEN_REALTIME_THREADS
281 printf(
" X/Open realtime thread support is available.\n");
283 printf(
" X/Open realtime thread support is not available.\n");
286 printf(
" XPG4.2 Shared memory interface is supported.\n");
288 printf(
" XPG4.2 Shared memory interface is not supported.\n");
290 #ifdef _XBS5_ILP32_OFF32
291 printf(
" 32-bit int, long, pointer, and off_t types are supported.\n");
293 printf(
" 32-bit int, long, pointer, and off_t types are not supported.\n");
295 #ifdef _XBS5_ILP32_OFFBIG
296 printf(
" 32-bit int, long, and pointer and off_t with at least 64 bits is supported.\n");
298 printf(
" 32-bit int, long, and pointer and off_t with at least 64 bits is not supported.\n");
300 #ifdef _XBS5_LP64_OFF64
301 printf(
" 32-bit int, and 64-bit long, pointer, and off_t types are supported.\n");
303 printf(
" 32-bit int, and 64-bit long, pointer, and off_t types are not supported.\n");
305 #ifdef _XBS5_LPBIG_OFFBIG
306 printf(
" 32 bits int and long, pointer, and off_t with at least 64 bits are supported.\n");
308 printf(
" 32 bits int and long, pointer, and off_t with at least 64 bits are not supported.\n");
314 printf (
"POSIX.1 Options Test Results:\n");
315 #ifdef _POSIX_JOB_CONTROL
316 printf(
" POSIX.1 Job control is supported.\n");
318 printf(
" POSIX.1 Job control is not supported.\n");
320 #ifdef _POSIX_CHOWN_RESTRICTED
321 printf(
" POSIX.1 Chown restrictions are supported.\n");
323 printf(
" POSIX.1 Chown restrictions are not supported.\n");
325 #ifdef _POSIX_SAVED_IDS
326 printf(
" POSIX.1 Process saved IDs are supported.\n");
328 printf(
" POSIX.1 Process saved IDs are not supported.\n");
330 #ifdef _POSIX_NO_TRUNC
331 printf(
" POSIX.1 Long pathname errors are supported.\n");
333 printf(
" POSIX.1 Long pathname errors are not supported.\n");
335 #ifdef _POSIX_VDISABLE
336 printf(
" POSIX.1 Some terminal charactistics disabling is supported.\n");
338 printf(
" POSIX.1 Some terminal charactistics disabling is not supported.\n");
341 printf(
" POSIX.1 Supplementary group IDs is supported.\n");
343 printf(
" POSIX.1 Supplementary group IDs is not supported.\n");
347 printf(
"\nSystem run time tests:\n");
349 val=sysconf(_SC_JOB_CONTROL);
350 if ((val == -1) && (errno))
352 printf(
"Bad option _SC_JOB_CONTROL\n");
354 else if ((val == -1) && (!errno))
356 printf(
"POSIX.1 JOB CONTROL not Supported.\n");
360 printf(
"POSIX.1 JOB CONTROL Supported.\n");
363 val=sysconf(_SC_SAVED_IDS);
364 if ((val == -1) && (errno))
366 printf(
"Bad option _SC_SAVED_IDS\n");
368 else if ((val == -1) && (!errno))
370 printf(
"POSIX.1 SAVED IDS not Supported.\n");
374 printf(
"POSIX.1 SAVED IDS Supported.\n");
377 val=sysconf(_SC_VERSION);
378 if ((val == -1) && (errno))
380 printf(
"Bad option _SC_VERSION\n");
382 else if ((val == -1) && (!errno))
384 printf(
"POSIX.1 VERSION not Supported.\n");
388 printf(
"POSIX.1 VERSION Supported.\n");
390 val=sysconf(_SC_ARG_MAX);
393 printf(
"Bad option _SC_ARG_MAX\n");
397 printf(
"POSIX.1 ARG MAX Value=%ld.\n",val);
399 val=sysconf(_SC_CHILD_MAX);
402 printf(
"Bad option _SC_CHILD_MAX\n");
406 printf(
"POSIX.1 CHILD MAX Value=%ld.\n",val);
408 val=sysconf(_SC_CLK_TCK);
411 printf(
"Bad option _SC_CLK_TCK\n");
415 printf(
"POSIX.1 CLK TCK Value=%ld.\n",val);
417 val=sysconf(_SC_NGROUPS_MAX);
420 printf(
"Bad option _SC_NGROUPS_MAX\n");
424 printf(
"POSIX.1 NGROUPS MAX Value=%ld.\n",val);
426 val=sysconf(_SC_OPEN_MAX);
429 printf(
"Bad option _SC_OPEN_MAX\n");
433 printf(
"POSIX.1 OPEN MAX Value=%ld.\n",val);
435 val=sysconf(_SC_STREAM_MAX);
438 printf(
"Bad option _SC_STREAM_MAX\n");
442 printf(
"POSIX.1 STREAM MAX Value=%ld.\n",val);
444 val=sysconf(_SC_TZNAME_MAX);
447 printf(
"Bad option _SC_TZNAME_MAX\n");
451 printf(
"POSIX.1 TZNAME MAX Value=%ld.\n",val);
454 val=sysconf(_SC_ASYNCHRONOUS_IO);
455 if ((val == -1) && (errno))
457 printf(
"Bad option _SC_ASYNCHRONOUS_IO\n");
459 else if ((val == -1) && (!errno))
461 printf(
"POSIX.4 ASYNCHRONOUS IO not Supported.\n");
465 printf(
"POSIX.4 ASYNCHRONOUS IO Supported.\n");
468 val=sysconf(_SC_MAPPED_FILES);
469 if ((val == -1) && (errno))
471 printf(
"Bad option _SC_MAPPED_FILES\n");
473 else if ((val == -1) && (!errno))
475 printf(
"POSIX.4 MAPPED FILES not Supported.\n");
479 printf(
"POSIX.4 MAPPED FILES Supported.\n");
482 val=sysconf(_SC_MEMLOCK_RANGE);
483 if ((val == -1) && (errno))
485 printf(
"Bad option _SC_MEMLOCK_RANGE\n");
487 else if ((val == -1) && (!errno))
489 printf(
"POSIX.4 MEMLOCK RANGE not Supported.\n");
493 printf(
"POSIX.4 MEMLOCK RANGE Supported.\n");
496 val=sysconf(_SC_MEMORY_PROTECTION);
497 if ((val == -1) && (errno))
499 printf(
"Bad option _SC_MEMORY_PROTECTION\n");
501 else if ((val == -1) && (!errno))
503 printf(
"POSIX.4 MEMORY PROTECTION not Supported.\n");
507 printf(
"POSIX.4 MEMORY PROTECTION Supported.\n");
510 val=sysconf(_SC_MESSAGE_PASSING);
511 if ((val == -1) && (errno))
513 printf(
"Bad option _SC_MESSAGE_PASSING\n");
515 else if ((val == -1) && (!errno))
517 printf(
"POSIX.4 MESSAGE PASSING not Supported.\n");
521 printf(
"POSIX.4 MESSAGE PASSING Supported.\n");
524 val=sysconf(_SC_PRIORITIZED_IO);
525 if ((val == -1) && (errno))
527 printf(
"Bad option _SC_PRIORITIZED_IO\n");
529 else if ((val == -1) && (!errno))
531 printf(
"POSIX.4 PRIORITIZED IO not Supported.\n");
535 printf(
"POSIX.4 PRIORITIZED IO Supported.\n");
538 val=sysconf(_SC_PRIORITY_SCHEDULING);
539 if ((val == -1) && (errno))
541 printf(
"Bad option _SC_PRIORITY_SCHEDULING\n");
543 else if ((val == -1) && (!errno))
545 printf(
"POSIX.4 PRIORITY SCHEDULING not Supported.\n");
549 printf(
"POSIX.4 PRIORITY SCHEDULING Supported.\n");
552 val=sysconf(_SC_REALTIME_SIGNALS);
553 if ((val == -1) && (errno))
555 printf(
"Bad option _SC_REALTIME_SIGNALS\n");
557 else if ((val == -1) && (!errno))
559 printf(
"POSIX.4 REALTIME SIGNALS not Supported.\n");
563 printf(
"POSIX.4 REALTIME SIGNALS Supported.\n");
566 val=sysconf(_SC_SEMAPHORES);
567 if ((val == -1) && (errno))
569 printf(
"Bad option _SC_SEMAPHORES\n");
571 else if ((val == -1) && (!errno))
573 printf(
"POSIX.4 SEMAPHORES not Supported.\n");
577 printf(
"POSIX.4 SEMAPHORES Supported.\n");
580 val=sysconf(_SC_FSYNC);
581 if ((val == -1) && (errno))
583 printf(
"Bad option _SC_FSYNC\n");
585 else if ((val == -1) && (!errno))
587 printf(
"POSIX.4 FSYNC not Supported.\n");
591 printf(
"POSIX.4 FSYNC Supported.\n");
594 val=sysconf(_SC_SHARED_MEMORY_OBJECTS);
595 if ((val == -1) && (errno))
597 printf(
"Bad option _SC_SHARED_MEMORY_OBJECTS\n");
599 else if ((val == -1) && (!errno))
601 printf(
"POSIX.4 SHARED_MEMORY_OBJECTS not Supported.\n");
605 printf(
"POSIX.4 SHARED_MEMORY_OBJECTS Supported.\n");
608 val=sysconf(_SC_SYNCHRONIZED_IO);
609 if ((val == -1) && (errno))
611 printf(
"Bad option _SC_SYNCHRONIZED_IO\n");
613 else if ((val == -1) && (!errno))
615 printf(
"POSIX.4 SYNCHRONIZED IO not Supported.\n");
619 printf(
"POSIX.4 SYNCHRONIZED IO Supported.\n");
622 val=sysconf(_SC_TIMERS);
623 if ((val == -1) && (errno))
625 printf(
"Bad option _SC_TIMERS\n");
627 else if ((val == -1) && (!errno))
629 printf(
"POSIX.4 TIMERS not Supported.\n");
633 printf(
"POSIX.4 TIMERS Supported.\n");
635 val=sysconf(_SC_AIO_LISTIO_MAX);
638 printf(
"Bad option _SC_AIO_LISTIO_MAX\n");
642 printf(
"POSIX.4 AIO LISTIO MAX Value=%ld.\n",val);
644 val=sysconf(_SC_AIO_MAX);
647 printf(
"Bad option _SC_AIO_MAX\n");
651 printf(
"POSIX.4 AIO MAX Value=%ld.\n",val);
653 val=sysconf(_SC_AIO_PRIO_DELTA_MAX);
656 printf(
"Bad option _SC_AIO_PRIO_DELTA_MAX\n");
660 printf(
"POSIX.4 AIO PRIO DELTA MAX Value=%ld.\n",val);
662 val=sysconf(_SC_DELAYTIMER_MAX);
665 printf(
"Bad option _SC_DELAYTIMER_MAX\n");
669 printf(
"POSIX.4 DELAYTIMER MAX Value=%ld.\n",val);
671 val=sysconf(_SC_MQ_OPEN_MAX);
674 printf(
"Bad option _SC_MQ_OPEN_MAX\n");
678 printf(
"POSIX.4 MQ OPEN MAX Value=%ld.\n",val);
680 val=sysconf(_SC_MQ_PRIO_MAX);
683 printf(
"Bad option _SC_MQ_PRIO_MAX\n");
687 printf(
"POSIX.4 MQ PRIO MAX Value=%ld.\n",val);
689 val=sysconf(_SC_PAGESIZE);
692 printf(
"Bad option _SC_PAGESIZE\n");
696 printf(
"POSIX.4 PAGESIZE Value=%ld.\n",val);
698 val=sysconf(_SC_RTSIG_MAX);
701 printf(
"Bad option _SC_RTSIG_MAX\n");
705 printf(
"POSIX.4 RTSIG MAX Value=%ld.\n",val);
707 val=sysconf(_SC_SEM_NSEMS_MAX);
710 printf(
"Bad option _SC_SEM_NSEMS_MAX\n");
714 printf(
"POSIX.4 SEM NSEMS MAX Value=%ld.\n",val);
716 val=sysconf(_SC_SEM_VALUE_MAX);
719 printf(
"Bad option _SC_SEM_VALUE_MAX\n");
723 printf(
"POSIX.4 SEM VALUE MAX Value=%ld.\n",val);
725 val=sysconf(_SC_SIGQUEUE_MAX);
728 printf(
"Bad option _SC_SIGQUEUE_MAX\n");
732 printf(
"POSIX.4 SIGQUEUE MAX Value=%ld.\n",val);
734 val=sysconf(_SC_TIMER_MAX);
737 printf(
"Bad option _SC_TIMER_MAX\n");
741 printf(
"POSIX.4 TIMER MAX Value=%ld.\n",val);