$search
00001 00011 /***************************************************************************** 00012 ** Includes 00013 *****************************************************************************/ 00014 00015 #include <iostream> 00016 00017 /***************************************************************************** 00018 ** Preprocessing 00019 *****************************************************************************/ 00020 00021 #ifdef __GNUC__ 00022 #include <unistd.h> 00023 #include <cstdio> 00024 #endif 00025 00026 /***************************************************************************** 00027 ** Main 00028 *****************************************************************************/ 00029 00030 00031 int main() 00032 { 00033 #ifndef _POSIX_VERSION 00034 printf("No support for POSIX on this system!\n"); 00035 #else //see what POSIX version 00036 long val; 00037 int errno; 00038 00039 #if defined(POSIX_VERSION) 00040 printf("POSIX_VERSION = %d.\n",_POSIX_VERSION); 00041 #endif 00042 #if defined(POSIX2_VERSION) 00043 printf("POSIX2_VERSION = %d.\n",_POSIX2_VERSION); 00044 #endif 00045 #if defined(POSIX2_C_VERSION) 00046 printf("POSIX2_C_VERSION = %d.\n",_POSIX2_C_VERSION); 00047 #endif 00048 #if _POSIX_VERSION == 199009 00049 printf("This system supports POSIX.1 without support for POSIX.4.\n"); 00050 #else 00051 #if _POSIX_VERSION >= 199309 00052 printf ("This system has Posix Version %ld. \n", _POSIX_VERSION); 00053 printf ("POSIX.1 and POSIX.4 are both supported. \n"); 00054 #else 00055 printf("This system supports a strange POSIX version between 199009 and 199309.\n"); 00056 #endif 00057 //DO POSIX.4 tests 00058 printf ("POSIX.4 Options Test Results:\n"); 00059 #ifdef _POSIX_REALTIME_SIGNALS 00060 printf(" POSIX.4 Additional real time signals are supported.\n"); 00061 #ifdef _POSIX_RTSIG_MAX 00062 printf(" _POSIX_RTSIG_MAX=%d Max real time signals.\n",_POSIX_RTSIG_MAX); 00063 #else 00064 printf(" No _POSIX_RTSIG_MAX value exists.\n"); 00065 #endif 00066 #ifdef _POSIX_SIGQUEUE_MAX 00067 printf(" _POSIX_SIGQUEUE_MAX=%d Max real time signals at once per process.\n",_POSIX_SIGQUEUE_MAX); 00068 #else 00069 printf(" No _POSIX_SIGQUEUE_MAX value exists.\n"); 00070 #endif 00071 #else 00072 printf(" POSIX.4 Additional real time signals are not supported.\n"); 00073 #endif 00074 #ifdef _POSIX_PRIORITY_SCHEDULING 00075 printf(" POSIX.4 Priority scheduling is supported.\n"); 00076 #else 00077 printf(" POSIX.4 Priority scheduling is not supported.\n"); 00078 #endif 00079 #ifdef _POSIX_TIMERS 00080 printf(" POSIX.4 Clocks and timers are supported.\n"); 00081 #ifdef _POSIX_TIMER_MAX 00082 printf(" _POSIX_TIMER_MAX=%d Max number of concurrent timers a process can have.\n",_POSIX_TIMER_MAX); 00083 #else 00084 printf(" No _POSIX_TIMER_MAX value exists.\n"); 00085 #endif 00086 #ifdef _POSIX_DELAYTIMER_MAX 00087 printf(" _POSIX_DELAYTIMER_MAX=%d Max number of times a timer can have a detectable overrun.\n",_POSIX_DELAYTIMER_MAX); 00088 #else 00089 printf(" No _POSIX_DELAYTIMER_MAX value exists.\n"); 00090 #endif 00091 #else 00092 printf(" POSIX.4 Clocks and timers are not supported.\n"); 00093 #endif 00094 #ifdef _POSIX_ASYNCHRONOUS_IO 00095 printf(" POSIX.4 Asynchronous I/O is supported.\n"); 00096 #ifdef _POSIX_AIO_LISTIO_MAX 00097 printf(" _POSIX_AIO_LISTIO_MAX=%d Max operations in one call\n",_POSIX_AIO_LISTIO_MAX); 00098 #else 00099 printf(" No _POSIX_AIO_LISTIO_MAX value exists.\n"); 00100 #endif 00101 #ifdef _POSIX_AIO_MAX 00102 printf(" _POSIX_AIO_MAX=%d Max concurrent Async I/Os\n",_POSIX_AIO_MAX); 00103 #else 00104 printf(" No _POSIX_AIO_MAX value exists.\n"); 00105 #endif 00106 #else 00107 printf(" POSIX.4 Asynchronous I/O is not supported.\n"); 00108 #endif 00109 #ifdef _POSIX_SYNCHRONIZED_IO //Only supported if Asynchronous I/O is supported 00110 printf(" POSIX.4 Synchronized I/O is supported.\n"); 00111 #else 00112 printf(" POSIX.4 Synchronized I/O is not supported.\n"); 00113 #endif 00114 #ifdef _POSIX_PRIORITIZED_IO 00115 printf(" POSIX.4 Prioritized asynchronous I/O is supported.\n"); 00116 #ifdef _POSIX_AIO_PRIO_DELTA_MAX 00117 printf(" _POSIX_AIO_PRIO_DELTA_MAX=%d Max amount AIO priority can be decreased.\n",_POSIX_AIO_PRIO_DELTA_MAX); 00118 #else 00119 printf(" No _POSIX_AIO_PRIO_DELTA_MAX value exists.\n"); 00120 #endif 00121 #else 00122 printf(" POSIX.4 Prioritized asynchronous I/O is not supported.\n"); 00123 #endif 00124 #ifdef _POSIX_FSYNC 00125 printf(" POSIX.4 The fsync function is supported.\n"); 00126 #else 00127 printf(" POSIX.4 The fsync function is not supported.\n"); 00128 #endif 00129 #ifdef _POSIX_MAPPED_FILES 00130 printf(" POSIX.4 Mapping files as memory is supported.\n"); 00131 #else 00132 printf(" POSIX.4 Mapping files as memory is not supported.\n"); 00133 #endif 00134 #ifdef _POSIX_MEMLOCK 00135 printf(" POSIX.4 Locking memory is supported.\n"); 00136 #else 00137 printf(" POSIX.4 Locking memory is not supported.\n"); 00138 #endif 00139 #ifdef _POSIX_MEMLOCK_RANGE 00140 printf(" POSIX.4 Locking memory ranges is supported.\n"); 00141 #else 00142 printf(" POSIX.4 Locking memory ranges is not supported.\n"); 00143 #endif 00144 #ifdef _POSIX_MEMORY_PROTECTION 00145 printf(" POSIX.4 Setting memory protection is supported.\n"); 00146 #else 00147 printf(" POSIX.4 Setting memory protection is not supported.\n"); 00148 #endif 00149 #ifdef _POSIX_MESSAGE_PASSING 00150 printf(" POSIX.4 Message Queues are supported.\n"); 00151 #ifdef _POSIX_MQ_OPEN_MAX 00152 printf(" _POSIX_MQ_OPEN_MAX=%d Max # of message queues per process.\n",_POSIX_MQ_OPEN_MAX); 00153 #else 00154 printf(" No _POSIX_MQ_OPEN_MAX value exists.\n"); 00155 #endif 00156 #ifdef _POSIX_MQ_PRIO_MAX 00157 printf(" _POSIX_MQ_PRIO_MAX=%d Max # of message priorities.\n",_POSIX_MQ_PRIO_MAX); 00158 #else 00159 printf(" No _POSIX_MQ_PRIO_MAX value exists.\n"); 00160 #endif 00161 #else 00162 printf(" POSIX.4 Message Queues are not supported.\n"); 00163 #endif 00164 #ifdef _POSIX_SEMAPHORES 00165 printf(" POSIX.4 Semaphores are supported.\n"); 00166 #ifdef _POSIX_SEM_NSEMS_MAX 00167 printf(" _POSIX_SEM_NSEMS_MAX=%d Max # of open semaphores per process.\n",_POSIX_SEM_NSEMS_MAX); 00168 #else 00169 printf(" No _POSIX_SEM_NSEMS_MAX value exists.\n"); 00170 #endif 00171 #ifdef _POSIX_SEM_VALUE_MAX 00172 printf(" _POSIX_SEM_VALUE_MAX=%d Maximum semaphore value.\n",_POSIX_SEM_VALUE_MAX); 00173 #else 00174 printf(" No _POSIX_SEM_VALUE_MAX value exists.\n"); 00175 #endif 00176 #else 00177 printf(" POSIX.4 Semaphores are not supported.\n"); 00178 #endif 00179 #ifdef _POSIX_SHARED_MEMORY_OBJECTS 00180 printf(" POSIX.4 Shared memory objects are supported.\n"); 00181 #else 00182 printf(" POSIX.4 Shared memory objects are not supported.\n"); 00183 #endif 00184 00185 #ifdef _POSIX_THREADS 00186 printf(" POSIX.1c pthreads are supported.\n"); 00187 #else 00188 printf(" POSIX.1c pthreads are not supported.\n"); 00189 #endif 00190 #ifdef _POSIX_THREAD_ATTR_STACKADDRTHREAD_ATTR_STACKADDR 00191 printf(" POSIX.4 Thread stack address attribute option is supported.\n"); 00192 #else 00193 printf(" POSIX.4 Thread stack address attribute option is not supported.\n"); 00194 #endif 00195 #ifdef _POSIX_THREAD_ATTR_STACKSIZE 00196 printf(" POSIX.4 Thread stack size attribute option is supported.\n"); 00197 #else 00198 printf(" POSIX.4 Thread stack size attribute option is not supported.\n"); 00199 #endif 00200 #ifdef _POSIX_THREAD_SAFE_FUNCTIONS 00201 printf(" POSIX.4 Thread-safe functions are supported.\n"); 00202 #else 00203 printf(" POSIX.4 Thread-safe functions are not supported.\n"); 00204 #endif 00205 #ifdef _POSIX_THREAD_PRIORITY_SCHEDULING 00206 printf(" POSIX.1c thread execution scheduling is supported.\n"); 00207 #else 00208 printf(" POSIX.1c thread execution scheduling is not supported.\n"); 00209 #endif 00210 #ifdef _POSIX_THREAD_PRIO_INHERIT 00211 printf(" POSIX.4 Thread priority inheritance option is supported.\n"); 00212 #else 00213 printf(" POSIX.4 Thread priority inheritance option is not supported.\n"); 00214 #endif 00215 #ifdef _POSIX_THREAD_PROCESS_SHARED 00216 printf(" POSIX.4 Process-shared synchronization is supported.\n"); 00217 #else 00218 printf(" POSIX.4 Process-shared synchronization is not supported.\n"); 00219 #endif 00220 #ifdef _POSIX_POSIX_PII 00221 printf(" Protocol-independent interfaces are supported.\n"); 00222 #else 00223 printf(" Protocol-independent interfaces are not supported.\n"); 00224 #endif 00225 #ifdef _POSIX_PII_XTI 00226 printf(" XTI protocol-indep. interfaces are supported.\n"); 00227 #else 00228 printf(" XTI protocol-indep. interfaces are not supported.\n"); 00229 #endif 00230 #ifdef _POSIX_PII_SOCKET 00231 printf(" Socket protocol-indep. interfaces are supported.\n"); 00232 #else 00233 printf(" Socket protocol-indep. interfaces are not supported.\n"); 00234 #endif 00235 #ifdef _POSIX_PII_INTERNET 00236 printf(" Internet family of protocols is supported.\n"); 00237 #else 00238 printf(" Internet family of protocols is not supported.\n"); 00239 #endif 00240 #ifdef _POSIX_PII_INTERNET_STREAM 00241 printf(" Connection-mode Internet protocol is supported.\n"); 00242 #else 00243 printf(" Connection-mode Internet protocol is not supported.\n"); 00244 #endif 00245 #ifdef _POSIX_PII_INTERNET_DGRAM 00246 printf(" Connectionless Internet protocol is supported.\n"); 00247 #else 00248 printf(" Connectionless Internet protocol is not supported.\n"); 00249 #endif 00250 #ifdef _POSIX_PII_OSI 00251 printf(" ISO/OSI family of protocols is supported.\n"); 00252 #else 00253 printf(" ISO/OSI family of protocols is not supported.\n"); 00254 #endif 00255 #ifdef _POSIX_PII_OSI_COTS 00256 printf(" Connection-mode ISO/OSI service is supported.\n"); 00257 #else 00258 printf(" Connection-mode ISO/OSI service is not supported.\n"); 00259 #endif 00260 #ifdef _POSIX_PII_OSI_CLTS 00261 printf(" Connectionless ISO/OSI service is supported.\n"); 00262 #else 00263 printf(" Connectionless ISO/OSI service is not supported.\n"); 00264 #endif 00265 #ifdef _POSIX_POLL 00266 printf(" Implementation supports `poll' function.\n"); 00267 #else 00268 printf(" poll function is not supported.\n"); 00269 #endif 00270 #ifdef _POSIX_SELECT 00271 printf(" Implementation supports `select' and `pselect'.\n"); 00272 #else 00273 printf(" Implementation does not support `select' and `pselect'.\n"); 00274 #endif 00275 #ifdef _XOPEN_REALTIME 00276 printf(" X/Open realtime support is available.\n"); 00277 #else 00278 printf(" X/Open realtime support is not available..\n"); 00279 #endif 00280 #ifdef _XOPEN_REALTIME_THREADS 00281 printf(" X/Open realtime thread support is available.\n"); 00282 #else 00283 printf(" X/Open realtime thread support is not available.\n"); 00284 #endif 00285 #ifdef _XOPEN_SHM 00286 printf(" XPG4.2 Shared memory interface is supported.\n"); 00287 #else 00288 printf(" XPG4.2 Shared memory interface is not supported.\n"); 00289 #endif 00290 #ifdef _XBS5_ILP32_OFF32 00291 printf(" 32-bit int, long, pointer, and off_t types are supported.\n"); 00292 #else 00293 printf(" 32-bit int, long, pointer, and off_t types are not supported.\n"); 00294 #endif 00295 #ifdef _XBS5_ILP32_OFFBIG 00296 printf(" 32-bit int, long, and pointer and off_t with at least 64 bits is supported.\n"); 00297 #else 00298 printf(" 32-bit int, long, and pointer and off_t with at least 64 bits is not supported.\n"); 00299 #endif 00300 #ifdef _XBS5_LP64_OFF64 00301 printf(" 32-bit int, and 64-bit long, pointer, and off_t types are supported.\n"); 00302 #else 00303 printf(" 32-bit int, and 64-bit long, pointer, and off_t types are not supported.\n"); 00304 #endif 00305 #ifdef _XBS5_LPBIG_OFFBIG 00306 printf(" 32 bits int and long, pointer, and off_t with at least 64 bits are supported.\n"); 00307 #else 00308 printf(" 32 bits int and long, pointer, and off_t with at least 64 bits are not supported.\n"); 00309 #endif 00310 00311 00312 #endif 00313 //Do POSIX.1 tests 00314 printf ("POSIX.1 Options Test Results:\n"); 00315 #ifdef _POSIX_JOB_CONTROL 00316 printf(" POSIX.1 Job control is supported.\n"); 00317 #else 00318 printf(" POSIX.1 Job control is not supported.\n"); 00319 #endif 00320 #ifdef _POSIX_CHOWN_RESTRICTED 00321 printf(" POSIX.1 Chown restrictions are supported.\n"); 00322 #else 00323 printf(" POSIX.1 Chown restrictions are not supported.\n"); 00324 #endif 00325 #ifdef _POSIX_SAVED_IDS 00326 printf(" POSIX.1 Process saved IDs are supported.\n"); 00327 #else 00328 printf(" POSIX.1 Process saved IDs are not supported.\n"); 00329 #endif 00330 #ifdef _POSIX_NO_TRUNC 00331 printf(" POSIX.1 Long pathname errors are supported.\n"); 00332 #else 00333 printf(" POSIX.1 Long pathname errors are not supported.\n"); 00334 #endif 00335 #ifdef _POSIX_VDISABLE 00336 printf(" POSIX.1 Some terminal charactistics disabling is supported.\n"); 00337 #else 00338 printf(" POSIX.1 Some terminal charactistics disabling is not supported.\n"); 00339 #endif 00340 #ifdef NGROUPS_MAX 00341 printf(" POSIX.1 Supplementary group IDs is supported.\n"); 00342 #else 00343 printf(" POSIX.1 Supplementary group IDs is not supported.\n"); 00344 #endif 00345 00346 //System Run time testing 00347 printf("\nSystem run time tests:\n"); 00348 errno=0; 00349 val=sysconf(_SC_JOB_CONTROL); 00350 if ((val == -1) && (errno)) 00351 { 00352 printf("Bad option _SC_JOB_CONTROL\n"); 00353 } 00354 else if ((val == -1) && (!errno)) 00355 { 00356 printf("POSIX.1 JOB CONTROL not Supported.\n"); 00357 } 00358 else 00359 { 00360 printf("POSIX.1 JOB CONTROL Supported.\n"); 00361 } 00362 errno=0; 00363 val=sysconf(_SC_SAVED_IDS); 00364 if ((val == -1) && (errno)) 00365 { 00366 printf("Bad option _SC_SAVED_IDS\n"); 00367 } 00368 else if ((val == -1) && (!errno)) 00369 { 00370 printf("POSIX.1 SAVED IDS not Supported.\n"); 00371 } 00372 else 00373 { 00374 printf("POSIX.1 SAVED IDS Supported.\n"); 00375 } 00376 errno=0; 00377 val=sysconf(_SC_VERSION); 00378 if ((val == -1) && (errno)) 00379 { 00380 printf("Bad option _SC_VERSION\n"); 00381 } 00382 else if ((val == -1) && (!errno)) 00383 { 00384 printf("POSIX.1 VERSION not Supported.\n"); 00385 } 00386 else 00387 { 00388 printf("POSIX.1 VERSION Supported.\n"); 00389 } 00390 val=sysconf(_SC_ARG_MAX); 00391 if (val == -1) 00392 { 00393 printf("Bad option _SC_ARG_MAX\n"); 00394 } 00395 else 00396 { 00397 printf("POSIX.1 ARG MAX Value=%ld.\n",val); 00398 } 00399 val=sysconf(_SC_CHILD_MAX); 00400 if (val == -1) 00401 { 00402 printf("Bad option _SC_CHILD_MAX\n"); 00403 } 00404 else 00405 { 00406 printf("POSIX.1 CHILD MAX Value=%ld.\n",val); 00407 } 00408 val=sysconf(_SC_CLK_TCK); 00409 if (val == -1) 00410 { 00411 printf("Bad option _SC_CLK_TCK\n"); 00412 } 00413 else 00414 { 00415 printf("POSIX.1 CLK TCK Value=%ld.\n",val); 00416 } 00417 val=sysconf(_SC_NGROUPS_MAX); 00418 if (val == -1) 00419 { 00420 printf("Bad option _SC_NGROUPS_MAX\n"); 00421 } 00422 else 00423 { 00424 printf("POSIX.1 NGROUPS MAX Value=%ld.\n",val); 00425 } 00426 val=sysconf(_SC_OPEN_MAX); 00427 if (val == -1) 00428 { 00429 printf("Bad option _SC_OPEN_MAX\n"); 00430 } 00431 else 00432 { 00433 printf("POSIX.1 OPEN MAX Value=%ld.\n",val); 00434 } 00435 val=sysconf(_SC_STREAM_MAX); 00436 if (val == -1) 00437 { 00438 printf("Bad option _SC_STREAM_MAX\n"); 00439 } 00440 else 00441 { 00442 printf("POSIX.1 STREAM MAX Value=%ld.\n",val); 00443 } 00444 val=sysconf(_SC_TZNAME_MAX); 00445 if (val == -1) 00446 { 00447 printf("Bad option _SC_TZNAME_MAX\n"); 00448 } 00449 else 00450 { 00451 printf("POSIX.1 TZNAME MAX Value=%ld.\n",val); 00452 } 00453 errno=0; 00454 val=sysconf(_SC_ASYNCHRONOUS_IO); 00455 if ((val == -1) && (errno)) 00456 { 00457 printf("Bad option _SC_ASYNCHRONOUS_IO\n"); 00458 } 00459 else if ((val == -1) && (!errno)) 00460 { 00461 printf("POSIX.4 ASYNCHRONOUS IO not Supported.\n"); 00462 } 00463 else 00464 { 00465 printf("POSIX.4 ASYNCHRONOUS IO Supported.\n"); 00466 } 00467 errno=0; 00468 val=sysconf(_SC_MAPPED_FILES); 00469 if ((val == -1) && (errno)) 00470 { 00471 printf("Bad option _SC_MAPPED_FILES\n"); 00472 } 00473 else if ((val == -1) && (!errno)) 00474 { 00475 printf("POSIX.4 MAPPED FILES not Supported.\n"); 00476 } 00477 else 00478 { 00479 printf("POSIX.4 MAPPED FILES Supported.\n"); 00480 } 00481 errno=0; 00482 val=sysconf(_SC_MEMLOCK_RANGE); 00483 if ((val == -1) && (errno)) 00484 { 00485 printf("Bad option _SC_MEMLOCK_RANGE\n"); 00486 } 00487 else if ((val == -1) && (!errno)) 00488 { 00489 printf("POSIX.4 MEMLOCK RANGE not Supported.\n"); 00490 } 00491 else 00492 { 00493 printf("POSIX.4 MEMLOCK RANGE Supported.\n"); 00494 } 00495 errno=0; 00496 val=sysconf(_SC_MEMORY_PROTECTION); 00497 if ((val == -1) && (errno)) 00498 { 00499 printf("Bad option _SC_MEMORY_PROTECTION\n"); 00500 } 00501 else if ((val == -1) && (!errno)) 00502 { 00503 printf("POSIX.4 MEMORY PROTECTION not Supported.\n"); 00504 } 00505 else 00506 { 00507 printf("POSIX.4 MEMORY PROTECTION Supported.\n"); 00508 } 00509 errno=0; 00510 val=sysconf(_SC_MESSAGE_PASSING); 00511 if ((val == -1) && (errno)) 00512 { 00513 printf("Bad option _SC_MESSAGE_PASSING\n"); 00514 } 00515 else if ((val == -1) && (!errno)) 00516 { 00517 printf("POSIX.4 MESSAGE PASSING not Supported.\n"); 00518 } 00519 else 00520 { 00521 printf("POSIX.4 MESSAGE PASSING Supported.\n"); 00522 } 00523 errno=0; 00524 val=sysconf(_SC_PRIORITIZED_IO); 00525 if ((val == -1) && (errno)) 00526 { 00527 printf("Bad option _SC_PRIORITIZED_IO\n"); 00528 } 00529 else if ((val == -1) && (!errno)) 00530 { 00531 printf("POSIX.4 PRIORITIZED IO not Supported.\n"); 00532 } 00533 else 00534 { 00535 printf("POSIX.4 PRIORITIZED IO Supported.\n"); 00536 } 00537 errno=0; 00538 val=sysconf(_SC_PRIORITY_SCHEDULING); 00539 if ((val == -1) && (errno)) 00540 { 00541 printf("Bad option _SC_PRIORITY_SCHEDULING\n"); 00542 } 00543 else if ((val == -1) && (!errno)) 00544 { 00545 printf("POSIX.4 PRIORITY SCHEDULING not Supported.\n"); 00546 } 00547 else 00548 { 00549 printf("POSIX.4 PRIORITY SCHEDULING Supported.\n"); 00550 } 00551 errno=0; 00552 val=sysconf(_SC_REALTIME_SIGNALS); 00553 if ((val == -1) && (errno)) 00554 { 00555 printf("Bad option _SC_REALTIME_SIGNALS\n"); 00556 } 00557 else if ((val == -1) && (!errno)) 00558 { 00559 printf("POSIX.4 REALTIME SIGNALS not Supported.\n"); 00560 } 00561 else 00562 { 00563 printf("POSIX.4 REALTIME SIGNALS Supported.\n"); 00564 } 00565 errno=0; 00566 val=sysconf(_SC_SEMAPHORES); 00567 if ((val == -1) && (errno)) 00568 { 00569 printf("Bad option _SC_SEMAPHORES\n"); 00570 } 00571 else if ((val == -1) && (!errno)) 00572 { 00573 printf("POSIX.4 SEMAPHORES not Supported.\n"); 00574 } 00575 else 00576 { 00577 printf("POSIX.4 SEMAPHORES Supported.\n"); 00578 } 00579 errno=0; 00580 val=sysconf(_SC_FSYNC); 00581 if ((val == -1) && (errno)) 00582 { 00583 printf("Bad option _SC_FSYNC\n"); 00584 } 00585 else if ((val == -1) && (!errno)) 00586 { 00587 printf("POSIX.4 FSYNC not Supported.\n"); 00588 } 00589 else 00590 { 00591 printf("POSIX.4 FSYNC Supported.\n"); 00592 } 00593 errno=0; 00594 val=sysconf(_SC_SHARED_MEMORY_OBJECTS); 00595 if ((val == -1) && (errno)) 00596 { 00597 printf("Bad option _SC_SHARED_MEMORY_OBJECTS\n"); 00598 } 00599 else if ((val == -1) && (!errno)) 00600 { 00601 printf("POSIX.4 SHARED_MEMORY_OBJECTS not Supported.\n"); 00602 } 00603 else 00604 { 00605 printf("POSIX.4 SHARED_MEMORY_OBJECTS Supported.\n"); 00606 } 00607 errno=0; 00608 val=sysconf(_SC_SYNCHRONIZED_IO); 00609 if ((val == -1) && (errno)) 00610 { 00611 printf("Bad option _SC_SYNCHRONIZED_IO\n"); 00612 } 00613 else if ((val == -1) && (!errno)) 00614 { 00615 printf("POSIX.4 SYNCHRONIZED IO not Supported.\n"); 00616 } 00617 else 00618 { 00619 printf("POSIX.4 SYNCHRONIZED IO Supported.\n"); 00620 } 00621 errno=0; 00622 val=sysconf(_SC_TIMERS); 00623 if ((val == -1) && (errno)) 00624 { 00625 printf("Bad option _SC_TIMERS\n"); 00626 } 00627 else if ((val == -1) && (!errno)) 00628 { 00629 printf("POSIX.4 TIMERS not Supported.\n"); 00630 } 00631 else 00632 { 00633 printf("POSIX.4 TIMERS Supported.\n"); 00634 } 00635 val=sysconf(_SC_AIO_LISTIO_MAX); 00636 if (val == -1) 00637 { 00638 printf("Bad option _SC_AIO_LISTIO_MAX\n"); 00639 } 00640 else 00641 { 00642 printf("POSIX.4 AIO LISTIO MAX Value=%ld.\n",val); 00643 } 00644 val=sysconf(_SC_AIO_MAX); 00645 if (val == -1) 00646 { 00647 printf("Bad option _SC_AIO_MAX\n"); 00648 } 00649 else 00650 { 00651 printf("POSIX.4 AIO MAX Value=%ld.\n",val); 00652 } 00653 val=sysconf(_SC_AIO_PRIO_DELTA_MAX); 00654 if (val == -1) 00655 { 00656 printf("Bad option _SC_AIO_PRIO_DELTA_MAX\n"); 00657 } 00658 else 00659 { 00660 printf("POSIX.4 AIO PRIO DELTA MAX Value=%ld.\n",val); 00661 } 00662 val=sysconf(_SC_DELAYTIMER_MAX); 00663 if (val == -1) 00664 { 00665 printf("Bad option _SC_DELAYTIMER_MAX\n"); 00666 } 00667 else 00668 { 00669 printf("POSIX.4 DELAYTIMER MAX Value=%ld.\n",val); 00670 } 00671 val=sysconf(_SC_MQ_OPEN_MAX); 00672 if (val == -1) 00673 { 00674 printf("Bad option _SC_MQ_OPEN_MAX\n"); 00675 } 00676 else 00677 { 00678 printf("POSIX.4 MQ OPEN MAX Value=%ld.\n",val); 00679 } 00680 val=sysconf(_SC_MQ_PRIO_MAX); 00681 if (val == -1) 00682 { 00683 printf("Bad option _SC_MQ_PRIO_MAX\n"); 00684 } 00685 else 00686 { 00687 printf("POSIX.4 MQ PRIO MAX Value=%ld.\n",val); 00688 } 00689 val=sysconf(_SC_PAGESIZE); 00690 if (val == -1) 00691 { 00692 printf("Bad option _SC_PAGESIZE\n"); 00693 } 00694 else 00695 { 00696 printf("POSIX.4 PAGESIZE Value=%ld.\n",val); 00697 } 00698 val=sysconf(_SC_RTSIG_MAX); 00699 if (val == -1) 00700 { 00701 printf("Bad option _SC_RTSIG_MAX\n"); 00702 } 00703 else 00704 { 00705 printf("POSIX.4 RTSIG MAX Value=%ld.\n",val); 00706 } 00707 val=sysconf(_SC_SEM_NSEMS_MAX); 00708 if (val == -1) 00709 { 00710 printf("Bad option _SC_SEM_NSEMS_MAX\n"); 00711 } 00712 else 00713 { 00714 printf("POSIX.4 SEM NSEMS MAX Value=%ld.\n",val); 00715 } 00716 val=sysconf(_SC_SEM_VALUE_MAX); 00717 if (val == -1) 00718 { 00719 printf("Bad option _SC_SEM_VALUE_MAX\n"); 00720 } 00721 else 00722 { 00723 printf("POSIX.4 SEM VALUE MAX Value=%ld.\n",val); 00724 } 00725 val=sysconf(_SC_SIGQUEUE_MAX); 00726 if (val == -1) 00727 { 00728 printf("Bad option _SC_SIGQUEUE_MAX\n"); 00729 } 00730 else 00731 { 00732 printf("POSIX.4 SIGQUEUE MAX Value=%ld.\n",val); 00733 } 00734 val=sysconf(_SC_TIMER_MAX); 00735 if (val == -1) 00736 { 00737 printf("Bad option _SC_TIMER_MAX\n"); 00738 } 00739 else 00740 { 00741 printf("POSIX.4 TIMER MAX Value=%ld.\n",val); 00742 } 00743 00744 #endif 00745 00746 return 0; 00747 }