/apps/posix-test.c

https://github.com/linkdd/slightx · C · 719 lines · 705 code · 11 blank · 3 comment · 151 complexity · 43cce980647c524b1a2042f7c5163514 MD5 · raw file

  1. #define _POSIX_SOURCE
  2. #define _POSIX_C_SOURCE 199309
  3. #include <stdio.h>
  4. #include <unistd.h>
  5. long val;
  6. int errno;
  7. int main(void)
  8. {
  9. printf("POSIX Compile and Runtime Options Test Program Version 1.0.0\n");
  10. printf("Date: June 28, 2000 Author: Mark Allen\n\n");
  11. #ifndef _POSIX_VERSION
  12. printf("No support for POSIX on this system!\n");
  13. #else /* see what POSIX version */
  14. printf("POSIX_VERSION = %d.\n",_POSIX_VERSION);
  15. printf("POSIX2_VERSION = %d.\n",_POSIX2_VERSION);
  16. #if _POSIX_VERSION == 199009
  17. printf("This system supports POSIX.1 without support for POSIX.4.\n");
  18. #else
  19. #if _POSIX_VERSION >= 199309
  20. printf ("This system supports POSIX.1 and POSIX.4. \n");
  21. #else
  22. printf("This system supports a strange POSIX version between 199009 and 199309.\n");
  23. #endif
  24. /* DO POSIX.4 tests */
  25. printf ("POSIX.4 Options Test Results:\n");
  26. #ifdef _POSIX_REALTIME_SIGNALS
  27. printf(" POSIX.4 Additional real time signals are supported.\n");
  28. #ifdef _POSIX_RTSIG_MAX
  29. printf(" _POSIX_RTSIG_MAX=%d Max real time signals.\n",_POSIX_RTSIG_MAX);
  30. #else
  31. printf(" No _POSIX_RTSIG_MAX value exists.\n");
  32. #endif
  33. #ifdef _POSIX_SIGQUEUE_MAX
  34. printf(" _POSIX_SIGQUEUE_MAX=%d Max real time signals at once per process.\n",_POSIX_RTQUEUE_MAX);
  35. #else
  36. printf(" No _POSIX_SIGQUEUE_MAX value exists.\n");
  37. #endif
  38. #else
  39. printf(" POSIX.4 Additional real time signals are not supported.\n");
  40. #endif
  41. #ifdef _POSIX_PRIORITY_SCHEDULING
  42. printf(" POSIX.4 Priority scheduling is supported.\n");
  43. #else
  44. printf(" POSIX.4 Priority scheduling is not supported.\n");
  45. #endif
  46. #ifdef _POSIX_TIMERS
  47. printf(" POSIX.4 Clocks and timers are supported.\n");
  48. #ifdef _POSIX_TIMER_MAX
  49. printf(" _POSIX_TIMER_MAX=%d Max number of concurrent timers a process can have.\n",_POSIX_TIMER_MAX);
  50. #else
  51. printf(" No _POSIX_TIMER_MAX value exists.\n");
  52. #endif
  53. #ifdef _POSIX_DELAYTIMER_MAX
  54. printf(" _POSIX_DELAYTIMER_MAX=%d Max number of times a timer can have a detectable overrun.\n",_POSIX_DELAYTIMER_MAX);
  55. #else
  56. printf(" No _POSIX_DELAYTIMER_MAX value exists.\n");
  57. #endif
  58. #else
  59. printf(" POSIX.4 Clocks and timers are not supported.\n");
  60. #endif
  61. #ifdef _POSIX_ASYNCHRONOUS_IO
  62. printf(" POSIX.4 Asynchronous I/O is supported.\n");
  63. #ifdef _POSIX_AIO_LISTIO_MAX
  64. printf(" _POSIX_AIO_LISTIO_MAX=%d Max operations in one call\n",_POSIX_AIO_LISTIO_MAX);
  65. #else
  66. printf(" No _POSIX_AIO_LISTIO_MAX value exists.\n");
  67. #endif
  68. #ifdef _POSIX_AIO_MAX
  69. printf(" _POSIX_AIO_MAX=%d Max concurrent Async I/Os\n",_POSIX_AIO_MAX);
  70. #else
  71. printf(" No _POSIX_AIO_MAX value exists.\n");
  72. #endif
  73. #else
  74. printf(" POSIX.4 Asynchronous I/O is not supported.\n");
  75. #endif
  76. #ifdef _POSIX_SYNCHRONIZED_IO /* Only supported if Asynchronous I/O is supported */
  77. printf(" POSIX.4 Synchronized I/O is supported.\n");
  78. #else
  79. printf(" POSIX.4 Synchronized I/O is not supported.\n");
  80. #endif
  81. #ifdef _POSIX_PRIORITIZED_IO
  82. printf(" POSIX.4 Prioritized asynchronous I/O is supported.\n");
  83. #ifdef _POSIX_AIO_PRIO_DELTA_MAX
  84. printf(" _POSIX_AIO_PRIO_DELTA_MAX=%d Max amount AIO priority can be decreased.\n",_POSIX_AIO_PRIO_DELTA_MAX);
  85. #else
  86. printf(" No _POSIX_AIO_PRIO_DELTA_MAX value exists.\n");
  87. #endif
  88. #else
  89. printf(" POSIX.4 Prioritized asynchronous I/O is not supported.\n");
  90. #endif
  91. #ifdef _POSIX_FSYNC
  92. printf(" POSIX.4 The fsync function is supported.\n");
  93. #else
  94. printf(" POSIX.4 The fsync function is not supported.\n");
  95. #endif
  96. #ifdef _POSIX_MAPPED_FILES
  97. printf(" POSIX.4 Mapping files as memory is supported.\n");
  98. #else
  99. printf(" POSIX.4 Mapping files as memory is not supported.\n");
  100. #endif
  101. #ifdef _POSIX_MEMLOCK
  102. printf(" POSIX.4 Locking memory is supported.\n");
  103. #else
  104. printf(" POSIX.4 Locking memory is not supported.\n");
  105. #endif
  106. #ifdef _POSIX_MEMLOCK_RANGE
  107. printf(" POSIX.4 Locking memory ranges is supported.\n");
  108. #else
  109. printf(" POSIX.4 Locking memory ranges is not supported.\n");
  110. #endif
  111. #ifdef _POSIX_MEMORY_PROTECTION
  112. printf(" POSIX.4 Setting memory protection is supported.\n");
  113. #else
  114. printf(" POSIX.4 Setting memory protection is not supported.\n");
  115. #endif
  116. #ifdef _POSIX_MESSAGE_PASSING
  117. printf(" POSIX.4 Message Queues are supported.\n");
  118. #ifdef _POSIX_MQ_OPEN_MAX
  119. printf(" _POSIX_MQ_OPEN_MAX=%d Max # of message queues per process.\n",_POSIX_MQ_OPEN_MAX);
  120. #else
  121. printf(" No _POSIX_MQ_OPEN_MAX value exists.\n");
  122. #endif
  123. #ifdef _POSIX_MQ_PRIO_MAX
  124. printf(" _POSIX_MQ_PRIO_MAX=%d Max # of message priorities.\n",_POSIX_MQ_PRIO_MAX);
  125. #else
  126. printf(" No _POSIX_MQ_PRIO_MAX value exists.\n");
  127. #endif
  128. #else
  129. printf(" POSIX.4 Message Queues are not supported.\n");
  130. #endif
  131. #ifdef _POSIX_SEMAPHORES
  132. printf(" POSIX.4 Semaphores are supported.\n");
  133. #ifdef _POSIX_SEM_NSEMS_MAX
  134. printf(" _POSIX_SEM_NSEMS_MAX=%d Max # of open semaphores per process.\n",_POSIX_SEM_NSEMS_MAX);
  135. #else
  136. printf(" No _POSIX_SEM_NSEMS_MAX value exists.\n");
  137. #endif
  138. #ifdef _POSIX_SEM_VALUE_MAX
  139. printf(" _POSIX_SEM_VALUE_MAX=%d Maximum semaphore value.\n",_POSIX_SEM_VALUE_MAX);
  140. #else
  141. printf(" No _POSIX_SEM_VALUE_MAX value exists.\n");
  142. #endif
  143. #else
  144. printf(" POSIX.4 Semaphores are not supported.\n");
  145. #endif
  146. #ifdef _POSIX_SHARED_MEMORY_OBJECTS
  147. printf(" POSIX.4 Shared memory objects are supported.\n");
  148. #else
  149. printf(" POSIX.4 Shared memory objects are not supported.\n");
  150. #endif
  151. #ifdef _POSIX_THREADS
  152. printf(" POSIX.1c pthreads are supported.\n");
  153. #else
  154. printf(" POSIX.1c pthreads are not supported.\n");
  155. #endif
  156. #ifdef _POSIX_THREAD_ATTR_STACKADDRTHREAD_ATTR_STACKADDR
  157. printf(" POSIX.4 Thread stack address attribute option is supported.\n");
  158. #else
  159. printf(" POSIX.4 Thread stack address attribute option is not supported.\n");
  160. #endif
  161. #ifdef _POSIX_THREAD_ATTR_STACKSIZE
  162. printf(" POSIX.4 Thread stack size attribute option is supported.\n");
  163. #else
  164. printf(" POSIX.4 Thread stack size attribute option is not supported.\n");
  165. #endif
  166. #ifdef _POSIX_THREAD_SAFE_FUNCTIONS
  167. printf(" POSIX.4 Thread-safe functions are supported.\n");
  168. #else
  169. printf(" POSIX.4 Thread-safe functions are not supported.\n");
  170. #endif
  171. #ifdef _POSIX_THREAD_PRIORITY_SCHEDULING
  172. printf(" POSIX.1c thread execution scheduling is supported.\n");
  173. #else
  174. printf(" POSIX.1c thread execution scheduling is not supported.\n");
  175. #endif
  176. #ifdef _POSIX_THREAD_PRIO_INHERIT
  177. printf(" POSIX.4 Thread priority inheritance option is supported.\n");
  178. #else
  179. printf(" POSIX.4 Thread priority inheritance option is not supported.\n");
  180. #endif
  181. #ifdef _POSIX_THREAD_PROCESS_SHARED
  182. printf(" POSIX.4 Process-shared synchronization is supported.\n");
  183. #else
  184. printf(" POSIX.4 Process-shared synchronization is not supported.\n");
  185. #endif
  186. #ifdef _POSIX_POSIX_PII
  187. printf(" Protocol-independent interfaces are supported.\n");
  188. #else
  189. printf(" Protocol-independent interfaces are not supported.\n");
  190. #endif
  191. #ifdef _POSIX_PII_XTI
  192. printf(" XTI protocol-indep. interfaces are supported.\n");
  193. #else
  194. printf(" XTI protocol-indep. interfaces are not supported.\n");
  195. #endif
  196. #ifdef _POSIX_PII_SOCKET
  197. printf(" Socket protocol-indep. interfaces are supported.\n");
  198. #else
  199. printf(" Socket protocol-indep. interfaces are not supported.\n");
  200. #endif
  201. #ifdef _POSIX_PII_INTERNET
  202. printf(" Internet family of protocols is supported.\n");
  203. #else
  204. printf(" Internet family of protocols is not supported.\n");
  205. #endif
  206. #ifdef _POSIX_PII_INTERNET_STREAM
  207. printf(" Connection-mode Internet protocol is supported.\n");
  208. #else
  209. printf(" Connection-mode Internet protocol is not supported.\n");
  210. #endif
  211. #ifdef _POSIX_PII_INTERNET_DGRAM
  212. printf(" Connectionless Internet protocol is supported.\n");
  213. #else
  214. printf(" Connectionless Internet protocol is not supported.\n");
  215. #endif
  216. #ifdef _POSIX_PII_OSI
  217. printf(" ISO/OSI family of protocols is supported.\n");
  218. #else
  219. printf(" ISO/OSI family of protocols is not supported.\n");
  220. #endif
  221. #ifdef _POSIX_PII_OSI_COTS
  222. printf(" Connection-mode ISO/OSI service is supported.\n");
  223. #else
  224. printf(" Connection-mode ISO/OSI service is not supported.\n");
  225. #endif
  226. #ifdef _POSIX_PII_OSI_CLTS
  227. printf(" Connectionless ISO/OSI service is supported.\n");
  228. #else
  229. printf(" Connectionless ISO/OSI service is not supported.\n");
  230. #endif
  231. #ifdef _POSIX_POLL
  232. printf(" Implementation supports `poll' function.\n");
  233. #else
  234. printf(" poll function is not supported.\n");
  235. #endif
  236. #ifdef _POSIX_SELECT
  237. printf(" Implementation supports `select' and `pselect'.\n");
  238. #else
  239. printf(" Implementation does not support `select' and `pselect'.\n");
  240. #endif
  241. #ifdef _XOPEN_REALTIME
  242. printf(" X/Open realtime support is available.\n");
  243. #else
  244. printf(" X/Open realtime support is not available..\n");
  245. #endif
  246. #ifdef _XOPEN_REALTIME_THREADS
  247. printf(" X/Open realtime thread support is available.\n");
  248. #else
  249. printf(" X/Open realtime thread support is not available.\n");
  250. #endif
  251. #ifdef _XOPEN_SHM
  252. printf(" XPG4.2 Shared memory interface is supported.\n");
  253. #else
  254. printf(" XPG4.2 Shared memory interface is not supported.\n");
  255. #endif
  256. #ifdef _XBS5_ILP32_OFF32
  257. printf(" 32-bit int, long, pointer, and off_t types are supported.\n");
  258. #else
  259. printf(" 32-bit int, long, pointer, and off_t types are not supported.\n");
  260. #endif
  261. #ifdef _XBS5_ILP32_OFFBIG
  262. printf(" 32-bit int, long, and pointer and off_t with at least 64 bits is supported.\n");
  263. #else
  264. printf(" 32-bit int, long, and pointer and off_t with at least 64 bits is not supported.\n");
  265. #endif
  266. #ifdef _XBS5_LP64_OFF64
  267. printf(" 32-bit int, and 64-bit long, pointer, and off_t types are supported.\n");
  268. #else
  269. printf(" 32-bit int, and 64-bit long, pointer, and off_t types are not supported.\n");
  270. #endif
  271. #ifdef _XBS5_LPBIG_OFFBIG
  272. printf(" 32 bits int and long, pointer, and off_t with at least 64 bits are supported.\n");
  273. #else
  274. printf(" 32 bits int and long, pointer, and off_t with at least 64 bits are not supported.\n");
  275. #endif
  276. #endif
  277. /* Do POSIX.1 tests */
  278. printf ("POSIX.1 Options Test Results:\n");
  279. #ifdef _POSIX_JOB_CONTROL
  280. printf(" POSIX.1 Job control is supported.\n");
  281. #else
  282. printf(" POSIX.1 Job control is not supported.\n");
  283. #endif
  284. #ifdef _POSIX_CHOWN_RESTRICTED
  285. printf(" POSIX.1 Chown restrictions are supported.\n");
  286. #else
  287. printf(" POSIX.1 Chown restrictions are not supported.\n");
  288. #endif
  289. #ifdef _POSIX_SAVED_IDS
  290. printf(" POSIX.1 Process saved IDs are supported.\n");
  291. #else
  292. printf(" POSIX.1 Process saved IDs are not supported.\n");
  293. #endif
  294. #ifdef _POSIX_NO_TRUNC
  295. printf(" POSIX.1 Long pathname errors are supported.\n");
  296. #else
  297. printf(" POSIX.1 Long pathname errors are not supported.\n");
  298. #endif
  299. #ifdef _POSIX_VDISABLE
  300. printf(" POSIX.1 Some terminal charactistics disabling is supported.\n");
  301. #else
  302. printf(" POSIX.1 Some terminal charactistics disabling is not supported.\n");
  303. #endif
  304. #ifdef NGROUPS_MAX
  305. printf(" POSIX.1 Supplementary group IDs is supported.\n");
  306. #else
  307. printf(" POSIX.1 Supplementary group IDs is not supported.\n");
  308. #endif
  309. #endif
  310. /* System Run time testing */
  311. printf("\nSystem run time tests:\n");
  312. errno=0;
  313. val=sysconf(_SC_JOB_CONTROL);
  314. if ((val == -1) && (errno))
  315. {
  316. printf("Bad option _SC_JOB_CONTROL\n");
  317. }
  318. else if ((val == -1) && (!errno))
  319. {
  320. printf("POSIX.1 JOB CONTROL not Supported.\n");
  321. }
  322. else
  323. {
  324. printf("POSIX.1 JOB CONTROL Supported.\n");
  325. }
  326. errno=0;
  327. val=sysconf(_SC_SAVED_IDS);
  328. if ((val == -1) && (errno))
  329. {
  330. printf("Bad option _SC_SAVED_IDS\n");
  331. }
  332. else if ((val == -1) && (!errno))
  333. {
  334. printf("POSIX.1 SAVED IDS not Supported.\n");
  335. }
  336. else
  337. {
  338. printf("POSIX.1 SAVED IDS Supported.\n");
  339. }
  340. errno=0;
  341. val=sysconf(_SC_VERSION);
  342. if ((val == -1) && (errno))
  343. {
  344. printf("Bad option _SC_VERSION\n");
  345. }
  346. else if ((val == -1) && (!errno))
  347. {
  348. printf("POSIX.1 VERSION not Supported.\n");
  349. }
  350. else
  351. {
  352. printf("POSIX.1 VERSION Supported.\n");
  353. }
  354. val=sysconf(_SC_ARG_MAX);
  355. if (val == -1)
  356. {
  357. printf("Bad option _SC_ARG_MAX\n");
  358. }
  359. else
  360. {
  361. printf("POSIX.1 ARG MAX Value=%d.\n",val);
  362. }
  363. val=sysconf(_SC_CHILD_MAX);
  364. if (val == -1)
  365. {
  366. printf("Bad option _SC_CHILD_MAX\n");
  367. }
  368. else
  369. {
  370. printf("POSIX.1 CHILD MAX Value=%d.\n",val);
  371. }
  372. val=sysconf(_SC_CLK_TCK);
  373. if (val == -1)
  374. {
  375. printf("Bad option _SC_CLK_TCK\n");
  376. }
  377. else
  378. {
  379. printf("POSIX.1 CLK TCK Value=%d.\n",val);
  380. }
  381. val=sysconf(_SC_NGROUPS_MAX);
  382. if (val == -1)
  383. {
  384. printf("Bad option _SC_NGROUPS_MAX\n");
  385. }
  386. else
  387. {
  388. printf("POSIX.1 NGROUPS MAX Value=%d.\n",val);
  389. }
  390. val=sysconf(_SC_OPEN_MAX);
  391. if (val == -1)
  392. {
  393. printf("Bad option _SC_OPEN_MAX\n");
  394. }
  395. else
  396. {
  397. printf("POSIX.1 OPEN MAX Value=%d.\n",val);
  398. }
  399. val=sysconf(_SC_STREAM_MAX);
  400. if (val == -1)
  401. {
  402. printf("Bad option _SC_STREAM_MAX\n");
  403. }
  404. else
  405. {
  406. printf("POSIX.1 STREAM MAX Value=%d.\n",val);
  407. }
  408. val=sysconf(_SC_TZNAME_MAX);
  409. if (val == -1)
  410. {
  411. printf("Bad option _SC_TZNAME_MAX\n");
  412. }
  413. else
  414. {
  415. printf("POSIX.1 TZNAME MAX Value=%d.\n",val);
  416. }
  417. errno=0;
  418. val=sysconf(_SC_ASYNCHRONOUS_IO);
  419. if ((val == -1) && (errno))
  420. {
  421. printf("Bad option _SC_ASYNCHRONOUS_IO\n");
  422. }
  423. else if ((val == -1) && (!errno))
  424. {
  425. printf("POSIX.4 ASYNCHRONOUS IO not Supported.\n");
  426. }
  427. else
  428. {
  429. printf("POSIX.4 ASYNCHRONOUS IO Supported.\n");
  430. }
  431. errno=0;
  432. val=sysconf(_SC_MAPPED_FILES);
  433. if ((val == -1) && (errno))
  434. {
  435. printf("Bad option _SC_MAPPED_FILES\n");
  436. }
  437. else if ((val == -1) && (!errno))
  438. {
  439. printf("POSIX.4 MAPPED FILES not Supported.\n");
  440. }
  441. else
  442. {
  443. printf("POSIX.4 MAPPED FILES Supported.\n");
  444. }
  445. errno=0;
  446. val=sysconf(_SC_MEMLOCK_RANGE);
  447. if ((val == -1) && (errno))
  448. {
  449. printf("Bad option _SC_MEMLOCK_RANGE\n");
  450. }
  451. else if ((val == -1) && (!errno))
  452. {
  453. printf("POSIX.4 MEMLOCK RANGE not Supported.\n");
  454. }
  455. else
  456. {
  457. printf("POSIX.4 MEMLOCK RANGE Supported.\n");
  458. }
  459. errno=0;
  460. val=sysconf(_SC_MEMORY_PROTECTION);
  461. if ((val == -1) && (errno))
  462. {
  463. printf("Bad option _SC_MEMORY_PROTECTION\n");
  464. }
  465. else if ((val == -1) && (!errno))
  466. {
  467. printf("POSIX.4 MEMORY PROTECTION not Supported.\n");
  468. }
  469. else
  470. {
  471. printf("POSIX.4 MEMORY PROTECTION Supported.\n");
  472. }
  473. errno=0;
  474. val=sysconf(_SC_MESSAGE_PASSING);
  475. if ((val == -1) && (errno))
  476. {
  477. printf("Bad option _SC_MESSAGE_PASSING\n");
  478. }
  479. else if ((val == -1) && (!errno))
  480. {
  481. printf("POSIX.4 MESSAGE PASSING not Supported.\n");
  482. }
  483. else
  484. {
  485. printf("POSIX.4 MESSAGE PASSING Supported.\n");
  486. }
  487. errno=0;
  488. val=sysconf(_SC_PRIORITIZED_IO);
  489. if ((val == -1) && (errno))
  490. {
  491. printf("Bad option _SC_PRIORITIZED_IO\n");
  492. }
  493. else if ((val == -1) && (!errno))
  494. {
  495. printf("POSIX.4 PRIORITIZED IO not Supported.\n");
  496. }
  497. else
  498. {
  499. printf("POSIX.4 PRIORITIZED IO Supported.\n");
  500. }
  501. errno=0;
  502. val=sysconf(_SC_PRIORITY_SCHEDULING);
  503. if ((val == -1) && (errno))
  504. {
  505. printf("Bad option _SC_PRIORITY_SCHEDULING\n");
  506. }
  507. else if ((val == -1) && (!errno))
  508. {
  509. printf("POSIX.4 PRIORITY SCHEDULING not Supported.\n");
  510. }
  511. else
  512. {
  513. printf("POSIX.4 PRIORITY SCHEDULING Supported.\n");
  514. }
  515. errno=0;
  516. val=sysconf(_SC_REALTIME_SIGNALS);
  517. if ((val == -1) && (errno))
  518. {
  519. printf("Bad option _SC_REALTIME_SIGNALS\n");
  520. }
  521. else if ((val == -1) && (!errno))
  522. {
  523. printf("POSIX.4 REALTIME SIGNALS not Supported.\n");
  524. }
  525. else
  526. {
  527. printf("POSIX.4 REALTIME SIGNALS Supported.\n");
  528. }
  529. errno=0;
  530. val=sysconf(_SC_SEMAPHORES);
  531. if ((val == -1) && (errno))
  532. {
  533. printf("Bad option _SC_SEMAPHORES\n");
  534. }
  535. else if ((val == -1) && (!errno))
  536. {
  537. printf("POSIX.4 SEMAPHORES not Supported.\n");
  538. }
  539. else
  540. {
  541. printf("POSIX.4 SEMAPHORES Supported.\n");
  542. }
  543. errno=0;
  544. val=sysconf(_SC_FSYNC);
  545. if ((val == -1) && (errno))
  546. {
  547. printf("Bad option _SC_FSYNC\n");
  548. }
  549. else if ((val == -1) && (!errno))
  550. {
  551. printf("POSIX.4 FSYNC not Supported.\n");
  552. }
  553. else
  554. {
  555. printf("POSIX.4 FSYNC Supported.\n");
  556. }
  557. errno=0;
  558. val=sysconf(_SC_SHARED_MEMORY_OBJECTS);
  559. if ((val == -1) && (errno))
  560. {
  561. printf("Bad option _SC_SHARED_MEMORY_OBJECTS\n");
  562. }
  563. else if ((val == -1) && (!errno))
  564. {
  565. printf("POSIX.4 SHARED_MEMORY_OBJECTS not Supported.\n");
  566. }
  567. else
  568. {
  569. printf("POSIX.4 SHARED_MEMORY_OBJECTS Supported.\n");
  570. }
  571. errno=0;
  572. val=sysconf(_SC_SYNCHRONIZED_IO);
  573. if ((val == -1) && (errno))
  574. {
  575. printf("Bad option _SC_SYNCHRONIZED_IO\n");
  576. }
  577. else if ((val == -1) && (!errno))
  578. {
  579. printf("POSIX.4 SYNCHRONIZED IO not Supported.\n");
  580. }
  581. else
  582. {
  583. printf("POSIX.4 SYNCHRONIZED IO Supported.\n");
  584. }
  585. errno=0;
  586. val=sysconf(_SC_TIMERS);
  587. if ((val == -1) && (errno))
  588. {
  589. printf("Bad option _SC_TIMERS\n");
  590. }
  591. else if ((val == -1) && (!errno))
  592. {
  593. printf("POSIX.4 TIMERS not Supported.\n");
  594. }
  595. else
  596. {
  597. printf("POSIX.4 TIMERS Supported.\n");
  598. }
  599. val=sysconf(_SC_AIO_LISTIO_MAX);
  600. if (val == -1)
  601. {
  602. printf("Bad option _SC_AIO_LISTIO_MAX\n");
  603. }
  604. else
  605. {
  606. printf("POSIX.4 AIO LISTIO MAX Value=%d.\n",val);
  607. }
  608. val=sysconf(_SC_AIO_MAX);
  609. if (val == -1)
  610. {
  611. printf("Bad option _SC_AIO_MAX\n");
  612. }
  613. else
  614. {
  615. printf("POSIX.4 AIO MAX Value=%d.\n",val);
  616. }
  617. val=sysconf(_SC_AIO_PRIO_DELTA_MAX);
  618. if (val == -1)
  619. {
  620. printf("Bad option _SC_AIO_PRIO_DELTA_MAX\n");
  621. }
  622. else
  623. {
  624. printf("POSIX.4 AIO PRIO DELTA MAX Value=%d.\n",val);
  625. }
  626. val=sysconf(_SC_DELAYTIMER_MAX);
  627. if (val == -1)
  628. {
  629. printf("Bad option _SC_DELAYTIMER_MAX\n");
  630. }
  631. else
  632. {
  633. printf("POSIX.4 DELAYTIMER MAX Value=%d.\n",val);
  634. }
  635. val=sysconf(_SC_MQ_OPEN_MAX);
  636. if (val == -1)
  637. {
  638. printf("Bad option _SC_MQ_OPEN_MAX\n");
  639. }
  640. else
  641. {
  642. printf("POSIX.4 MQ OPEN MAX Value=%d.\n",val);
  643. }
  644. val=sysconf(_SC_MQ_PRIO_MAX);
  645. if (val == -1)
  646. {
  647. printf("Bad option _SC_MQ_PRIO_MAX\n");
  648. }
  649. else
  650. {
  651. printf("POSIX.4 MQ PRIO MAX Value=%d.\n",val);
  652. }
  653. val=sysconf(_SC_PAGESIZE);
  654. if (val == -1)
  655. {
  656. printf("Bad option _SC_PAGESIZE\n");
  657. }
  658. else
  659. {
  660. printf("POSIX.4 PAGESIZE Value=%d.\n",val);
  661. }
  662. val=sysconf(_SC_RTSIG_MAX);
  663. if (val == -1)
  664. {
  665. printf("Bad option _SC_RTSIG_MAX\n");
  666. }
  667. else
  668. {
  669. printf("POSIX.4 RTSIG MAX Value=%d.\n",val);
  670. }
  671. val=sysconf(_SC_SEM_NSEMS_MAX);
  672. if (val == -1)
  673. {
  674. printf("Bad option _SC_SEM_NSEMS_MAX\n");
  675. }
  676. else
  677. {
  678. printf("POSIX.4 SEM NSEMS MAX Value=%d.\n",val);
  679. }
  680. val=sysconf(_SC_SEM_VALUE_MAX);
  681. if (val == -1)
  682. {
  683. printf("Bad option _SC_SEM_VALUE_MAX\n");
  684. }
  685. else
  686. {
  687. printf("POSIX.4 SEM VALUE MAX Value=%d.\n",val);
  688. }
  689. val=sysconf(_SC_SIGQUEUE_MAX);
  690. if (val == -1)
  691. {
  692. printf("Bad option _SC_SIGQUEUE_MAX\n");
  693. }
  694. else
  695. {
  696. printf("POSIX.4 SIGQUEUE MAX Value=%d.\n",val);
  697. }
  698. val=sysconf(_SC_TIMER_MAX);
  699. if (val == -1)
  700. {
  701. printf("Bad option _SC_TIMER_MAX\n");
  702. }
  703. else
  704. {
  705. printf("POSIX.4 TIMER MAX Value=%d.\n",val);
  706. }
  707. return 0;
  708. } /* end of main */