logo

oasis-root

Compiled tree of Oasis Linux based on own branch at <https://hacktivis.me/git/oasis/> git clone https://anongit.hacktivis.me/git/oasis-root.git

unistd.h.0p (47011B)


  1. '\" et
  2. .TH unistd.h "0P" 2017 "IEEE/The Open Group" "POSIX Programmer's Manual"
  3. .\"
  4. .SH PROLOG
  5. This manual page is part of the POSIX Programmer's Manual.
  6. The Linux implementation of this interface may differ (consult
  7. the corresponding Linux manual page for details of Linux behavior),
  8. or the interface may not be implemented on Linux.
  9. .\"
  10. .SH NAME
  11. unistd.h
  12. \(em standard symbolic constants and types
  13. .SH SYNOPSIS
  14. .LP
  15. .nf
  16. #include <unistd.h>
  17. .fi
  18. .SH DESCRIPTION
  19. The
  20. .IR <unistd.h>
  21. header defines miscellaneous symbolic constants and types, and declares
  22. miscellaneous functions. The actual values of the constants are
  23. unspecified except as shown. The contents of this header are shown
  24. below.
  25. .SS "Version Test Macros"
  26. .P
  27. The
  28. .IR <unistd.h>
  29. header shall define the following symbolic constants. The values shall
  30. be suitable for use in
  31. .BR #if
  32. preprocessing directives.
  33. .IP _POSIX_VERSION 6
  34. .br
  35. Integer value indicating version of this standard (C-language
  36. binding) to which the implementation conforms. For implementations
  37. conforming to POSIX.1\(hy2008, the value shall be 200809L.
  38. .IP _POSIX2_VERSION 6
  39. .br
  40. Integer value indicating version of the Shell and Utilities volume of POSIX.1 to which the implementation
  41. conforms. For implementations conforming to POSIX.1\(hy2008, the value shall
  42. be 200809L. For profile implementations that define _POSIX_SUBPROFILE
  43. (see
  44. .IR "Section 2.1.5.1" ", " "Subprofiling Considerations")
  45. in
  46. .IR <unistd.h> ,
  47. _POSIX2_VERSION may be left undefined or be defined with the value \-1
  48. to indicate that the Shell and Utilities volume of POSIX.1 is not supported. In this case, a call to
  49. .IR sysconf(_SC_2_VERSION)
  50. shall return either 200809L or \-1 indicating that the Shell and Utilities volume of POSIX.1 is or is
  51. not, respectively, supported at runtime.
  52. .P
  53. The
  54. .IR <unistd.h>
  55. header shall define the following symbolic constant only if
  56. the implementation supports the XSI option; see
  57. .IR "Section 2.1.4" ", " "XSI Conformance".
  58. If defined, its value shall be suitable for use in
  59. .BR #if
  60. preprocessing directives.
  61. .IP _XOPEN_VERSION 6
  62. .br
  63. Integer value indicating version of the X/Open Portability Guide
  64. to which the implementation conforms. The value shall be 700.
  65. .SS "Constants for Options and Option Groups"
  66. .P
  67. The following symbolic constants, if defined in
  68. .IR <unistd.h> ,
  69. shall have a value of \-1, 0, or greater, unless otherwise specified
  70. below. For profile implementations that define _POSIX_SUBPROFILE (see
  71. .IR "Section 2.1.5.1" ", " "Subprofiling Considerations")
  72. in
  73. .IR <unistd.h> ,
  74. constants described below as always having a value greater than zero need
  75. not be defined and, if defined, may have a value of \-1, 0, or greater.
  76. The values shall be suitable for use in
  77. .BR #if
  78. preprocessing directives.
  79. .P
  80. If a symbolic constant is not defined or is defined with the value
  81. \-1, the option is not supported for compilation. If it is defined
  82. with a value greater than zero, the option shall always be supported
  83. when the application is executed. If it is defined with the value zero,
  84. the option shall be supported for compilation and might or might not be
  85. supported at runtime. See
  86. .IR "Section 2.1.6" ", " "Options"
  87. for further information about the conformance requirements of these
  88. three categories of support.
  89. .IP _POSIX_ADVISORY_INFO 6
  90. .br
  91. The implementation supports the Advisory Information option.
  92. If this symbol is defined in
  93. .IR <unistd.h> ,
  94. it shall be defined to be \-1, 0, or 200809L. The value of this
  95. symbol reported by
  96. \fIsysconf\fR()
  97. shall either be \-1 or 200809L.
  98. .IP _POSIX_ASYNCHRONOUS_IO 6
  99. .br
  100. The implementation supports asynchronous input and output.
  101. This symbol shall always be set to the value 200809L.
  102. .IP _POSIX_BARRIERS 6
  103. .br
  104. The implementation supports barriers.
  105. This symbol shall always be set to the value 200809L.
  106. .IP _POSIX_CHOWN_RESTRICTED 6
  107. .br
  108. The use of
  109. \fIchown\fR()
  110. and
  111. \fIfchown\fR()
  112. is restricted to a process with appropriate privileges, and to changing
  113. the group ID of a file only to the effective group ID of the process or
  114. to one of its supplementary group IDs. This symbol shall be defined
  115. with a value other than \-1.
  116. .IP _POSIX_CLOCK_SELECTION 6
  117. .br
  118. The implementation supports clock selection.
  119. This symbol shall always be set to the value 200809L.
  120. .IP _POSIX_CPUTIME 6
  121. .br
  122. The implementation supports the Process CPU-Time Clocks option.
  123. If this symbol is defined in
  124. .IR <unistd.h> ,
  125. it shall be defined to be \-1, 0, or 200809L. The value of this
  126. symbol reported by
  127. \fIsysconf\fR()
  128. shall either be \-1 or 200809L.
  129. .IP _POSIX_FSYNC 6
  130. .br
  131. The implementation supports the File Synchronization option.
  132. If this symbol is defined in
  133. .IR <unistd.h> ,
  134. it shall be defined to be \-1, 0, or 200809L. The value of this
  135. symbol reported by
  136. \fIsysconf\fR()
  137. shall either be \-1 or 200809L.
  138. .IP _POSIX_IPV6 6
  139. .br
  140. The implementation supports the IPv6 option.
  141. If this symbol is defined in
  142. .IR <unistd.h> ,
  143. it shall be defined to be \-1, 0, or 200809L. The value of this
  144. symbol reported by
  145. \fIsysconf\fR()
  146. shall either be \-1 or 200809L.
  147. .IP _POSIX_JOB_CONTROL 6
  148. .br
  149. The implementation supports job control. This symbol shall always be
  150. set to a value greater than zero.
  151. .IP _POSIX_MAPPED_FILES 6
  152. .br
  153. The implementation supports memory mapped Files.
  154. This symbol shall always be set to the value 200809L.
  155. .IP _POSIX_MEMLOCK 6
  156. .br
  157. The implementation supports the Process Memory Locking option.
  158. If this symbol is defined in
  159. .IR <unistd.h> ,
  160. it shall be defined to be \-1, 0, or 200809L. The value of this
  161. symbol reported by
  162. \fIsysconf\fR()
  163. shall either be \-1 or 200809L.
  164. .IP _POSIX_MEMLOCK_RANGE 6
  165. .br
  166. The implementation supports the Range Memory Locking option.
  167. If this symbol is defined in
  168. .IR <unistd.h> ,
  169. it shall be defined to be \-1, 0, or 200809L. The value of this
  170. symbol reported by
  171. \fIsysconf\fR()
  172. shall either be \-1 or 200809L.
  173. .IP _POSIX_MEMORY_PROTECTION 6
  174. .br
  175. The implementation supports memory protection.
  176. This symbol shall always be set to the value 200809L.
  177. .IP _POSIX_MESSAGE_PASSING 6
  178. .br
  179. The implementation supports the Message Passing option.
  180. If this symbol is defined in
  181. .IR <unistd.h> ,
  182. it shall be defined to be \-1, 0, or 200809L. The value of this
  183. symbol reported by
  184. \fIsysconf\fR()
  185. shall either be \-1 or 200809L.
  186. .IP _POSIX_MONOTONIC_CLOCK 6
  187. .br
  188. The implementation supports the Monotonic Clock option.
  189. If this symbol is defined in
  190. .IR <unistd.h> ,
  191. it shall be defined to be \-1, 0, or 200809L. The value of this
  192. symbol reported by
  193. \fIsysconf\fR()
  194. shall either be \-1 or 200809L.
  195. .IP _POSIX_NO_TRUNC 6
  196. .br
  197. Pathname components longer than
  198. {NAME_MAX}
  199. generate an error. This symbol shall be defined with a value
  200. other than \-1.
  201. .IP _POSIX_PRIORITIZED_IO 6
  202. .br
  203. The implementation supports the Prioritized Input and Output option.
  204. If this symbol is defined in
  205. .IR <unistd.h> ,
  206. it shall be defined to be \-1, 0, or 200809L. The value of this
  207. symbol reported by
  208. \fIsysconf\fR()
  209. shall either be \-1 or 200809L.
  210. .IP _POSIX_PRIORITY_SCHEDULING 6
  211. .br
  212. The implementation supports the Process Scheduling option.
  213. If this symbol is defined in
  214. .IR <unistd.h> ,
  215. it shall be defined to be \-1, 0, or 200809L. The value of this
  216. symbol reported by
  217. \fIsysconf\fR()
  218. shall either be \-1 or 200809L.
  219. .IP _POSIX_RAW_SOCKETS 6
  220. .br
  221. The implementation supports the Raw Sockets option.
  222. If this symbol is defined in
  223. .IR <unistd.h> ,
  224. it shall be defined to be \-1, 0, or 200809L. The value of this
  225. symbol reported by
  226. \fIsysconf\fR()
  227. shall either be \-1 or 200809L.
  228. .IP _POSIX_READER_WRITER_LOCKS 6
  229. .br
  230. The implementation supports read-write locks.
  231. This symbol shall always be set to the value 200809L.
  232. .IP _POSIX_REALTIME_SIGNALS 6
  233. .br
  234. The implementation supports realtime signals.
  235. This symbol shall always be set to the value 200809L.
  236. .IP _POSIX_REGEXP 6
  237. .br
  238. The implementation supports the Regular Expression Handling option.
  239. This symbol shall always be set to a value greater than zero.
  240. .IP _POSIX_SAVED_IDS 6
  241. .br
  242. Each process has a saved set-user-ID and a saved set-group-ID.
  243. This symbol shall always be set to a value greater than zero.
  244. .IP _POSIX_SEMAPHORES 6
  245. .br
  246. The implementation supports semaphores.
  247. This symbol shall always be set to the value 200809L.
  248. .IP _POSIX_SHARED_MEMORY_OBJECTS 6
  249. .br
  250. The implementation supports the Shared Memory Objects option.
  251. If this symbol is defined in
  252. .IR <unistd.h> ,
  253. it shall be defined to be \-1, 0, or 200809L. The value of this
  254. symbol reported by
  255. \fIsysconf\fR()
  256. shall either be \-1 or 200809L.
  257. .IP _POSIX_SHELL 6
  258. .br
  259. The implementation supports the POSIX shell. This symbol shall always
  260. be set to a value greater than zero.
  261. .IP _POSIX_SPAWN 6
  262. .br
  263. The implementation supports the Spawn option.
  264. If this symbol is defined in
  265. .IR <unistd.h> ,
  266. it shall be defined to be \-1, 0, or 200809L. The value of this
  267. symbol reported by
  268. \fIsysconf\fR()
  269. shall either be \-1 or 200809L.
  270. .IP _POSIX_SPIN_LOCKS 6
  271. .br
  272. The implementation supports spin locks.
  273. This symbol shall always be set to the value 200809L.
  274. .IP _POSIX_SPORADIC_SERVER 6
  275. .br
  276. The implementation supports the Process Sporadic Server option.
  277. If this symbol is defined in
  278. .IR <unistd.h> ,
  279. it shall be defined to be \-1, 0, or 200809L. The value of this
  280. symbol reported by
  281. \fIsysconf\fR()
  282. shall either be \-1 or 200809L.
  283. .IP _POSIX_SYNCHRONIZED_IO 6
  284. .br
  285. The implementation supports the Synchronized Input and Output option.
  286. If this symbol is defined in
  287. .IR <unistd.h> ,
  288. it shall be defined to be \-1, 0, or 200809L. The value of this
  289. symbol reported by
  290. \fIsysconf\fR()
  291. shall either be \-1 or 200809L.
  292. .IP _POSIX_THREAD_ATTR_STACKADDR 6
  293. .br
  294. The implementation supports the Thread Stack Address Attribute option.
  295. If this symbol is defined in
  296. .IR <unistd.h> ,
  297. it shall be defined to be \-1, 0, or 200809L. The value of this
  298. symbol reported by
  299. \fIsysconf\fR()
  300. shall either be \-1 or 200809L.
  301. .IP _POSIX_THREAD_ATTR_STACKSIZE 6
  302. .br
  303. The implementation supports the Thread Stack Size Attribute option.
  304. If this symbol is defined in
  305. .IR <unistd.h> ,
  306. it shall be defined to be \-1, 0, or 200809L. The value of this
  307. symbol reported by
  308. \fIsysconf\fR()
  309. shall either be \-1 or 200809L.
  310. .IP _POSIX_THREAD_CPUTIME 6
  311. .br
  312. The implementation supports the Thread CPU-Time Clocks option.
  313. If this symbol is defined in
  314. .IR <unistd.h> ,
  315. it shall be defined to be \-1, 0, or 200809L. The value of this
  316. symbol reported by
  317. \fIsysconf\fR()
  318. shall either be \-1 or 200809L.
  319. .IP _POSIX_THREAD_PRIO_INHERIT 6
  320. .br
  321. The implementation supports the Non-Robust Mutex Priority
  322. Inheritance option. If this symbol is defined in
  323. .IR <unistd.h> ,
  324. it shall be defined to be \-1, 0, or 200809L. The value of this
  325. symbol reported by
  326. \fIsysconf\fR()
  327. shall either be \-1 or 200809L.
  328. .IP _POSIX_THREAD_PRIO_PROTECT 6
  329. .br
  330. The implementation supports the Non-Robust Mutex Priority
  331. Protection option. If this symbol is defined in
  332. .IR <unistd.h> ,
  333. it shall be defined to be \-1, 0, or 200809L. The value of this
  334. symbol reported by
  335. \fIsysconf\fR()
  336. shall either be \-1 or 200809L.
  337. .IP _POSIX_THREAD_PRIORITY_SCHEDULING 6
  338. .br
  339. The implementation supports the Thread Execution Scheduling option.
  340. If this symbol is defined in
  341. .IR <unistd.h> ,
  342. it shall be defined to be \-1, 0, or 200809L. The value of this
  343. symbol reported by
  344. \fIsysconf\fR()
  345. shall either be \-1 or 200809L.
  346. .IP _POSIX_THREAD_PROCESS_SHARED 6
  347. .br
  348. The implementation supports the Thread Process-Shared Synchronization
  349. option.
  350. If this symbol is defined in
  351. .IR <unistd.h> ,
  352. it shall be defined to be \-1, 0, or 200809L. The value of this
  353. symbol reported by
  354. \fIsysconf\fR()
  355. shall either be \-1 or 200809L.
  356. .IP _POSIX_THREAD_ROBUST_PRIO_INHERIT 6
  357. .br
  358. The implementation supports the Robust Mutex Priority Inheritance
  359. option. If this symbol is defined in
  360. .IR <unistd.h> ,
  361. it shall be defined to be \-1, 0, or 200809L. The value of this
  362. symbol reported by
  363. \fIsysconf\fR()
  364. shall either be \-1 or 200809L.
  365. .IP _POSIX_THREAD_ROBUST_PRIO_PROTECT 6
  366. .br
  367. The implementation supports the Robust Mutex Priority Protection
  368. option. If this symbol is defined in
  369. .IR <unistd.h> ,
  370. it shall be defined to be \-1, 0, or 200809L. The value of this
  371. symbol reported by
  372. \fIsysconf\fR()
  373. shall either be \-1 or 200809L.
  374. .IP _POSIX_THREAD_SAFE_FUNCTIONS 6
  375. .br
  376. The implementation supports thread-safe functions.
  377. This symbol shall always be set to the value 200809L.
  378. .IP _POSIX_THREAD_SPORADIC_SERVER 6
  379. .br
  380. The implementation supports the Thread Sporadic Server option.
  381. If this symbol is defined in
  382. .IR <unistd.h> ,
  383. it shall be defined to be \-1, 0, or 200809L. The value of this
  384. symbol reported by
  385. \fIsysconf\fR()
  386. shall either be \-1 or 200809L.
  387. .IP _POSIX_THREADS 6
  388. .br
  389. The implementation supports threads.
  390. This symbol shall always be set to the value 200809L.
  391. .IP _POSIX_TIMEOUTS 6
  392. .br
  393. The implementation supports timeouts.
  394. This symbol shall always be set to the value 200809L.
  395. .IP _POSIX_TIMERS 6
  396. .br
  397. The implementation supports timers.
  398. This symbol shall always be set to the value 200809L.
  399. .IP _POSIX_TRACE 6
  400. .br
  401. The implementation supports the Trace option.
  402. If this symbol is defined in
  403. .IR <unistd.h> ,
  404. it shall be defined to be \-1, 0, or 200809L. The value of this
  405. symbol reported by
  406. \fIsysconf\fR()
  407. shall either be \-1 or 200809L.
  408. .IP _POSIX_TRACE_EVENT_FILTER 6
  409. .br
  410. The implementation supports the Trace Event Filter option.
  411. If this symbol is defined in
  412. .IR <unistd.h> ,
  413. it shall be defined to be \-1, 0, or 200809L. The value of this
  414. symbol reported by
  415. \fIsysconf\fR()
  416. shall either be \-1 or 200809L.
  417. .IP _POSIX_TRACE_INHERIT 6
  418. .br
  419. The implementation supports the Trace Inherit option.
  420. If this symbol is defined in
  421. .IR <unistd.h> ,
  422. it shall be defined to be \-1, 0, or 200809L. The value of this
  423. symbol reported by
  424. \fIsysconf\fR()
  425. shall either be \-1 or 200809L.
  426. .IP _POSIX_TRACE_LOG 6
  427. .br
  428. The implementation supports the Trace Log option.
  429. If this symbol is defined in
  430. .IR <unistd.h> ,
  431. it shall be defined to be \-1, 0, or 200809L. The value of this
  432. symbol reported by
  433. \fIsysconf\fR()
  434. shall either be \-1 or 200809L.
  435. .IP _POSIX_TYPED_MEMORY_OBJECTS 6
  436. .br
  437. The implementation supports the Typed Memory Objects option.
  438. If this symbol is defined in
  439. .IR <unistd.h> ,
  440. it shall be defined to be \-1, 0, or 200809L. The value of this
  441. symbol reported by
  442. \fIsysconf\fR()
  443. shall either be \-1 or 200809L.
  444. .IP _POSIX_V6_ILP32_OFF32 6
  445. .br
  446. The implementation provides a C-language compilation environment with
  447. 32-bit
  448. .BR int ,
  449. .BR long ,
  450. .BR pointer ,
  451. and
  452. .BR off_t
  453. types.
  454. .IP _POSIX_V6_ILP32_OFFBIG 6
  455. .br
  456. The implementation provides a C-language compilation environment with
  457. 32-bit
  458. .BR int ,
  459. .BR long ,
  460. and
  461. .BR pointer
  462. types and an
  463. .BR off_t
  464. type using at least 64 bits.
  465. .IP _POSIX_V6_LP64_OFF64 6
  466. .br
  467. The implementation provides a C-language compilation environment with
  468. 32-bit
  469. .BR int
  470. and 64-bit
  471. .BR long ,
  472. .BR pointer ,
  473. and
  474. .BR off_t
  475. types.
  476. .IP _POSIX_V6_LPBIG_OFFBIG 6
  477. .br
  478. The implementation provides a C-language compilation environment with
  479. an
  480. .BR int
  481. type using at least 32 bits and
  482. .BR long ,
  483. .BR pointer ,
  484. and
  485. .BR off_t
  486. types using at least 64 bits.
  487. .IP _POSIX_V7_ILP32_OFF32 6
  488. .br
  489. The implementation provides a C-language compilation environment with
  490. 32-bit
  491. .BR int ,
  492. .BR long ,
  493. .BR pointer ,
  494. and
  495. .BR off_t
  496. types.
  497. .IP _POSIX_V7_ILP32_OFFBIG 6
  498. .br
  499. The implementation provides a C-language compilation environment with
  500. 32-bit
  501. .BR int ,
  502. .BR long ,
  503. and
  504. .BR pointer
  505. types and an
  506. .BR off_t
  507. type using at least 64 bits.
  508. .IP _POSIX_V7_LP64_OFF64 6
  509. .br
  510. The implementation provides a C-language compilation environment with
  511. 32-bit
  512. .BR int
  513. and 64-bit
  514. .BR long ,
  515. .BR pointer ,
  516. and
  517. .BR off_t
  518. types.
  519. .IP _POSIX_V7_LPBIG_OFFBIG 6
  520. .br
  521. The implementation provides a C-language compilation environment with
  522. an
  523. .BR int
  524. type using at least 32 bits and
  525. .BR long ,
  526. .BR pointer ,
  527. and
  528. .BR off_t
  529. types using at least 64 bits.
  530. .IP _POSIX2_C_BIND 6
  531. .br
  532. The implementation supports the C-Language Binding option. This
  533. symbol shall always have the value 200809L.
  534. .IP _POSIX2_C_DEV 6
  535. .br
  536. The implementation supports the C-Language Development Utilities option.
  537. If this symbol is defined in
  538. .IR <unistd.h> ,
  539. it shall be defined to be \-1, 0, or 200809L. The value of this
  540. symbol reported by
  541. \fIsysconf\fR()
  542. shall either be \-1 or 200809L.
  543. .IP _POSIX2_CHAR_TERM 6
  544. .br
  545. The implementation supports the Terminal Characteristics option.
  546. The value of this symbol reported by
  547. \fIsysconf\fR()
  548. shall either be \-1 or a value greater than zero.
  549. .IP _POSIX2_FORT_DEV 6
  550. .br
  551. The implementation supports the FORTRAN Development Utilities option.
  552. If this symbol is defined in
  553. .IR <unistd.h> ,
  554. it shall be defined to be \-1, 0, or 200809L. The value of this
  555. symbol reported by
  556. \fIsysconf\fR()
  557. shall either be \-1 or 200809L.
  558. .IP _POSIX2_FORT_RUN 6
  559. .br
  560. The implementation supports the FORTRAN Runtime Utilities option.
  561. If this symbol is defined in
  562. .IR <unistd.h> ,
  563. it shall be defined to be \-1, 0, or 200809L. The value of this
  564. symbol reported by
  565. \fIsysconf\fR()
  566. shall either be \-1 or 200809L.
  567. .IP _POSIX2_LOCALEDEF 6
  568. .br
  569. The implementation supports the creation of locales by the
  570. .IR localedef
  571. utility.
  572. If this symbol is defined in
  573. .IR <unistd.h> ,
  574. it shall be defined to be \-1, 0, or 200809L. The value of this
  575. symbol reported by
  576. \fIsysconf\fR()
  577. shall either be \-1 or 200809L.
  578. .IP _POSIX2_PBS 6
  579. .br
  580. The implementation supports the Batch Environment Services and
  581. Utilities option.
  582. If this symbol is defined in
  583. .IR <unistd.h> ,
  584. it shall be defined to be \-1, 0, or 200809L. The value of this
  585. symbol reported by
  586. \fIsysconf\fR()
  587. shall either be \-1 or 200809L.
  588. .IP _POSIX2_PBS_ACCOUNTING 6
  589. .br
  590. The implementation supports the Batch Accounting option.
  591. If this symbol is defined in
  592. .IR <unistd.h> ,
  593. it shall be defined to be \-1, 0, or 200809L. The value of this
  594. symbol reported by
  595. \fIsysconf\fR()
  596. shall either be \-1 or 200809L.
  597. .IP _POSIX2_PBS_CHECKPOINT 6
  598. .br
  599. The implementation supports the Batch Checkpoint/Restart option.
  600. If this symbol is defined in
  601. .IR <unistd.h> ,
  602. it shall be defined to be \-1, 0, or 200809L. The value of this
  603. symbol reported by
  604. \fIsysconf\fR()
  605. shall either be \-1 or 200809L.
  606. .IP _POSIX2_PBS_LOCATE 6
  607. .br
  608. The implementation supports the Locate Batch Job Request option.
  609. If this symbol is defined in
  610. .IR <unistd.h> ,
  611. it shall be defined to be \-1, 0, or 200809L. The value of this
  612. symbol reported by
  613. \fIsysconf\fR()
  614. shall either be \-1 or 200809L.
  615. .IP _POSIX2_PBS_MESSAGE 6
  616. .br
  617. The implementation supports the Batch Job Message Request option.
  618. If this symbol is defined in
  619. .IR <unistd.h> ,
  620. it shall be defined to be \-1, 0, or 200809L. The value of this
  621. symbol reported by
  622. \fIsysconf\fR()
  623. shall either be \-1 or 200809L.
  624. .IP _POSIX2_PBS_TRACK 6
  625. .br
  626. The implementation supports the Track Batch Job Request option.
  627. If this symbol is defined in
  628. .IR <unistd.h> ,
  629. it shall be defined to be \-1, 0, or 200809L. The value of this
  630. symbol reported by
  631. \fIsysconf\fR()
  632. shall either be \-1 or 200809L.
  633. .IP _POSIX2_SW_DEV 6
  634. .br
  635. The implementation supports the Software Development Utilities option.
  636. If this symbol is defined in
  637. .IR <unistd.h> ,
  638. it shall be defined to be \-1, 0, or 200809L. The value of this
  639. symbol reported by
  640. \fIsysconf\fR()
  641. shall either be \-1 or 200809L.
  642. .IP _POSIX2_UPE 6
  643. .br
  644. The implementation supports the User Portability Utilities option.
  645. If this symbol is defined in
  646. .IR <unistd.h> ,
  647. it shall be defined to be \-1, 0, or 200809L. The value of this
  648. symbol reported by
  649. \fIsysconf\fR()
  650. shall either be \-1 or 200809L.
  651. .IP _XOPEN_CRYPT 6
  652. .br
  653. The implementation supports the X/Open Encryption Option Group.
  654. .IP _XOPEN_ENH_I18N 6
  655. .br
  656. The implementation supports the Issue 4, Version 2 Enhanced
  657. Internationalization Option Group. This symbol shall always be set
  658. to a value other than \-1.
  659. .IP _XOPEN_REALTIME 6
  660. .br
  661. The implementation supports the X/Open Realtime Option Group.
  662. .IP _XOPEN_REALTIME_THREADS 6
  663. .br
  664. The implementation supports the X/Open Realtime Threads Option Group.
  665. .IP _XOPEN_SHM 6
  666. .br
  667. The implementation supports the Issue 4, Version 2 Shared Memory Option
  668. Group. This symbol shall always be set to a value other than \-1.
  669. .IP _XOPEN_STREAMS 6
  670. .br
  671. The implementation supports the XSI STREAMS Option Group.
  672. .IP _XOPEN_UNIX 6
  673. .br
  674. The implementation supports the XSI option.
  675. .IP _XOPEN_UUCP 6
  676. .br
  677. The implementation supports the UUCP Utilities option. If this symbol
  678. is defined in
  679. .IR <unistd.h> ,
  680. it shall be defined to be \-1, 0, or 200809L. The value of this symbol
  681. reported by
  682. \fIsysconf\fR()
  683. shall be either \-1 or 200809L.
  684. .SS "Execution-Time Symbolic Constants"
  685. .P
  686. If any of the following symbolic constants are not defined in the
  687. .IR <unistd.h>
  688. header, the value shall vary depending on the file to which it
  689. is applied. If defined, they shall have values suitable for use in
  690. .BR #if
  691. preprocessing directives.
  692. .P
  693. If any of the following symbolic constants are defined to have value
  694. \-1 in the
  695. .IR <unistd.h>
  696. header, the implementation shall not provide the option on any file; if
  697. any are defined to have a value other than \-1 in the
  698. .IR <unistd.h>
  699. header, the implementation shall provide the option on all applicable
  700. files.
  701. .P
  702. All of the following values, whether defined as symbolic constants in
  703. .IR <unistd.h>
  704. or not, may be queried with respect to a specific file using the
  705. \fIpathconf\fR()
  706. or
  707. \fIfpathconf\fR()
  708. functions:
  709. .IP _POSIX_ASYNC_IO 6
  710. .br
  711. Asynchronous input or output operations may be performed for the
  712. associated file.
  713. .IP _POSIX_PRIO_IO 6
  714. .br
  715. Prioritized input or output operations may be performed for the
  716. associated file.
  717. .IP _POSIX_SYNC_IO 6
  718. .br
  719. Synchronized input or output operations may be performed for the
  720. associated file.
  721. .P
  722. If the following symbolic constants are defined in the
  723. .IR <unistd.h>
  724. header, they apply to files and all paths in all file systems on
  725. the implementation:
  726. .IP _POSIX_TIMESTAMP_RESOLUTION 6
  727. .br
  728. The resolution in nanoseconds for all file timestamps.
  729. .IP _POSIX2_SYMLINKS 6
  730. .br
  731. Symbolic links can be created.
  732. .SS "Constants for Functions"
  733. .P
  734. The
  735. .IR <unistd.h>
  736. header shall define NULL as described in
  737. .IR <stddef.h> .
  738. .P
  739. The
  740. .IR <unistd.h>
  741. header shall define the following symbolic constants for use with the
  742. \fIaccess\fR()
  743. function. The values shall be suitable for use in
  744. .BR #if
  745. preprocessing directives.
  746. .IP F_OK 12
  747. Test for existence of file.
  748. .IP R_OK 12
  749. Test for read permission.
  750. .IP W_OK 12
  751. Test for write permission.
  752. .IP X_OK 12
  753. Test for execute (search) permission.
  754. .P
  755. The constants F_OK, R_OK, W_OK, and X_OK and the expressions
  756. \fIR_OK\fP|\fIW_OK\fP, \fIR_OK\fP|\fIX_OK\fP, and
  757. \fIR_OK\fP|\fIW_OK\fP|\fIX_OK\fP shall all have distinct values.
  758. .P
  759. The
  760. .IR <unistd.h>
  761. header shall define the following symbolic constants for the
  762. \fIconfstr\fR()
  763. function:
  764. .IP _CS_PATH 6
  765. .br
  766. This is the value for the
  767. .IR PATH
  768. environment variable that finds all of the standard utilities that are
  769. provided in a manner accessible via the
  770. .IR exec
  771. family of functions.
  772. .IP _CS_POSIX_V7_ILP32_OFF32_CFLAGS 6
  773. .br
  774. If \fIsysconf\fP(_SC_V7_ILP32_OFF32) returns \-1, the meaning of
  775. this value is unspecified. Otherwise, this value is the set of initial
  776. options to be given to the
  777. .IR c99
  778. utility to build an application using a programming model with 32-bit
  779. .BR int ,
  780. .BR long ,
  781. .BR pointer ,
  782. and
  783. .BR off_t
  784. types.
  785. .IP _CS_POSIX_V7_ILP32_OFF32_LDFLAGS 6
  786. .br
  787. If \fIsysconf\fP(_SC_V7_ILP32_OFF32) returns \-1, the meaning of
  788. this value is unspecified. Otherwise, this value is the set of final
  789. options to be given to the
  790. .IR c99
  791. utility to build an application using a programming model with 32-bit
  792. .BR int ,
  793. .BR long ,
  794. .BR pointer ,
  795. and
  796. .BR off_t
  797. types.
  798. .IP _CS_POSIX_V7_ILP32_OFF32_LIBS 6
  799. .br
  800. If \fIsysconf\fP(_SC_V7_ILP32_OFF32) returns \-1, the meaning of
  801. this value is unspecified. Otherwise, this value is the set of
  802. libraries to be given to the
  803. .IR c99
  804. utility to build an application using a programming model with 32-bit
  805. .BR int ,
  806. .BR long ,
  807. .BR pointer ,
  808. and
  809. .BR off_t
  810. types.
  811. .IP _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS 6
  812. .br
  813. If \fIsysconf\fP(_SC_V7_ILP32_OFFBIG) returns \-1, the meaning of
  814. this value is unspecified. Otherwise, this value is the set of initial
  815. options to be given to the
  816. .IR c99
  817. utility to build an application using a programming model with 32-bit
  818. .BR int ,
  819. .BR long ,
  820. and
  821. .BR pointer
  822. types, and an
  823. .BR off_t
  824. type using at least 64 bits.
  825. .IP _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS 6
  826. .br
  827. If \fIsysconf\fP(_SC_V7_ILP32_OFFBIG) returns \-1, the meaning of
  828. this value is unspecified. Otherwise, this value is the set of final
  829. options to be given to the
  830. .IR c99
  831. utility to build an application using a programming model with 32-bit
  832. .BR int ,
  833. .BR long ,
  834. and
  835. .BR pointer
  836. types, and an
  837. .BR off_t
  838. type using at least 64 bits.
  839. .IP _CS_POSIX_V7_ILP32_OFFBIG_LIBS 6
  840. .br
  841. If \fIsysconf\fP(_SC_V7_ILP32_OFFBIG) returns \-1, the meaning of
  842. this value is unspecified. Otherwise, this value is the set of
  843. libraries to be given to the
  844. .IR c99
  845. utility to build an application using a programming model with 32-bit
  846. .BR int ,
  847. .BR long ,
  848. and
  849. .BR pointer
  850. types, and an
  851. .BR off_t
  852. type using at least 64 bits.
  853. .IP _CS_POSIX_V7_LP64_OFF64_CFLAGS 6
  854. .br
  855. If \fIsysconf\fP(_SC_V7_LP64_OFF64) returns \-1, the meaning of
  856. this value is unspecified. Otherwise, this value is the set of initial
  857. options to be given to the
  858. .IR c99
  859. utility to build an application using a programming model with 32-bit
  860. .BR int
  861. and 64-bit
  862. .BR long ,
  863. .BR pointer ,
  864. and
  865. .BR off_t
  866. types.
  867. .IP _CS_POSIX_V7_LP64_OFF64_LDFLAGS 6
  868. .br
  869. If \fIsysconf\fP(_SC_V7_LP64_OFF64) returns \-1, the meaning of
  870. this value is unspecified. Otherwise, this value is the set of final
  871. options to be given to the
  872. .IR c99
  873. utility to build an application using a programming model with 32-bit
  874. .BR int
  875. and 64-bit
  876. .BR long ,
  877. .BR pointer ,
  878. and
  879. .BR off_t
  880. types.
  881. .IP _CS_POSIX_V7_LP64_OFF64_LIBS 6
  882. .br
  883. If \fIsysconf\fP(_SC_V7_LP64_OFF64) returns \-1, the meaning of
  884. this value is unspecified. Otherwise, this value is the set of
  885. libraries to be given to the
  886. .IR c99
  887. utility to build an application using a programming model with 32-bit
  888. .BR int
  889. and 64-bit
  890. .BR long ,
  891. .BR pointer ,
  892. and
  893. .BR off_t
  894. types.
  895. .IP _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS 6
  896. .br
  897. If \fIsysconf\fP(_SC_V7_LPBIG_OFFBIG) returns \-1, the meaning of
  898. this value is unspecified. Otherwise, this value is the set of initial
  899. options to be given to the
  900. .IR c99
  901. utility to build an application using a programming model with an
  902. .BR int
  903. type using at least 32 bits and
  904. .BR long ,
  905. .BR pointer ,
  906. and
  907. .BR off_t
  908. types using at least 64 bits.
  909. .IP _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS 6
  910. .br
  911. If \fIsysconf\fP(_SC_V7_LPBIG_OFFBIG) returns \-1, the meaning of
  912. this value is unspecified. Otherwise, this value is the set of final
  913. options to be given to the
  914. .IR c99
  915. utility to build an application using a programming model with an
  916. .BR int
  917. type using at least 32 bits and
  918. .BR long ,
  919. .BR pointer ,
  920. and
  921. .BR off_t
  922. types using at least 64 bits.
  923. .IP _CS_POSIX_V7_LPBIG_OFFBIG_LIBS 6
  924. .br
  925. If \fIsysconf\fP(_SC_V7_LPBIG_OFFBIG) returns \-1, the meaning of
  926. this value is unspecified. Otherwise, this value is the set of
  927. libraries to be given to the
  928. .IR c99
  929. utility to build an application using a programming model with an
  930. .BR int
  931. type using at least 32 bits and
  932. .BR long ,
  933. .BR pointer ,
  934. and
  935. .BR off_t
  936. types using at least 64 bits.
  937. .IP _CS_POSIX_V7_THREADS_CFLAGS 6
  938. .br
  939. If
  940. .IR sysconf (_SC_POSIX_THREADS)
  941. returns \-1, the meaning of this value is unspecified. Otherwise,
  942. this value is the set of initial options to be given to the
  943. .IR c99
  944. utility to build a multi-threaded application. These flags are in addition
  945. to those associated with any of the other _CS_POSIX_V7_*_CFLAGS values
  946. used to specify particular type size programing environments.
  947. .IP _CS_POSIX_V7_THREADS_LDFLAGS 6
  948. .br
  949. If
  950. .IR sysconf (_SC_POSIX_THREADS)
  951. returns \-1, the meaning of this value is unspecified. Otherwise,
  952. this value is the set of final options to be given to the
  953. .IR c99
  954. utility to build a multi-threaded application. These flags are in addition
  955. to those associated with any of the other _CS_POSIX_V7_*_LDFLAGS values
  956. used to specify particular type size programing environments.
  957. .IP _CS_POSIX_V7_WIDTH_RESTRICTED_ENVS 6
  958. .br
  959. This value is a
  960. <newline>-separated
  961. list of names of programming environments supported by the
  962. implementation in which the widths of the
  963. .BR blksize_t ,
  964. .BR cc_t ,
  965. .BR mode_t ,
  966. .BR nfds_t ,
  967. .BR pid_t ,
  968. .BR ptrdiff_t ,
  969. .BR size_t ,
  970. .BR speed_t ,
  971. .BR ssize_t ,
  972. .BR suseconds_t ,
  973. .BR tcflag_t ,
  974. .BR wchar_t ,
  975. and
  976. .BR wint_t
  977. types are no greater than the width of type
  978. .BR long .
  979. The format of each name shall be suitable for use with the
  980. .IR getconf
  981. .BR \-v
  982. option.
  983. .IP _CS_V7_ENV 6
  984. .br
  985. This is the value that provides the environment variable information
  986. (other than that provided by _CS_PATH) that is required by the
  987. implementation to create a conforming environment, as described in the
  988. implementation's conformance documentation.
  989. .br
  990. .P
  991. The following symbolic constants are reserved for compatibility
  992. with Issue 6:
  993. .P
  994. .nf
  995. _CS_POSIX_V6_ILP32_OFF32_CFLAGS
  996. _CS_POSIX_V6_ILP32_OFF32_LDFLAGS
  997. _CS_POSIX_V6_ILP32_OFF32_LIBS
  998. _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS
  999. _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS
  1000. _CS_POSIX_V6_ILP32_OFFBIG_LIBS
  1001. _CS_POSIX_V6_LP64_OFF64_CFLAGS
  1002. _CS_POSIX_V6_LP64_OFF64_LDFLAGS
  1003. _CS_POSIX_V6_LP64_OFF64_LIBS
  1004. _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS
  1005. _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS
  1006. _CS_POSIX_V6_LPBIG_OFFBIG_LIBS
  1007. _CS_POSIX_V6_WIDTH_RESTRICTED_ENVS
  1008. _CS_V6_ENV
  1009. .fi
  1010. .P
  1011. The
  1012. .IR <unistd.h>
  1013. header shall define SEEK_CUR, SEEK_END, and SEEK_SET as described in
  1014. .IR <stdio.h> .
  1015. .P
  1016. The
  1017. .IR <unistd.h>
  1018. header shall define the following symbolic constants as possible
  1019. values for the
  1020. .IR function
  1021. argument to the
  1022. \fIlockf\fR()
  1023. function:
  1024. .IP F_LOCK 12
  1025. Lock a section for exclusive use.
  1026. .IP F_TEST 12
  1027. Test section for locks by other processes.
  1028. .IP F_TLOCK 12
  1029. Test and lock a section for exclusive use.
  1030. .IP F_ULOCK 12
  1031. Unlock locked sections.
  1032. .P
  1033. The
  1034. .IR <unistd.h>
  1035. header shall define the following symbolic constants for
  1036. \fIpathconf\fR():
  1037. .P
  1038. .nf
  1039. _PC_2_SYMLINKS
  1040. _PC_ALLOC_SIZE_MIN
  1041. _PC_ASYNC_IO
  1042. _PC_CHOWN_RESTRICTED
  1043. _PC_FILESIZEBITS
  1044. _PC_LINK_MAX
  1045. _PC_MAX_CANON
  1046. _PC_MAX_INPUT
  1047. _PC_NAME_MAX
  1048. _PC_NO_TRUNC
  1049. _PC_PATH_MAX
  1050. _PC_PIPE_BUF
  1051. _PC_PRIO_IO
  1052. _PC_REC_INCR_XFER_SIZE
  1053. _PC_REC_MAX_XFER_SIZE
  1054. _PC_REC_MIN_XFER_SIZE
  1055. _PC_REC_XFER_ALIGN
  1056. _PC_SYMLINK_MAX
  1057. _PC_SYNC_IO
  1058. _PC_TIMESTAMP_RESOLUTION
  1059. _PC_VDISABLE
  1060. .fi
  1061. .P
  1062. The
  1063. .IR <unistd.h>
  1064. header shall define the following symbolic constants for
  1065. \fIsysconf\fR():
  1066. .P
  1067. .nf
  1068. _SC_2_C_BIND
  1069. _SC_2_C_DEV
  1070. _SC_2_CHAR_TERM
  1071. _SC_2_FORT_DEV
  1072. _SC_2_FORT_RUN
  1073. _SC_2_LOCALEDEF
  1074. _SC_2_PBS
  1075. _SC_2_PBS_ACCOUNTING
  1076. _SC_2_PBS_CHECKPOINT
  1077. _SC_2_PBS_LOCATE
  1078. _SC_2_PBS_MESSAGE
  1079. _SC_2_PBS_TRACK
  1080. _SC_2_SW_DEV
  1081. _SC_2_UPE
  1082. _SC_2_VERSION
  1083. _SC_ADVISORY_INFO
  1084. _SC_AIO_LISTIO_MAX
  1085. _SC_AIO_MAX
  1086. _SC_AIO_PRIO_DELTA_MAX
  1087. _SC_ARG_MAX
  1088. _SC_ASYNCHRONOUS_IO
  1089. _SC_ATEXIT_MAX
  1090. _SC_BARRIERS
  1091. _SC_BC_BASE_MAX
  1092. _SC_BC_DIM_MAX
  1093. _SC_BC_SCALE_MAX
  1094. _SC_BC_STRING_MAX
  1095. _SC_CHILD_MAX
  1096. _SC_CLK_TCK
  1097. _SC_CLOCK_SELECTION
  1098. _SC_COLL_WEIGHTS_MAX
  1099. _SC_CPUTIME
  1100. _SC_DELAYTIMER_MAX
  1101. _SC_EXPR_NEST_MAX
  1102. _SC_FSYNC
  1103. _SC_GETGR_R_SIZE_MAX
  1104. _SC_GETPW_R_SIZE_MAX
  1105. _SC_HOST_NAME_MAX
  1106. _SC_IOV_MAX
  1107. _SC_IPV6
  1108. _SC_JOB_CONTROL
  1109. _SC_LINE_MAX
  1110. _SC_LOGIN_NAME_MAX
  1111. _SC_MAPPED_FILES
  1112. _SC_MEMLOCK
  1113. _SC_MEMLOCK_RANGE
  1114. _SC_MEMORY_PROTECTION
  1115. _SC_MESSAGE_PASSING
  1116. _SC_MONOTONIC_CLOCK
  1117. _SC_MQ_OPEN_MAX
  1118. _SC_MQ_PRIO_MAX
  1119. _SC_NGROUPS_MAX
  1120. _SC_OPEN_MAX
  1121. _SC_PAGE_SIZE
  1122. _SC_PAGESIZE
  1123. _SC_PRIORITIZED_IO
  1124. _SC_PRIORITY_SCHEDULING
  1125. _SC_RAW_SOCKETS
  1126. _SC_RE_DUP_MAX
  1127. _SC_READER_WRITER_LOCKS
  1128. _SC_REALTIME_SIGNALS
  1129. _SC_REGEXP
  1130. _SC_RTSIG_MAX
  1131. _SC_SAVED_IDS
  1132. _SC_SEM_NSEMS_MAX
  1133. _SC_SEM_VALUE_MAX
  1134. _SC_SEMAPHORES
  1135. _SC_SHARED_MEMORY_OBJECTS
  1136. _SC_SHELL
  1137. _SC_SIGQUEUE_MAX
  1138. _SC_SPAWN
  1139. _SC_SPIN_LOCKS
  1140. _SC_SPORADIC_SERVER
  1141. _SC_SS_REPL_MAX
  1142. _SC_STREAM_MAX
  1143. _SC_SYMLOOP_MAX
  1144. _SC_SYNCHRONIZED_IO
  1145. _SC_THREAD_ATTR_STACKADDR
  1146. _SC_THREAD_ATTR_STACKSIZE
  1147. _SC_THREAD_CPUTIME
  1148. _SC_THREAD_DESTRUCTOR_ITERATIONS
  1149. _SC_THREAD_KEYS_MAX
  1150. _SC_THREAD_PRIO_INHERIT
  1151. _SC_THREAD_PRIO_PROTECT
  1152. _SC_THREAD_PRIORITY_SCHEDULING
  1153. _SC_THREAD_PROCESS_SHARED
  1154. _SC_THREAD_ROBUST_PRIO_INHERIT
  1155. _SC_THREAD_ROBUST_PRIO_PROTECT
  1156. _SC_THREAD_SAFE_FUNCTIONS
  1157. _SC_THREAD_SPORADIC_SERVER
  1158. _SC_THREAD_STACK_MIN
  1159. _SC_THREAD_THREADS_MAX
  1160. _SC_THREADS
  1161. _SC_TIMEOUTS
  1162. _SC_TIMER_MAX
  1163. _SC_TIMERS
  1164. _SC_TRACE
  1165. _SC_TRACE_EVENT_FILTER
  1166. _SC_TRACE_EVENT_NAME_MAX
  1167. _SC_TRACE_INHERIT
  1168. _SC_TRACE_LOG
  1169. _SC_TRACE_NAME_MAX
  1170. _SC_TRACE_SYS_MAX
  1171. _SC_TRACE_USER_EVENT_MAX
  1172. _SC_TTY_NAME_MAX
  1173. _SC_TYPED_MEMORY_OBJECTS
  1174. _SC_TZNAME_MAX
  1175. _SC_V7_ILP32_OFF32
  1176. _SC_V7_ILP32_OFFBIG
  1177. _SC_V7_LP64_OFF64
  1178. _SC_V7_LPBIG_OFFBIG
  1179. _SC_V6_ILP32_OFF32
  1180. _SC_V6_ILP32_OFFBIG
  1181. _SC_V6_LP64_OFF64
  1182. _SC_V6_LPBIG_OFFBIG
  1183. _SC_VERSION
  1184. _SC_XOPEN_CRYPT
  1185. _SC_XOPEN_ENH_I18N
  1186. _SC_XOPEN_REALTIME
  1187. _SC_XOPEN_REALTIME_THREADS
  1188. _SC_XOPEN_SHM
  1189. _SC_XOPEN_STREAMS
  1190. _SC_XOPEN_UNIX
  1191. _SC_XOPEN_UUCP
  1192. _SC_XOPEN_VERSION
  1193. .fi
  1194. .P
  1195. The two constants _SC_PAGESIZE and _SC_PAGE_SIZE may be defined to
  1196. have the same value.
  1197. .P
  1198. The
  1199. .IR <unistd.h>
  1200. header shall define the following symbolic constants for file streams:
  1201. .IP STDERR_FILENO 14
  1202. File number of
  1203. .IR stderr ;
  1204. 2.
  1205. .IP STDIN_FILENO 14
  1206. File number of
  1207. .IR stdin ;
  1208. 0.
  1209. .IP STDOUT_FILENO 14
  1210. File number of
  1211. .IR stdout ;
  1212. 1.
  1213. .P
  1214. The
  1215. .IR <unistd.h>
  1216. header shall define the following symbolic constant for terminal
  1217. special character handling:
  1218. .IP _POSIX_VDISABLE 14
  1219. This symbol shall be defined to be the value of a character that shall
  1220. disable terminal special character handling as described in
  1221. .IR "Section 11.2.6" ", " "Special Control Characters".
  1222. This symbol shall always be set to a value other than \-1.
  1223. .SS "Type Definitions"
  1224. .P
  1225. The
  1226. .IR <unistd.h>
  1227. header shall define the
  1228. .BR size_t ,
  1229. .BR ssize_t ,
  1230. .BR uid_t ,
  1231. .BR gid_t ,
  1232. .BR off_t ,
  1233. and
  1234. .BR pid_t
  1235. types as described in
  1236. .IR <sys/types.h> .
  1237. .P
  1238. The
  1239. .IR <unistd.h>
  1240. header shall define the
  1241. .BR intptr_t
  1242. type as described in
  1243. .IR <stdint.h> .
  1244. .SS "Declarations"
  1245. .P
  1246. The following shall be declared as functions and may also be defined
  1247. as macros. Function prototypes shall be provided.
  1248. .sp
  1249. .RS 4
  1250. .nf
  1251. int access(const char *, int);
  1252. unsigned alarm(unsigned);
  1253. int chdir(const char *);
  1254. int chown(const char *, uid_t, gid_t);
  1255. int close(int);
  1256. size_t confstr(int, char *, size_t);
  1257. char *crypt(const char *, const char *);
  1258. int dup(int);
  1259. .br
  1260. int dup2(int, int);
  1261. void _exit(int);
  1262. void encrypt(char [64], int);
  1263. int execl(const char *, const char *, ...);
  1264. int execle(const char *, const char *, ...);
  1265. int execlp(const char *, const char *, ...);
  1266. int execv(const char *, char *const []);
  1267. int execve(const char *, char *const [], char *const []);
  1268. int execvp(const char *, char *const []);
  1269. int faccessat(int, const char *, int, int);
  1270. int fchdir(int);
  1271. int fchown(int, uid_t, gid_t);
  1272. int fchownat(int, const char *, uid_t, gid_t, int);
  1273. int fdatasync(int);
  1274. int fexecve(int, char *const [], char *const []);
  1275. pid_t fork(void);
  1276. long fpathconf(int, int);
  1277. int fsync(int);
  1278. int ftruncate(int, off_t);
  1279. char *getcwd(char *, size_t);
  1280. gid_t getegid(void);
  1281. uid_t geteuid(void);
  1282. gid_t getgid(void);
  1283. int getgroups(int, gid_t []);
  1284. long gethostid(void);
  1285. int gethostname(char *, size_t);
  1286. char *getlogin(void);
  1287. int getlogin_r(char *, size_t);
  1288. int getopt(int, char * const [], const char *);
  1289. pid_t getpgid(pid_t);
  1290. pid_t getpgrp(void);
  1291. pid_t getpid(void);
  1292. pid_t getppid(void);
  1293. pid_t getsid(pid_t);
  1294. uid_t getuid(void);
  1295. int isatty(int);
  1296. int lchown(const char *, uid_t, gid_t);
  1297. int link(const char *, const char *);
  1298. int linkat(int, const char *, int, const char *, int);
  1299. int lockf(int, int, off_t);
  1300. off_t lseek(int, off_t, int);
  1301. int nice(int);
  1302. long pathconf(const char *, int);
  1303. int pause(void);
  1304. int pipe(int [2]);
  1305. ssize_t pread(int, void *, size_t, off_t);
  1306. ssize_t pwrite(int, const void *, size_t, off_t);
  1307. ssize_t read(int, void *, size_t);
  1308. ssize_t readlink(const char *restrict, char *restrict, size_t);
  1309. ssize_t readlinkat(int, const char *restrict, char *restrict, size_t);
  1310. int rmdir(const char *);
  1311. int setegid(gid_t);
  1312. int seteuid(uid_t);
  1313. int setgid(gid_t);
  1314. .br
  1315. int setpgid(pid_t, pid_t);
  1316. pid_t setpgrp(void);
  1317. int setregid(gid_t, gid_t);
  1318. int setreuid(uid_t, uid_t);
  1319. pid_t setsid(void);
  1320. int setuid(uid_t);
  1321. unsigned sleep(unsigned);
  1322. void swab(const void *restrict, void *restrict, ssize_t);
  1323. int symlink(const char *, const char *);
  1324. int symlinkat(const char *, int, const char *);
  1325. void sync(void);
  1326. long sysconf(int);
  1327. pid_t tcgetpgrp(int);
  1328. int tcsetpgrp(int, pid_t);
  1329. int truncate(const char *, off_t);
  1330. char *ttyname(int);
  1331. int ttyname_r(int, char *, size_t);
  1332. int unlink(const char *);
  1333. int unlinkat(int, const char *, int);
  1334. ssize_t write(int, const void *, size_t);
  1335. .fi
  1336. .P
  1337. .RE
  1338. .P
  1339. Implementations may also include the
  1340. \fIpthread_atfork\fR()
  1341. prototype as defined in
  1342. .IR <pthread.h> .
  1343. Implementations may also include the
  1344. \fIctermid\fR()
  1345. prototype as defined in
  1346. .IR <stdio.h> .
  1347. .P
  1348. The
  1349. .IR <unistd.h>
  1350. header shall declare the following external variables:
  1351. .sp
  1352. .RS 4
  1353. .nf
  1354. extern char *optarg;
  1355. extern int opterr, optind, optopt;
  1356. .fi
  1357. .P
  1358. .RE
  1359. .P
  1360. Inclusion of the
  1361. .IR <unistd.h>
  1362. header may make visible all symbols from the headers
  1363. .IR <stddef.h> ,
  1364. .IR <stdint.h> ,
  1365. and
  1366. .IR <stdio.h> .
  1367. .LP
  1368. .IR "The following sections are informative."
  1369. .SH "APPLICATION USAGE"
  1370. POSIX.1\(hy2008 only describes the behavior of systems that claim conformance to
  1371. it. However, application developers who want to write applications that
  1372. adapt to other versions of this standard (or to systems that do not
  1373. conform to any POSIX standard) may find it useful to code them so as to
  1374. conditionally compile different code depending on the value of
  1375. _POSIX_VERSION, for example:
  1376. .sp
  1377. .RS 4
  1378. .nf
  1379. #if _POSIX_VERSION >= 200112L
  1380. /* Use the newer function that copes with large files. */
  1381. off_t pos=ftello(fp);
  1382. #else
  1383. /* Either this is an old version of POSIX, or _POSIX_VERSION is
  1384. not even defined, so use the traditional function. */
  1385. long pos=ftell(fp);
  1386. #endif
  1387. .fi
  1388. .P
  1389. .RE
  1390. .P
  1391. Earlier versions of POSIX.1\(hy2008 and of the Single UNIX Specification
  1392. can be identified by the following macros:
  1393. .IP "POSIX.1\(hy1988 standard" 6
  1394. .br
  1395. _POSIX_VERSION\|=\^=\|198808L
  1396. .IP "POSIX.1\(hy1990 standard" 6
  1397. .br
  1398. _POSIX_VERSION\|=\^=\|199009L
  1399. .IP "ISO\ POSIX\(hy1:\|1996 standard" 6
  1400. .br
  1401. _POSIX_VERSION\|=\^=\|199506L
  1402. .IP "Single UNIX Specification, Version 1" 6
  1403. .br
  1404. _XOPEN_UNIX and _XOPEN_VERSION\|=\^=\|4
  1405. .IP "Single UNIX Specification, Version 2" 6
  1406. .br
  1407. _XOPEN_UNIX and _XOPEN_VERSION\|=\^=\|500
  1408. .IP "ISO POSIX\(hy1:\|2001 and Single UNIX Specification, Version 3" 6
  1409. .br
  1410. _POSIX_VERSION\|=\^=\|200112L, plus (if the XSI option is supported)
  1411. _XOPEN_UNIX and _XOPEN_VERSION\|=\^=\|600
  1412. .P
  1413. POSIX.1\(hy2008 does not make any attempt to define application binary
  1414. interaction with the underlying operating system. However, application
  1415. developers may find it useful to query _SC_VERSION at runtime via
  1416. \fIsysconf\fR()
  1417. to determine whether the current version of the operating system
  1418. supports the necessary functionality as in the following program
  1419. fragment:
  1420. .sp
  1421. .RS 4
  1422. .nf
  1423. if (sysconf(_SC_VERSION) < 200809L) {
  1424. fprintf(stderr, "POSIX.1-2008 system required, terminating \en");
  1425. exit(1);
  1426. }
  1427. .fi
  1428. .P
  1429. .RE
  1430. .P
  1431. New applications should not use _XOPEN_SHM or _XOPEN_ENH_I18N.
  1432. .SH RATIONALE
  1433. As POSIX.1\(hy2008 evolved, certain options became sufficiently standardized that
  1434. it was concluded that simply requiring one of the option choices was
  1435. simpler than retaining the option. However, for backwards-compatibility,
  1436. the option flags (with required constant values) are retained.
  1437. .SS "Version Test Macros"
  1438. .P
  1439. The standard developers considered altering the definition of
  1440. _POSIX_VERSION and removing _SC_VERSION from the specification of
  1441. \fIsysconf\fR()
  1442. since the utility to an application was deemed by some to be minimal,
  1443. and since the implementation of the functionality is potentially
  1444. problematic. However, they recognized that support for existing
  1445. application binaries is a concern to manufacturers, application
  1446. developers, and the users of implementations conforming to POSIX.1\(hy2008.
  1447. .P
  1448. While the example using _SC_VERSION in the APPLICATION USAGE section
  1449. does not provide the greatest degree of imaginable utility to the
  1450. application developer or user, it is arguably better than a
  1451. .BR core
  1452. file or some other equally obscure result. (It is also possible for
  1453. implementations to encode and recognize application binaries compiled
  1454. in various POSIX.1-conforming environments, and modify the semantics of
  1455. the underlying system to conform to the expectations of the
  1456. application.) For the reasons outlined in the preceding paragraphs and
  1457. in the APPLICATION USAGE section, the standard developers elected to
  1458. retain the _POSIX_VERSION and _SC_VERSION functionality.
  1459. .SS "Compile-Time Symbolic Constants for System-Wide Options"
  1460. .P
  1461. POSIX.1\(hy2008 includes support in certain areas for the newly adopted
  1462. policy governing options and stubs.
  1463. .P
  1464. This policy provides flexibility for implementations in how they
  1465. support options. It also specifies how conforming applications can
  1466. adapt to different implementations that support different sets of
  1467. options. It allows the following:
  1468. .IP " 1." 4
  1469. If an implementation has no interest in supporting an option, it does
  1470. not have to provide anything associated with that option beyond the
  1471. announcement that it does not support it.
  1472. .IP " 2." 4
  1473. An implementation can support a partial or incompatible version of an
  1474. option (as a non-standard extension) as long as it does not claim to
  1475. support the option.
  1476. .IP " 3." 4
  1477. An application can determine whether the option is supported. A
  1478. strictly conforming application must check this announcement mechanism
  1479. before first using anything associated with the option.
  1480. .P
  1481. There is an important implication of this policy. POSIX.1\(hy2008 cannot
  1482. dictate the behavior of interfaces associated with an option when the
  1483. implementation does not claim to support the option. In particular, it
  1484. cannot require that a function associated with an unsupported option
  1485. will fail if it does not perform as specified. However, this policy
  1486. does not prevent a standard from requiring certain functions to always
  1487. be present, but that they shall always fail on some implementations.
  1488. The
  1489. \fIsetpgid\fR()
  1490. function in the POSIX.1\(hy1990 standard, for example, is considered appropriate.
  1491. .P
  1492. The POSIX standards include various options, and the C-language
  1493. binding support for an option implies that the implementation must
  1494. supply data types and function interfaces. An application must be able
  1495. to discover whether the implementation supports each option.
  1496. .P
  1497. Any application must consider the following three cases for each
  1498. option:
  1499. .IP " 1." 4
  1500. Option never supported.
  1501. .RS 4
  1502. .P
  1503. The implementation advertises at compile time that the option will
  1504. never be supported. In this case, it is not necessary for the
  1505. implementation to supply any of the data types or function interfaces
  1506. that are provided only as part of the option. The implementation might
  1507. provide data types and functions that are similar to those defined by
  1508. POSIX.1\(hy2008, but there is no guarantee for any particular behavior.
  1509. .RE
  1510. .IP " 2." 4
  1511. Option always supported.
  1512. .RS 4
  1513. .P
  1514. The implementation advertises at compile time that the option will
  1515. always be supported. In this case, all data types and function
  1516. interfaces shall be available and shall operate as specified.
  1517. .RE
  1518. .IP " 3." 4
  1519. Option might or might not be supported.
  1520. .RS 4
  1521. .P
  1522. Some implementations might not provide a mechanism to specify support
  1523. of options at compile time. In addition, the implementation might be
  1524. unable or unwilling to specify support or non-support at compile time.
  1525. In either case, any application that might use the option at runtime
  1526. must be able to compile and execute. The implementation must provide,
  1527. at compile time, all data types and function interfaces that are
  1528. necessary to allow this. In this situation, there must be a mechanism
  1529. that allows the application to query, at runtime, whether the option is
  1530. supported. If the application attempts to use the option when it is not
  1531. supported, the result is unspecified unless explicitly specified
  1532. otherwise in POSIX.1\(hy2008.
  1533. .RE
  1534. .SH "FUTURE DIRECTIONS"
  1535. None.
  1536. .SH "SEE ALSO"
  1537. .IR "\fB<limits.h>\fP",
  1538. .IR "\fB<stddef.h>\fP",
  1539. .IR "\fB<stdint.h>\fP",
  1540. .IR "\fB<stdio.h>\fP",
  1541. .IR "\fB<sys_socket.h>\fP",
  1542. .IR "\fB<sys_types.h>\fP",
  1543. .IR "\fB<termios.h>\fP",
  1544. .IR "\fB<wctype.h>\fP"
  1545. .P
  1546. .ad l
  1547. The System Interfaces volume of POSIX.1\(hy2017,
  1548. .IR "\fIaccess\fR\^(\|)",
  1549. .IR "\fIalarm\fR\^(\|)",
  1550. .IR "\fIchown\fR\^(\|)",
  1551. .IR "\fIclose\fR\^(\|)",
  1552. .IR "\fIconfstr\fR\^(\|)",
  1553. .IR "\fIcrypt\fR\^(\|)",
  1554. .IR "\fIctermid\fR\^(\|)",
  1555. .IR "\fIdup\fR\^(\|)",
  1556. .IR "\fI_Exit\fR\^(\|)",
  1557. .IR "\fIencrypt\fR\^(\|)",
  1558. .IR "\fIexec\fR\^",
  1559. .IR "\fIfchdir\fR\^(\|)",
  1560. .IR "\fIfchown\fR\^(\|)",
  1561. .IR "\fIfdatasync\fR\^(\|)",
  1562. .IR "\fIfork\fR\^(\|)",
  1563. .IR "\fIfpathconf\fR\^(\|)",
  1564. .IR "\fIfsync\fR\^(\|)",
  1565. .IR "\fIftruncate\fR\^(\|)",
  1566. .IR "\fIgetcwd\fR\^(\|)",
  1567. .IR "\fIgetegid\fR\^(\|)",
  1568. .IR "\fIgeteuid\fR\^(\|)",
  1569. .IR "\fIgetgid\fR\^(\|)",
  1570. .IR "\fIgetgroups\fR\^(\|)",
  1571. .IR "\fIgethostid\fR\^(\|)",
  1572. .IR "\fIgethostname\fR\^(\|)",
  1573. .IR "\fIgetlogin\fR\^(\|)",
  1574. .IR "\fIgetopt\fR\^(\|)",
  1575. .IR "\fIgetpgid\fR\^(\|)",
  1576. .IR "\fIgetpgrp\fR\^(\|)",
  1577. .IR "\fIgetpid\fR\^(\|)",
  1578. .IR "\fIgetppid\fR\^(\|)",
  1579. .IR "\fIgetsid\fR\^(\|)",
  1580. .IR "\fIgetuid\fR\^(\|)",
  1581. .IR "\fIisatty\fR\^(\|)",
  1582. .IR "\fIlchown\fR\^(\|)",
  1583. .IR "\fIlink\fR\^(\|)",
  1584. .IR "\fIlockf\fR\^(\|)",
  1585. .IR "\fIlseek\fR\^(\|)",
  1586. .IR "\fInice\fR\^(\|)",
  1587. .IR "\fIpause\fR\^(\|)",
  1588. .IR "\fIpipe\fR\^(\|)",
  1589. .IR "\fIread\fR\^(\|)",
  1590. .IR "\fIreadlink\fR\^(\|)",
  1591. .IR "\fIrmdir\fR\^(\|)",
  1592. .IR "\fIsetegid\fR\^(\|)",
  1593. .IR "\fIseteuid\fR\^(\|)",
  1594. .IR "\fIsetgid\fR\^(\|)",
  1595. .IR "\fIsetpgid\fR\^(\|)",
  1596. .IR "\fIsetpgrp\fR\^(\|)",
  1597. .IR "\fIsetregid\fR\^(\|)",
  1598. .IR "\fIsetreuid\fR\^(\|)",
  1599. .IR "\fIsetsid\fR\^(\|)",
  1600. .IR "\fIsetuid\fR\^(\|)",
  1601. .IR "\fIsleep\fR\^(\|)",
  1602. .IR "\fIswab\fR\^(\|)",
  1603. .IR "\fIsymlink\fR\^(\|)",
  1604. .IR "\fIsync\fR\^(\|)",
  1605. .IR "\fIsysconf\fR\^(\|)",
  1606. .IR "\fItcgetpgrp\fR\^(\|)",
  1607. .IR "\fItcsetpgrp\fR\^(\|)",
  1608. .IR "\fItruncate\fR\^(\|)",
  1609. .IR "\fIttyname\fR\^(\|)",
  1610. .IR "\fIunlink\fR\^(\|)",
  1611. .IR "\fIwrite\fR\^(\|)"
  1612. .ad b
  1613. .\"
  1614. .SH COPYRIGHT
  1615. Portions of this text are reprinted and reproduced in electronic form
  1616. from IEEE Std 1003.1-2017, Standard for Information Technology
  1617. -- Portable Operating System Interface (POSIX), The Open Group Base
  1618. Specifications Issue 7, 2018 Edition,
  1619. Copyright (C) 2018 by the Institute of
  1620. Electrical and Electronics Engineers, Inc and The Open Group.
  1621. In the event of any discrepancy between this version and the original IEEE and
  1622. The Open Group Standard, the original IEEE and The Open Group Standard
  1623. is the referee document. The original Standard can be obtained online at
  1624. http://www.opengroup.org/unix/online.html .
  1625. .PP
  1626. Any typographical or formatting errors that appear
  1627. in this page are most likely
  1628. to have been introduced during the conversion of the source files to
  1629. man page format. To report such errors, see
  1630. https://www.kernel.org/doc/man-pages/reporting_bugs.html .