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