PageRenderTime 56ms CodeModel.GetById 27ms RepoModel.GetById 1ms app.codeStats 0ms

/usr/src/uts/common/sys/unistd.h

https://github.com/illumos/illumos-gate
C Header | 418 lines | 288 code | 39 blank | 91 comment | 0 complexity | ff790b4d9cc673cabf45b08770097487 MD5 | raw file
  1. /*
  2. * CDDL HEADER START
  3. *
  4. * The contents of this file are subject to the terms of the
  5. * Common Development and Distribution License (the "License").
  6. * You may not use this file except in compliance with the License.
  7. *
  8. * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
  9. * or http://www.opensolaris.org/os/licensing.
  10. * See the License for the specific language governing permissions
  11. * and limitations under the License.
  12. *
  13. * When distributing Covered Code, include this CDDL HEADER in each
  14. * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15. * If applicable, add the following below this CDDL HEADER, with the
  16. * fields enclosed by brackets "[]" replaced with your own identifying
  17. * information: Portions Copyright [yyyy] [name of copyright owner]
  18. *
  19. * CDDL HEADER END
  20. */
  21. /*
  22. * Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T
  23. * All Rights Reserved
  24. *
  25. */
  26. /*
  27. * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
  28. * Use is subject to license terms.
  29. */
  30. /*
  31. * WARNING: This is an implementation-specific header,
  32. * its contents are not guaranteed. Applications
  33. * should include <unistd.h> and not this header.
  34. */
  35. #ifndef _SYS_UNISTD_H
  36. #define _SYS_UNISTD_H
  37. #include <sys/feature_tests.h>
  38. #ifdef __cplusplus
  39. extern "C" {
  40. #endif
  41. /* command names for confstr */
  42. #define _CS_PATH 65
  43. /*
  44. * command names for large file configuration information
  45. */
  46. /* large file compilation environment configuration */
  47. #define _CS_LFS_CFLAGS 68
  48. #define _CS_LFS_LDFLAGS 69
  49. #define _CS_LFS_LIBS 70
  50. #define _CS_LFS_LINTFLAGS 71
  51. /* transitional large file interface configuration */
  52. #define _CS_LFS64_CFLAGS 72
  53. #define _CS_LFS64_LDFLAGS 73
  54. #define _CS_LFS64_LIBS 74
  55. #define _CS_LFS64_LINTFLAGS 75
  56. /* UNIX 98 */
  57. #define _CS_XBS5_ILP32_OFF32_CFLAGS 700
  58. #define _CS_XBS5_ILP32_OFF32_LDFLAGS 701
  59. #define _CS_XBS5_ILP32_OFF32_LIBS 702
  60. #define _CS_XBS5_ILP32_OFF32_LINTFLAGS 703
  61. #define _CS_XBS5_ILP32_OFFBIG_CFLAGS 705
  62. #define _CS_XBS5_ILP32_OFFBIG_LDFLAGS 706
  63. #define _CS_XBS5_ILP32_OFFBIG_LIBS 707
  64. #define _CS_XBS5_ILP32_OFFBIG_LINTFLAGS 708
  65. #define _CS_XBS5_LP64_OFF64_CFLAGS 709
  66. #define _CS_XBS5_LP64_OFF64_LDFLAGS 710
  67. #define _CS_XBS5_LP64_OFF64_LIBS 711
  68. #define _CS_XBS5_LP64_OFF64_LINTFLAGS 712
  69. #define _CS_XBS5_LPBIG_OFFBIG_CFLAGS 713
  70. #define _CS_XBS5_LPBIG_OFFBIG_LDFLAGS 714
  71. #define _CS_XBS5_LPBIG_OFFBIG_LIBS 715
  72. #define _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS 716
  73. /* UNIX 03 */
  74. #define _CS_POSIX_V6_ILP32_OFF32_CFLAGS 800
  75. #define _CS_POSIX_V6_ILP32_OFF32_LDFLAGS 801
  76. #define _CS_POSIX_V6_ILP32_OFF32_LIBS 802
  77. #define _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS 803
  78. #define _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS 804
  79. #define _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS 805
  80. #define _CS_POSIX_V6_ILP32_OFFBIG_LIBS 806
  81. #define _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS 807
  82. #define _CS_POSIX_V6_LP64_OFF64_CFLAGS 808
  83. #define _CS_POSIX_V6_LP64_OFF64_LDFLAGS 809
  84. #define _CS_POSIX_V6_LP64_OFF64_LIBS 810
  85. #define _CS_POSIX_V6_LP64_OFF64_LINTFLAGS 811
  86. #define _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS 812
  87. #define _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS 813
  88. #define _CS_POSIX_V6_LPBIG_OFFBIG_LIBS 814
  89. #define _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS 815
  90. #define _CS_POSIX_V6_WIDTH_RESTRICTED_ENVS 816
  91. /* command names for POSIX sysconf */
  92. /* POSIX.1 names */
  93. #define _SC_ARG_MAX 1
  94. #define _SC_CHILD_MAX 2
  95. #define _SC_CLK_TCK 3
  96. #define _SC_NGROUPS_MAX 4
  97. #define _SC_OPEN_MAX 5
  98. #define _SC_JOB_CONTROL 6
  99. #define _SC_SAVED_IDS 7
  100. #define _SC_VERSION 8
  101. /* SVR4 names */
  102. #define _SC_PASS_MAX 9
  103. #define _SC_LOGNAME_MAX 10
  104. #define _SC_PAGESIZE 11
  105. #define _SC_XOPEN_VERSION 12
  106. /* 13 reserved for SVr4-ES/MP _SC_NACLS_MAX */
  107. #define _SC_NPROCESSORS_CONF 14
  108. #define _SC_NPROCESSORS_ONLN 15
  109. #define _SC_STREAM_MAX 16
  110. #define _SC_TZNAME_MAX 17
  111. /* POSIX.4 names */
  112. #define _SC_AIO_LISTIO_MAX 18
  113. #define _SC_AIO_MAX 19
  114. #define _SC_AIO_PRIO_DELTA_MAX 20
  115. #define _SC_ASYNCHRONOUS_IO 21
  116. #define _SC_DELAYTIMER_MAX 22
  117. #define _SC_FSYNC 23
  118. #define _SC_MAPPED_FILES 24
  119. #define _SC_MEMLOCK 25
  120. #define _SC_MEMLOCK_RANGE 26
  121. #define _SC_MEMORY_PROTECTION 27
  122. #define _SC_MESSAGE_PASSING 28
  123. #define _SC_MQ_OPEN_MAX 29
  124. #define _SC_MQ_PRIO_MAX 30
  125. #define _SC_PRIORITIZED_IO 31
  126. #define _SC_PRIORITY_SCHEDULING 32
  127. #define _SC_REALTIME_SIGNALS 33
  128. #define _SC_RTSIG_MAX 34
  129. #define _SC_SEMAPHORES 35
  130. #define _SC_SEM_NSEMS_MAX 36
  131. #define _SC_SEM_VALUE_MAX 37
  132. #define _SC_SHARED_MEMORY_OBJECTS 38
  133. #define _SC_SIGQUEUE_MAX 39
  134. #define _SC_SIGRT_MIN 40
  135. #define _SC_SIGRT_MAX 41
  136. #define _SC_SYNCHRONIZED_IO 42
  137. #define _SC_TIMERS 43
  138. #define _SC_TIMER_MAX 44
  139. /* XPG4 names */
  140. #define _SC_2_C_BIND 45
  141. #define _SC_2_C_DEV 46
  142. #define _SC_2_C_VERSION 47
  143. #define _SC_2_FORT_DEV 48
  144. #define _SC_2_FORT_RUN 49
  145. #define _SC_2_LOCALEDEF 50
  146. #define _SC_2_SW_DEV 51
  147. #define _SC_2_UPE 52
  148. #define _SC_2_VERSION 53
  149. #define _SC_BC_BASE_MAX 54
  150. #define _SC_BC_DIM_MAX 55
  151. #define _SC_BC_SCALE_MAX 56
  152. #define _SC_BC_STRING_MAX 57
  153. #define _SC_COLL_WEIGHTS_MAX 58
  154. #define _SC_EXPR_NEST_MAX 59
  155. #define _SC_LINE_MAX 60
  156. #define _SC_RE_DUP_MAX 61
  157. #define _SC_XOPEN_CRYPT 62
  158. #define _SC_XOPEN_ENH_I18N 63
  159. #define _SC_XOPEN_SHM 64
  160. /* additional XSH4/XCU4 command names for sysconf */
  161. #define _SC_2_CHAR_TERM 66
  162. #define _SC_XOPEN_XCU_VERSION 67
  163. /* additional XPG4v2 (UNIX 95) command names */
  164. #define _SC_ATEXIT_MAX 76
  165. #define _SC_IOV_MAX 77
  166. #define _SC_XOPEN_UNIX 78
  167. #define _SC_PAGE_SIZE _SC_PAGESIZE
  168. /* defined for XTI (XNS Issue 5) */
  169. #ifndef _SC_T_IOV_MAX
  170. #define _SC_T_IOV_MAX 79 /* Must be same in <xti.h> */
  171. #endif /* T_IOV_MAX must be <= IOV_MAX */
  172. #define _SC_PHYS_PAGES 500
  173. #define _SC_AVPHYS_PAGES 501
  174. /*
  175. * Hardware specific items
  176. * Note that not all items are supported on all architectures
  177. */
  178. #define _SC_COHER_BLKSZ 503 /* Coherence block size */
  179. #define _SC_SPLIT_CACHE 504 /* != 0 iff a split cache */
  180. #define _SC_ICACHE_SZ 505 /* Instruction cache size (bytes) */
  181. #define _SC_DCACHE_SZ 506 /* Data cache size (bytes) */
  182. #define _SC_ICACHE_LINESZ 507 /* Instruction cache line size */
  183. #define _SC_DCACHE_LINESZ 508 /* Data cache line size */
  184. #define _SC_ICACHE_BLKSZ 509 /* Block size invalidated for icache */
  185. #define _SC_DCACHE_BLKSZ 510 /* Block size for dcache */
  186. #define _SC_DCACHE_TBLKSZ 511 /* Block size for dcache prefetch */
  187. #define _SC_ICACHE_ASSOC 512 /* Icache associativity 1, 2, 3 etc */
  188. #define _SC_DCACHE_ASSOC 513 /* Dcache associativity 1, 2, 3 etc */
  189. #define _SC_MAXPID 514 /* maximum pid value */
  190. #define _SC_STACK_PROT 515 /* default stack protection */
  191. #define _SC_NPROCESSORS_MAX 516 /* maximum # of processors */
  192. #define _SC_CPUID_MAX 517 /* maximum CPU id */
  193. #define _SC_EPHID_MAX 518 /* maximum ephemeral id */
  194. #define _SC_UADDR_MAX 519 /* maximum user address */
  195. /*
  196. * POSIX.1c (pthreads) names. These values are defined above
  197. * the sub-500 range. See psarc case 1995/257.
  198. */
  199. #define _SC_THREAD_DESTRUCTOR_ITERATIONS 568
  200. #define _SC_GETGR_R_SIZE_MAX 569
  201. #define _SC_GETPW_R_SIZE_MAX 570
  202. #define _SC_LOGIN_NAME_MAX 571
  203. #define _SC_THREAD_KEYS_MAX 572
  204. #define _SC_THREAD_STACK_MIN 573
  205. #define _SC_THREAD_THREADS_MAX 574
  206. #define _SC_TTY_NAME_MAX 575
  207. #define _SC_THREADS 576
  208. #define _SC_THREAD_ATTR_STACKADDR 577
  209. #define _SC_THREAD_ATTR_STACKSIZE 578
  210. #define _SC_THREAD_PRIORITY_SCHEDULING 579
  211. #define _SC_THREAD_PRIO_INHERIT 580
  212. #define _SC_THREAD_PRIO_PROTECT 581
  213. #define _SC_THREAD_PROCESS_SHARED 582
  214. #define _SC_THREAD_SAFE_FUNCTIONS 583
  215. /* UNIX 98 */
  216. #define _SC_XOPEN_LEGACY 717
  217. #define _SC_XOPEN_REALTIME 718
  218. #define _SC_XOPEN_REALTIME_THREADS 719
  219. #define _SC_XBS5_ILP32_OFF32 720
  220. #define _SC_XBS5_ILP32_OFFBIG 721
  221. #define _SC_XBS5_LP64_OFF64 722
  222. #define _SC_XBS5_LPBIG_OFFBIG 723
  223. /* UNIX 03 */
  224. #define _SC_2_PBS 724
  225. #define _SC_2_PBS_ACCOUNTING 725
  226. #define _SC_2_PBS_CHECKPOINT 726
  227. #define _SC_2_PBS_LOCATE 728
  228. #define _SC_2_PBS_MESSAGE 729
  229. #define _SC_2_PBS_TRACK 730
  230. #define _SC_ADVISORY_INFO 731
  231. #define _SC_BARRIERS 732
  232. #define _SC_CLOCK_SELECTION 733
  233. #define _SC_CPUTIME 734
  234. #define _SC_HOST_NAME_MAX 735
  235. #define _SC_MONOTONIC_CLOCK 736
  236. #define _SC_READER_WRITER_LOCKS 737
  237. #define _SC_REGEXP 738
  238. #define _SC_SHELL 739
  239. #define _SC_SPAWN 740
  240. #define _SC_SPIN_LOCKS 741
  241. #define _SC_SPORADIC_SERVER 742
  242. #define _SC_SS_REPL_MAX 743
  243. #define _SC_SYMLOOP_MAX 744
  244. #define _SC_THREAD_CPUTIME 745
  245. #define _SC_THREAD_SPORADIC_SERVER 746
  246. #define _SC_TIMEOUTS 747
  247. #define _SC_TRACE 748
  248. #define _SC_TRACE_EVENT_FILTER 749
  249. #define _SC_TRACE_EVENT_NAME_MAX 750
  250. #define _SC_TRACE_INHERIT 751
  251. #define _SC_TRACE_LOG 752
  252. #define _SC_TRACE_NAME_MAX 753
  253. #define _SC_TRACE_SYS_MAX 754
  254. #define _SC_TRACE_USER_EVENT_MAX 755
  255. #define _SC_TYPED_MEMORY_OBJECTS 756
  256. #define _SC_V6_ILP32_OFF32 757
  257. #define _SC_V6_ILP32_OFFBIG 758
  258. #define _SC_V6_LP64_OFF64 759
  259. #define _SC_V6_LPBIG_OFFBIG 760
  260. #define _SC_XOPEN_STREAMS 761
  261. #define _SC_IPV6 762
  262. #define _SC_RAW_SOCKETS 763
  263. /* command names for POSIX pathconf */
  264. /* POSIX.1 names */
  265. #define _PC_LINK_MAX 1
  266. #define _PC_MAX_CANON 2
  267. #define _PC_MAX_INPUT 3
  268. #define _PC_NAME_MAX 4
  269. #define _PC_PATH_MAX 5
  270. #define _PC_PIPE_BUF 6
  271. #define _PC_NO_TRUNC 7
  272. #define _PC_VDISABLE 8
  273. #define _PC_CHOWN_RESTRICTED 9
  274. /* POSIX.4 names */
  275. #define _PC_ASYNC_IO 10
  276. #define _PC_PRIO_IO 11
  277. #define _PC_SYNC_IO 12
  278. /* UNIX 03 names */
  279. #define _PC_ALLOC_SIZE_MIN 13
  280. #define _PC_REC_INCR_XFER_SIZE 14
  281. #define _PC_REC_MAX_XFER_SIZE 15
  282. #define _PC_REC_MIN_XFER_SIZE 16
  283. #define _PC_REC_XFER_ALIGN 17
  284. #define _PC_SYMLINK_MAX 18
  285. #define _PC_2_SYMLINKS 19
  286. #define _PC_ACL_ENABLED 20
  287. #define _PC_MIN_HOLE_SIZE 21
  288. #define _PC_CASE_BEHAVIOR 22
  289. #define _PC_SATTR_ENABLED 23
  290. #define _PC_SATTR_EXISTS 24
  291. #define _PC_ACCESS_FILTERING 25
  292. /* UNIX 08 names */
  293. #define _PC_TIMESTAMP_RESOLUTION 26
  294. /*
  295. * Large File Summit names
  296. *
  297. * This value matches the MIPS ABI choice, but leaves a large gap in the
  298. * value space.
  299. */
  300. #define _PC_FILESIZEBITS 67
  301. /*
  302. * Extended attributes
  303. */
  304. #define _PC_XATTR_ENABLED 100
  305. #define _PC_XATTR_EXISTS 101
  306. /*
  307. * If you add a _PC define above 101, you must change _PC_LAST (and truss).
  308. */
  309. #define _PC_LAST 101
  310. /*
  311. * Case sensitivity values (related to _PC_CASE_BEHAVIOR)
  312. */
  313. #define _CASE_SENSITIVE 0x1
  314. #define _CASE_INSENSITIVE 0x2
  315. /*
  316. * The value of 0 is returned when
  317. * ACL's are not supported
  318. */
  319. #define _ACL_ACLENT_ENABLED 0x1
  320. #define _ACL_ACE_ENABLED 0x2
  321. #ifndef _POSIX_VERSION
  322. #ifdef _XPG6
  323. #define _POSIX_VERSION 200112L /* Supports IEEE Std 1003.1-2001 */
  324. #else
  325. #define _POSIX_VERSION 199506L /* Supports POSIX-1c DIS */
  326. #endif
  327. #endif /* _POSIX_VERSION */
  328. #ifndef _POSIX2_VERSION
  329. #ifdef _XPG6
  330. #define _POSIX2_VERSION 200112L /* Supports IEEE Std 1003.1-2001 */
  331. #else
  332. #define _POSIX2_VERSION 199209L /* Supports ISO POSIX-2 DIS */
  333. #endif
  334. #endif /* _POSIX2_VERSION */
  335. /*
  336. * Marked LEGACY in SUSv2 and removed in SUSv3. Though SUSv3 applications
  337. * should not rely on this value, it has been aligned with the current
  338. * standard to avoid confusion if used.
  339. */
  340. #ifndef _POSIX2_C_VERSION
  341. #ifdef _XPG6
  342. #define _POSIX2_C_VERSION 200112L /* Supports IEEE Std 1003.1-2001 */
  343. #else
  344. #define _POSIX2_C_VERSION 199209L /* Supports ISO POSIX-2 DIS */
  345. #endif
  346. #endif /* _POSIX2_C_VERSION */
  347. #define _XOPEN_XPG3 /* Supports XPG, Issue 3 */
  348. #define _XOPEN_XPG4 /* Supports XPG, Issue 4 */
  349. #define _XOPEN_UNIX 0 /* Supports X/Open System Interfaces */
  350. #ifndef _XOPEN_XCU_VERSION
  351. #define _XOPEN_XCU_VERSION 4 /* Supports XCU4 */
  352. #endif
  353. #define _XOPEN_REALTIME 1 /* Supports Realtime */
  354. #define _XOPEN_ENH_I18N 1 /* Supports Enhanced International */
  355. #define _XOPEN_SHM 1 /* Supports Shared Memory Feature */
  356. #define _POSIX2_CHAR_TERM 1 /* Supports at least 1 terminal type */
  357. #ifdef _XPG6
  358. #define _POSIX2_C_BIND 200112L /* Supports C Language Bindings */
  359. #define _POSIX2_C_DEV 200112L /* Supports C language dev utility */
  360. #define _POSIX2_FORT_RUN 200112L /* Supports FORTRAN runtime */
  361. #define _POSIX2_LOCALEDEF 200112L /* Supports creation of locales */
  362. #define _POSIX2_SW_DEV 200112L /* Supports S/W Development Utility */
  363. #define _POSIX2_UPE 200112L /* Supports User Portability Utility */
  364. #else
  365. #define _POSIX2_C_BIND 1 /* Supports C Language Bindings */
  366. #define _POSIX2_C_DEV 1 /* Supports C language dev utility */
  367. #define _POSIX2_FORT_RUN 1 /* Supports FORTRAN runtime */
  368. #define _POSIX2_LOCALEDEF 1 /* Supports creation of locales */
  369. #define _POSIX2_SW_DEV 1 /* Supports S/W Development Utility */
  370. #define _POSIX2_UPE 1 /* Supports User Portability Utility */
  371. #endif /* _XPG6 */
  372. /* UNIX 03 names */
  373. #define _POSIX_REGEXP 1 /* Supports POSIX Regular Expressions */
  374. #define _POSIX_SHELL 1 /* Supports POSIX shell */
  375. #define _XOPEN_STREAMS 1 /* Supports XSI Streams Option Group */
  376. #ifdef __cplusplus
  377. }
  378. #endif
  379. #endif /* _SYS_UNISTD_H */