xref: /illumos-gate/usr/src/boot/include/unistd.h (revision 199767f8)
1*199767f8SToomas Soome /*-
2*199767f8SToomas Soome  * Copyright (c) 1991, 1993, 1994
3*199767f8SToomas Soome  *	The Regents of the University of California.  All rights reserved.
4*199767f8SToomas Soome  *
5*199767f8SToomas Soome  * Redistribution and use in source and binary forms, with or without
6*199767f8SToomas Soome  * modification, are permitted provided that the following conditions
7*199767f8SToomas Soome  * are met:
8*199767f8SToomas Soome  * 1. Redistributions of source code must retain the above copyright
9*199767f8SToomas Soome  *    notice, this list of conditions and the following disclaimer.
10*199767f8SToomas Soome  * 2. Redistributions in binary form must reproduce the above copyright
11*199767f8SToomas Soome  *    notice, this list of conditions and the following disclaimer in the
12*199767f8SToomas Soome  *    documentation and/or other materials provided with the distribution.
13*199767f8SToomas Soome  * 3. Neither the name of the University nor the names of its contributors
14*199767f8SToomas Soome  *    may be used to endorse or promote products derived from this software
15*199767f8SToomas Soome  *    without specific prior written permission.
16*199767f8SToomas Soome  *
17*199767f8SToomas Soome  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
18*199767f8SToomas Soome  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19*199767f8SToomas Soome  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20*199767f8SToomas Soome  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
21*199767f8SToomas Soome  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22*199767f8SToomas Soome  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23*199767f8SToomas Soome  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24*199767f8SToomas Soome  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25*199767f8SToomas Soome  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26*199767f8SToomas Soome  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27*199767f8SToomas Soome  * SUCH DAMAGE.
28*199767f8SToomas Soome  *
29*199767f8SToomas Soome  *	@(#)unistd.h	8.12 (Berkeley) 4/27/95
30*199767f8SToomas Soome  * $FreeBSD$
31*199767f8SToomas Soome  */
32*199767f8SToomas Soome 
33*199767f8SToomas Soome #ifndef _UNISTD_H_
34*199767f8SToomas Soome #define	_UNISTD_H_
35*199767f8SToomas Soome 
36*199767f8SToomas Soome #include <sys/cdefs.h>
37*199767f8SToomas Soome #include <sys/types.h>			/* XXX adds too much pollution. */
38*199767f8SToomas Soome #include <sys/unistd.h>
39*199767f8SToomas Soome #include <sys/_null.h>
40*199767f8SToomas Soome #include <sys/_types.h>
41*199767f8SToomas Soome 
42*199767f8SToomas Soome #ifndef _GID_T_DECLARED
43*199767f8SToomas Soome typedef	__gid_t		gid_t;
44*199767f8SToomas Soome #define	_GID_T_DECLARED
45*199767f8SToomas Soome #endif
46*199767f8SToomas Soome 
47*199767f8SToomas Soome #ifndef _OFF_T_DECLARED
48*199767f8SToomas Soome typedef	__off_t		off_t;
49*199767f8SToomas Soome #define	_OFF_T_DECLARED
50*199767f8SToomas Soome #endif
51*199767f8SToomas Soome 
52*199767f8SToomas Soome #ifndef _PID_T_DECLARED
53*199767f8SToomas Soome typedef	__pid_t		pid_t;
54*199767f8SToomas Soome #define	_PID_T_DECLARED
55*199767f8SToomas Soome #endif
56*199767f8SToomas Soome 
57*199767f8SToomas Soome #ifndef _SIZE_T_DECLARED
58*199767f8SToomas Soome typedef	__size_t	size_t;
59*199767f8SToomas Soome #define	_SIZE_T_DECLARED
60*199767f8SToomas Soome #endif
61*199767f8SToomas Soome 
62*199767f8SToomas Soome #ifndef _SSIZE_T_DECLARED
63*199767f8SToomas Soome typedef	__ssize_t	ssize_t;
64*199767f8SToomas Soome #define	_SSIZE_T_DECLARED
65*199767f8SToomas Soome #endif
66*199767f8SToomas Soome 
67*199767f8SToomas Soome #ifndef _UID_T_DECLARED
68*199767f8SToomas Soome typedef	__uid_t		uid_t;
69*199767f8SToomas Soome #define	_UID_T_DECLARED
70*199767f8SToomas Soome #endif
71*199767f8SToomas Soome 
72*199767f8SToomas Soome #ifndef _USECONDS_T_DECLARED
73*199767f8SToomas Soome typedef	__useconds_t	useconds_t;
74*199767f8SToomas Soome #define	_USECONDS_T_DECLARED
75*199767f8SToomas Soome #endif
76*199767f8SToomas Soome 
77*199767f8SToomas Soome #define	STDIN_FILENO	0	/* standard input file descriptor */
78*199767f8SToomas Soome #define	STDOUT_FILENO	1	/* standard output file descriptor */
79*199767f8SToomas Soome #define	STDERR_FILENO	2	/* standard error file descriptor */
80*199767f8SToomas Soome 
81*199767f8SToomas Soome #if __XSI_VISIBLE || __POSIX_VISIBLE >= 200112
82*199767f8SToomas Soome #define	F_ULOCK		0	/* unlock locked section */
83*199767f8SToomas Soome #define	F_LOCK		1	/* lock a section for exclusive use */
84*199767f8SToomas Soome #define	F_TLOCK		2	/* test and lock a section for exclusive use */
85*199767f8SToomas Soome #define	F_TEST		3	/* test a section for locks by other procs */
86*199767f8SToomas Soome #endif
87*199767f8SToomas Soome 
88*199767f8SToomas Soome /*
89*199767f8SToomas Soome  * POSIX options and option groups we unconditionally do or don't
90*199767f8SToomas Soome  * implement.  This list includes those options which are exclusively
91*199767f8SToomas Soome  * implemented (or not) in user mode.  Please keep this list in
92*199767f8SToomas Soome  * alphabetical order.
93*199767f8SToomas Soome  *
94*199767f8SToomas Soome  * Anything which is defined as zero below **must** have an
95*199767f8SToomas Soome  * implementation for the corresponding sysconf() which is able to
96*199767f8SToomas Soome  * determine conclusively whether or not the feature is supported.
97*199767f8SToomas Soome  * Anything which is defined as other than -1 below **must** have
98*199767f8SToomas Soome  * complete headers, types, and function declarations as specified by
99*199767f8SToomas Soome  * the POSIX standard; however, if the relevant sysconf() function
100*199767f8SToomas Soome  * returns -1, the functions may be stubbed out.
101*199767f8SToomas Soome  */
102*199767f8SToomas Soome #define	_POSIX_BARRIERS			200112L
103*199767f8SToomas Soome #define	_POSIX_CPUTIME			200112L
104*199767f8SToomas Soome #define	_POSIX_READER_WRITER_LOCKS	200112L
105*199767f8SToomas Soome #define	_POSIX_REGEXP			1
106*199767f8SToomas Soome #define	_POSIX_SHELL			1
107*199767f8SToomas Soome #define	_POSIX_SPAWN			200112L
108*199767f8SToomas Soome #define	_POSIX_SPIN_LOCKS		200112L
109*199767f8SToomas Soome #define	_POSIX_THREAD_ATTR_STACKADDR	200112L
110*199767f8SToomas Soome #define	_POSIX_THREAD_ATTR_STACKSIZE	200112L
111*199767f8SToomas Soome #define	_POSIX_THREAD_CPUTIME		200112L
112*199767f8SToomas Soome #define	_POSIX_THREAD_PRIO_INHERIT	200112L
113*199767f8SToomas Soome #define	_POSIX_THREAD_PRIO_PROTECT	200112L
114*199767f8SToomas Soome #define	_POSIX_THREAD_PRIORITY_SCHEDULING 200112L
115*199767f8SToomas Soome #define	_POSIX_THREAD_PROCESS_SHARED	-1
116*199767f8SToomas Soome #define	_POSIX_THREAD_SAFE_FUNCTIONS	-1
117*199767f8SToomas Soome #define	_POSIX_THREAD_SPORADIC_SERVER	-1
118*199767f8SToomas Soome #define	_POSIX_THREADS			200112L
119*199767f8SToomas Soome #define	_POSIX_TRACE			-1
120*199767f8SToomas Soome #define	_POSIX_TRACE_EVENT_FILTER	-1
121*199767f8SToomas Soome #define	_POSIX_TRACE_INHERIT		-1
122*199767f8SToomas Soome #define	_POSIX_TRACE_LOG		-1
123*199767f8SToomas Soome #define	_POSIX2_C_BIND			200112L	/* mandatory */
124*199767f8SToomas Soome #define	_POSIX2_C_DEV			-1 /* need c99 utility */
125*199767f8SToomas Soome #define	_POSIX2_CHAR_TERM		1
126*199767f8SToomas Soome #define	_POSIX2_FORT_DEV		-1 /* need fort77 utility */
127*199767f8SToomas Soome #define	_POSIX2_FORT_RUN		200112L
128*199767f8SToomas Soome #define	_POSIX2_LOCALEDEF		-1
129*199767f8SToomas Soome #define	_POSIX2_PBS			-1
130*199767f8SToomas Soome #define	_POSIX2_PBS_ACCOUNTING		-1
131*199767f8SToomas Soome #define	_POSIX2_PBS_CHECKPOINT		-1
132*199767f8SToomas Soome #define	_POSIX2_PBS_LOCATE		-1
133*199767f8SToomas Soome #define	_POSIX2_PBS_MESSAGE		-1
134*199767f8SToomas Soome #define	_POSIX2_PBS_TRACK		-1
135*199767f8SToomas Soome #define	_POSIX2_SW_DEV			-1 /* XXX ??? */
136*199767f8SToomas Soome #define	_POSIX2_UPE			200112L
137*199767f8SToomas Soome #define	_V6_ILP32_OFF32			-1
138*199767f8SToomas Soome #define	_V6_ILP32_OFFBIG		0
139*199767f8SToomas Soome #define	_V6_LP64_OFF64			0
140*199767f8SToomas Soome #define	_V6_LPBIG_OFFBIG		-1
141*199767f8SToomas Soome 
142*199767f8SToomas Soome #if __XSI_VISIBLE
143*199767f8SToomas Soome #define	_XOPEN_CRYPT			-1 /* XXX ??? */
144*199767f8SToomas Soome #define	_XOPEN_ENH_I18N			-1 /* mandatory in XSI */
145*199767f8SToomas Soome #define	_XOPEN_LEGACY			-1
146*199767f8SToomas Soome #define	_XOPEN_REALTIME			-1
147*199767f8SToomas Soome #define	_XOPEN_REALTIME_THREADS		-1
148*199767f8SToomas Soome #define	_XOPEN_UNIX			-1
149*199767f8SToomas Soome #endif
150*199767f8SToomas Soome 
151*199767f8SToomas Soome /* Define the POSIX.2 version we target for compliance. */
152*199767f8SToomas Soome #define	_POSIX2_VERSION		199212L
153*199767f8SToomas Soome 
154*199767f8SToomas Soome /*
155*199767f8SToomas Soome  * POSIX-style system configuration variable accessors (for the
156*199767f8SToomas Soome  * sysconf function).  The kernel does not directly implement the
157*199767f8SToomas Soome  * sysconf() interface; rather, a C library stub translates references
158*199767f8SToomas Soome  * to sysconf() into calls to sysctl() using a giant switch statement.
159*199767f8SToomas Soome  * Those that are marked `user' are implemented entirely in the C
160*199767f8SToomas Soome  * library and never query the kernel.  pathconf() is implemented
161*199767f8SToomas Soome  * directly by the kernel so those are not defined here.
162*199767f8SToomas Soome  */
163*199767f8SToomas Soome #define	_SC_ARG_MAX		 1
164*199767f8SToomas Soome #define	_SC_CHILD_MAX		 2
165*199767f8SToomas Soome #define	_SC_CLK_TCK		 3
166*199767f8SToomas Soome #define	_SC_NGROUPS_MAX		 4
167*199767f8SToomas Soome #define	_SC_OPEN_MAX		 5
168*199767f8SToomas Soome #define	_SC_JOB_CONTROL		 6
169*199767f8SToomas Soome #define	_SC_SAVED_IDS		 7
170*199767f8SToomas Soome #define	_SC_VERSION		 8
171*199767f8SToomas Soome #define	_SC_BC_BASE_MAX		 9 /* user */
172*199767f8SToomas Soome #define	_SC_BC_DIM_MAX		10 /* user */
173*199767f8SToomas Soome #define	_SC_BC_SCALE_MAX	11 /* user */
174*199767f8SToomas Soome #define	_SC_BC_STRING_MAX	12 /* user */
175*199767f8SToomas Soome #define	_SC_COLL_WEIGHTS_MAX	13 /* user */
176*199767f8SToomas Soome #define	_SC_EXPR_NEST_MAX	14 /* user */
177*199767f8SToomas Soome #define	_SC_LINE_MAX		15 /* user */
178*199767f8SToomas Soome #define	_SC_RE_DUP_MAX		16 /* user */
179*199767f8SToomas Soome #define	_SC_2_VERSION		17 /* user */
180*199767f8SToomas Soome #define	_SC_2_C_BIND		18 /* user */
181*199767f8SToomas Soome #define	_SC_2_C_DEV		19 /* user */
182*199767f8SToomas Soome #define	_SC_2_CHAR_TERM		20 /* user */
183*199767f8SToomas Soome #define	_SC_2_FORT_DEV		21 /* user */
184*199767f8SToomas Soome #define	_SC_2_FORT_RUN		22 /* user */
185*199767f8SToomas Soome #define	_SC_2_LOCALEDEF		23 /* user */
186*199767f8SToomas Soome #define	_SC_2_SW_DEV		24 /* user */
187*199767f8SToomas Soome #define	_SC_2_UPE		25 /* user */
188*199767f8SToomas Soome #define	_SC_STREAM_MAX		26 /* user */
189*199767f8SToomas Soome #define	_SC_TZNAME_MAX		27 /* user */
190*199767f8SToomas Soome 
191*199767f8SToomas Soome #if __POSIX_VISIBLE >= 199309
192*199767f8SToomas Soome #define	_SC_ASYNCHRONOUS_IO	28
193*199767f8SToomas Soome #define	_SC_MAPPED_FILES	29
194*199767f8SToomas Soome #define	_SC_MEMLOCK		30
195*199767f8SToomas Soome #define	_SC_MEMLOCK_RANGE	31
196*199767f8SToomas Soome #define	_SC_MEMORY_PROTECTION	32
197*199767f8SToomas Soome #define	_SC_MESSAGE_PASSING	33
198*199767f8SToomas Soome #define	_SC_PRIORITIZED_IO	34
199*199767f8SToomas Soome #define	_SC_PRIORITY_SCHEDULING	35
200*199767f8SToomas Soome #define	_SC_REALTIME_SIGNALS	36
201*199767f8SToomas Soome #define	_SC_SEMAPHORES		37
202*199767f8SToomas Soome #define	_SC_FSYNC		38
203*199767f8SToomas Soome #define	_SC_SHARED_MEMORY_OBJECTS 39
204*199767f8SToomas Soome #define	_SC_SYNCHRONIZED_IO	40
205*199767f8SToomas Soome #define	_SC_TIMERS		41
206*199767f8SToomas Soome #define	_SC_AIO_LISTIO_MAX	42
207*199767f8SToomas Soome #define	_SC_AIO_MAX		43
208*199767f8SToomas Soome #define	_SC_AIO_PRIO_DELTA_MAX	44
209*199767f8SToomas Soome #define	_SC_DELAYTIMER_MAX	45
210*199767f8SToomas Soome #define	_SC_MQ_OPEN_MAX		46
211*199767f8SToomas Soome #define	_SC_PAGESIZE		47
212*199767f8SToomas Soome #define	_SC_RTSIG_MAX		48
213*199767f8SToomas Soome #define	_SC_SEM_NSEMS_MAX	49
214*199767f8SToomas Soome #define	_SC_SEM_VALUE_MAX	50
215*199767f8SToomas Soome #define	_SC_SIGQUEUE_MAX	51
216*199767f8SToomas Soome #define	_SC_TIMER_MAX		52
217*199767f8SToomas Soome #endif
218*199767f8SToomas Soome 
219*199767f8SToomas Soome #if __POSIX_VISIBLE >= 200112
220*199767f8SToomas Soome #define	_SC_2_PBS		59 /* user */
221*199767f8SToomas Soome #define	_SC_2_PBS_ACCOUNTING	60 /* user */
222*199767f8SToomas Soome #define	_SC_2_PBS_CHECKPOINT	61 /* user */
223*199767f8SToomas Soome #define	_SC_2_PBS_LOCATE	62 /* user */
224*199767f8SToomas Soome #define	_SC_2_PBS_MESSAGE	63 /* user */
225*199767f8SToomas Soome #define	_SC_2_PBS_TRACK		64 /* user */
226*199767f8SToomas Soome #define	_SC_ADVISORY_INFO	65
227*199767f8SToomas Soome #define	_SC_BARRIERS		66 /* user */
228*199767f8SToomas Soome #define	_SC_CLOCK_SELECTION	67
229*199767f8SToomas Soome #define	_SC_CPUTIME		68
230*199767f8SToomas Soome #define	_SC_FILE_LOCKING	69
231*199767f8SToomas Soome #define	_SC_GETGR_R_SIZE_MAX	70 /* user */
232*199767f8SToomas Soome #define	_SC_GETPW_R_SIZE_MAX	71 /* user */
233*199767f8SToomas Soome #define	_SC_HOST_NAME_MAX	72
234*199767f8SToomas Soome #define	_SC_LOGIN_NAME_MAX	73
235*199767f8SToomas Soome #define	_SC_MONOTONIC_CLOCK	74
236*199767f8SToomas Soome #define	_SC_MQ_PRIO_MAX		75
237*199767f8SToomas Soome #define	_SC_READER_WRITER_LOCKS	76 /* user */
238*199767f8SToomas Soome #define	_SC_REGEXP		77 /* user */
239*199767f8SToomas Soome #define	_SC_SHELL		78 /* user */
240*199767f8SToomas Soome #define	_SC_SPAWN		79 /* user */
241*199767f8SToomas Soome #define	_SC_SPIN_LOCKS		80 /* user */
242*199767f8SToomas Soome #define	_SC_SPORADIC_SERVER	81
243*199767f8SToomas Soome #define	_SC_THREAD_ATTR_STACKADDR 82 /* user */
244*199767f8SToomas Soome #define	_SC_THREAD_ATTR_STACKSIZE 83 /* user */
245*199767f8SToomas Soome #define	_SC_THREAD_CPUTIME	84 /* user */
246*199767f8SToomas Soome #define	_SC_THREAD_DESTRUCTOR_ITERATIONS 85 /* user */
247*199767f8SToomas Soome #define	_SC_THREAD_KEYS_MAX	86 /* user */
248*199767f8SToomas Soome #define	_SC_THREAD_PRIO_INHERIT	87 /* user */
249*199767f8SToomas Soome #define	_SC_THREAD_PRIO_PROTECT	88 /* user */
250*199767f8SToomas Soome #define	_SC_THREAD_PRIORITY_SCHEDULING 89 /* user */
251*199767f8SToomas Soome #define	_SC_THREAD_PROCESS_SHARED 90 /* user */
252*199767f8SToomas Soome #define	_SC_THREAD_SAFE_FUNCTIONS 91 /* user */
253*199767f8SToomas Soome #define	_SC_THREAD_SPORADIC_SERVER 92 /* user */
254*199767f8SToomas Soome #define	_SC_THREAD_STACK_MIN	93 /* user */
255*199767f8SToomas Soome #define	_SC_THREAD_THREADS_MAX	94 /* user */
256*199767f8SToomas Soome #define	_SC_TIMEOUTS		95 /* user */
257*199767f8SToomas Soome #define	_SC_THREADS		96 /* user */
258*199767f8SToomas Soome #define	_SC_TRACE		97 /* user */
259*199767f8SToomas Soome #define	_SC_TRACE_EVENT_FILTER	98 /* user */
260*199767f8SToomas Soome #define	_SC_TRACE_INHERIT	99 /* user */
261*199767f8SToomas Soome #define	_SC_TRACE_LOG		100 /* user */
262*199767f8SToomas Soome #define	_SC_TTY_NAME_MAX	101 /* user */
263*199767f8SToomas Soome #define	_SC_TYPED_MEMORY_OBJECTS 102
264*199767f8SToomas Soome #define	_SC_V6_ILP32_OFF32	103 /* user */
265*199767f8SToomas Soome #define	_SC_V6_ILP32_OFFBIG	104 /* user */
266*199767f8SToomas Soome #define	_SC_V6_LP64_OFF64	105 /* user */
267*199767f8SToomas Soome #define	_SC_V6_LPBIG_OFFBIG	106 /* user */
268*199767f8SToomas Soome #define	_SC_IPV6		118
269*199767f8SToomas Soome #define	_SC_RAW_SOCKETS		119
270*199767f8SToomas Soome #define	_SC_SYMLOOP_MAX		120
271*199767f8SToomas Soome #endif
272*199767f8SToomas Soome 
273*199767f8SToomas Soome #if __XSI_VISIBLE
274*199767f8SToomas Soome #define	_SC_ATEXIT_MAX		107 /* user */
275*199767f8SToomas Soome #define	_SC_IOV_MAX		56
276*199767f8SToomas Soome #define	_SC_PAGE_SIZE		_SC_PAGESIZE
277*199767f8SToomas Soome #define	_SC_XOPEN_CRYPT		108 /* user */
278*199767f8SToomas Soome #define	_SC_XOPEN_ENH_I18N	109 /* user */
279*199767f8SToomas Soome #define	_SC_XOPEN_LEGACY	110 /* user */
280*199767f8SToomas Soome #define	_SC_XOPEN_REALTIME	111
281*199767f8SToomas Soome #define	_SC_XOPEN_REALTIME_THREADS 112
282*199767f8SToomas Soome #define	_SC_XOPEN_SHM		113
283*199767f8SToomas Soome #define	_SC_XOPEN_STREAMS	114
284*199767f8SToomas Soome #define	_SC_XOPEN_UNIX		115
285*199767f8SToomas Soome #define	_SC_XOPEN_VERSION	116
286*199767f8SToomas Soome #define	_SC_XOPEN_XCU_VERSION	117 /* user */
287*199767f8SToomas Soome #endif
288*199767f8SToomas Soome 
289*199767f8SToomas Soome #if __BSD_VISIBLE
290*199767f8SToomas Soome #define	_SC_NPROCESSORS_CONF	57
291*199767f8SToomas Soome #define	_SC_NPROCESSORS_ONLN	58
292*199767f8SToomas Soome #define	_SC_CPUSET_SIZE		122
293*199767f8SToomas Soome #endif
294*199767f8SToomas Soome 
295*199767f8SToomas Soome /* Extensions found in Solaris and Linux. */
296*199767f8SToomas Soome #define	_SC_PHYS_PAGES		121
297*199767f8SToomas Soome 
298*199767f8SToomas Soome /* Keys for the confstr(3) function. */
299*199767f8SToomas Soome #if __POSIX_VISIBLE >= 199209
300*199767f8SToomas Soome #define	_CS_PATH		1	/* default value of PATH */
301*199767f8SToomas Soome #endif
302*199767f8SToomas Soome 
303*199767f8SToomas Soome #if __POSIX_VISIBLE >= 200112
304*199767f8SToomas Soome #define	_CS_POSIX_V6_ILP32_OFF32_CFLAGS		2
305*199767f8SToomas Soome #define	_CS_POSIX_V6_ILP32_OFF32_LDFLAGS	3
306*199767f8SToomas Soome #define	_CS_POSIX_V6_ILP32_OFF32_LIBS		4
307*199767f8SToomas Soome #define	_CS_POSIX_V6_ILP32_OFFBIG_CFLAGS	5
308*199767f8SToomas Soome #define	_CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS	6
309*199767f8SToomas Soome #define	_CS_POSIX_V6_ILP32_OFFBIG_LIBS		7
310*199767f8SToomas Soome #define	_CS_POSIX_V6_LP64_OFF64_CFLAGS		8
311*199767f8SToomas Soome #define	_CS_POSIX_V6_LP64_OFF64_LDFLAGS		9
312*199767f8SToomas Soome #define	_CS_POSIX_V6_LP64_OFF64_LIBS		10
313*199767f8SToomas Soome #define	_CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS	11
314*199767f8SToomas Soome #define	_CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS	12
315*199767f8SToomas Soome #define	_CS_POSIX_V6_LPBIG_OFFBIG_LIBS		13
316*199767f8SToomas Soome #define	_CS_POSIX_V6_WIDTH_RESTRICTED_ENVS	14
317*199767f8SToomas Soome #endif
318*199767f8SToomas Soome 
319*199767f8SToomas Soome __BEGIN_DECLS
320*199767f8SToomas Soome /* 1003.1-1990 */
321*199767f8SToomas Soome void	 _exit(int) __dead2;
322*199767f8SToomas Soome int	 access(const char *, int);
323*199767f8SToomas Soome unsigned int	 alarm(unsigned int);
324*199767f8SToomas Soome int	 chdir(const char *);
325*199767f8SToomas Soome int	 chown(const char *, uid_t, gid_t);
326*199767f8SToomas Soome int	 close(int);
327*199767f8SToomas Soome void	 closefrom(int);
328*199767f8SToomas Soome int	 dup(int);
329*199767f8SToomas Soome int	 dup2(int, int);
330*199767f8SToomas Soome int	 execl(const char *, const char *, ...) __null_sentinel;
331*199767f8SToomas Soome int	 execle(const char *, const char *, ...);
332*199767f8SToomas Soome int	 execlp(const char *, const char *, ...) __null_sentinel;
333*199767f8SToomas Soome int	 execv(const char *, char * const *);
334*199767f8SToomas Soome int	 execve(const char *, char * const *, char * const *);
335*199767f8SToomas Soome int	 execvp(const char *, char * const *);
336*199767f8SToomas Soome pid_t	 fork(void);
337*199767f8SToomas Soome long	 fpathconf(int, int);
338*199767f8SToomas Soome char	*getcwd(char *, size_t);
339*199767f8SToomas Soome gid_t	 getegid(void);
340*199767f8SToomas Soome uid_t	 geteuid(void);
341*199767f8SToomas Soome gid_t	 getgid(void);
342*199767f8SToomas Soome int	 getgroups(int, gid_t []);
343*199767f8SToomas Soome char	*getlogin(void);
344*199767f8SToomas Soome pid_t	 getpgrp(void);
345*199767f8SToomas Soome pid_t	 getpid(void);
346*199767f8SToomas Soome pid_t	 getppid(void);
347*199767f8SToomas Soome uid_t	 getuid(void);
348*199767f8SToomas Soome int	 isatty(int);
349*199767f8SToomas Soome int	 link(const char *, const char *);
350*199767f8SToomas Soome #ifndef _LSEEK_DECLARED
351*199767f8SToomas Soome #define	_LSEEK_DECLARED
352*199767f8SToomas Soome off_t	 lseek(int, off_t, int);
353*199767f8SToomas Soome #endif
354*199767f8SToomas Soome long	 pathconf(const char *, int);
355*199767f8SToomas Soome int	 pause(void);
356*199767f8SToomas Soome int	 pipe(int *);
357*199767f8SToomas Soome ssize_t	 read(int, void *, size_t);
358*199767f8SToomas Soome int	 rmdir(const char *);
359*199767f8SToomas Soome int	 setgid(gid_t);
360*199767f8SToomas Soome int	 setpgid(pid_t, pid_t);
361*199767f8SToomas Soome pid_t	 setsid(void);
362*199767f8SToomas Soome int	 setuid(uid_t);
363*199767f8SToomas Soome unsigned int	 sleep(unsigned int);
364*199767f8SToomas Soome long	 sysconf(int);
365*199767f8SToomas Soome pid_t	 tcgetpgrp(int);
366*199767f8SToomas Soome int	 tcsetpgrp(int, pid_t);
367*199767f8SToomas Soome char	*ttyname(int);
368*199767f8SToomas Soome int	ttyname_r(int, char *, size_t);
369*199767f8SToomas Soome int	 unlink(const char *);
370*199767f8SToomas Soome ssize_t	 write(int, const void *, size_t);
371*199767f8SToomas Soome 
372*199767f8SToomas Soome /* 1003.2-1992 */
373*199767f8SToomas Soome #if __POSIX_VISIBLE >= 199209 || __XSI_VISIBLE
374*199767f8SToomas Soome size_t	 confstr(int, char *, size_t);
375*199767f8SToomas Soome #ifndef _GETOPT_DECLARED
376*199767f8SToomas Soome #define	_GETOPT_DECLARED
377*199767f8SToomas Soome int	 getopt(int, char * const [], const char *);
378*199767f8SToomas Soome 
379*199767f8SToomas Soome extern char *optarg;			/* getopt(3) external variables */
380*199767f8SToomas Soome extern int optind, opterr, optopt;
381*199767f8SToomas Soome #endif /* _GETOPT_DECLARED */
382*199767f8SToomas Soome #endif
383*199767f8SToomas Soome 
384*199767f8SToomas Soome /* ISO/IEC 9945-1: 1996 */
385*199767f8SToomas Soome #if __POSIX_VISIBLE >= 199506 || __XSI_VISIBLE
386*199767f8SToomas Soome int	 fsync(int);
387*199767f8SToomas Soome 
388*199767f8SToomas Soome /*
389*199767f8SToomas Soome  * ftruncate() was in the POSIX Realtime Extension (it's used for shared
390*199767f8SToomas Soome  * memory), but truncate() was not.
391*199767f8SToomas Soome  */
392*199767f8SToomas Soome #ifndef _FTRUNCATE_DECLARED
393*199767f8SToomas Soome #define	_FTRUNCATE_DECLARED
394*199767f8SToomas Soome int	 ftruncate(int, off_t);
395*199767f8SToomas Soome #endif
396*199767f8SToomas Soome #endif
397*199767f8SToomas Soome 
398*199767f8SToomas Soome #if __POSIX_VISIBLE >= 199506
399*199767f8SToomas Soome int	 getlogin_r(char *, int);
400*199767f8SToomas Soome #endif
401*199767f8SToomas Soome 
402*199767f8SToomas Soome /* 1003.1-2001 */
403*199767f8SToomas Soome #if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE
404*199767f8SToomas Soome int	 fchown(int, uid_t, gid_t);
405*199767f8SToomas Soome ssize_t	 readlink(const char * __restrict, char * __restrict, size_t);
406*199767f8SToomas Soome #endif
407*199767f8SToomas Soome #if __POSIX_VISIBLE >= 200112
408*199767f8SToomas Soome int	 gethostname(char *, size_t);
409*199767f8SToomas Soome int	 setegid(gid_t);
410*199767f8SToomas Soome int	 seteuid(uid_t);
411*199767f8SToomas Soome #endif
412*199767f8SToomas Soome 
413*199767f8SToomas Soome /* 1003.1-2008 */
414*199767f8SToomas Soome #if __POSIX_VISIBLE >= 200809 || __XSI_VISIBLE
415*199767f8SToomas Soome int	 getsid(pid_t _pid);
416*199767f8SToomas Soome int	 fchdir(int);
417*199767f8SToomas Soome int	 getpgid(pid_t _pid);
418*199767f8SToomas Soome int	 lchown(const char *, uid_t, gid_t);
419*199767f8SToomas Soome ssize_t	 pread(int, void *, size_t, off_t);
420*199767f8SToomas Soome ssize_t	 pwrite(int, const void *, size_t, off_t);
421*199767f8SToomas Soome 
422*199767f8SToomas Soome /* See comment at ftruncate() above. */
423*199767f8SToomas Soome #ifndef _TRUNCATE_DECLARED
424*199767f8SToomas Soome #define	_TRUNCATE_DECLARED
425*199767f8SToomas Soome int	 truncate(const char *, off_t);
426*199767f8SToomas Soome #endif
427*199767f8SToomas Soome #endif /* __POSIX_VISIBLE >= 200809 || __XSI_VISIBLE */
428*199767f8SToomas Soome 
429*199767f8SToomas Soome #if __POSIX_VISIBLE >= 200809
430*199767f8SToomas Soome int	faccessat(int, const char *, int, int);
431*199767f8SToomas Soome int	fchownat(int, const char *, uid_t, gid_t, int);
432*199767f8SToomas Soome int	fexecve(int, char *const [], char *const []);
433*199767f8SToomas Soome int	linkat(int, const char *, int, const char *, int);
434*199767f8SToomas Soome ssize_t	readlinkat(int, const char * __restrict, char * __restrict, size_t);
435*199767f8SToomas Soome int	symlinkat(const char *, int, const char *);
436*199767f8SToomas Soome int	unlinkat(int, const char *, int);
437*199767f8SToomas Soome #endif /* __POSIX_VISIBLE >= 200809 */
438*199767f8SToomas Soome 
439*199767f8SToomas Soome /*
440*199767f8SToomas Soome  * symlink() was originally in POSIX.1a, which was withdrawn after
441*199767f8SToomas Soome  * being overtaken by events (1003.1-2001).  It was in XPG4.2, and of
442*199767f8SToomas Soome  * course has been in BSD since 4.2.
443*199767f8SToomas Soome  */
444*199767f8SToomas Soome #if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE >= 402
445*199767f8SToomas Soome int	 symlink(const char * __restrict, const char * __restrict);
446*199767f8SToomas Soome #endif
447*199767f8SToomas Soome 
448*199767f8SToomas Soome /* X/Open System Interfaces */
449*199767f8SToomas Soome #if __XSI_VISIBLE
450*199767f8SToomas Soome char	*crypt(const char *, const char *);
451*199767f8SToomas Soome /* char	*ctermid(char *); */		/* XXX ??? */
452*199767f8SToomas Soome int	 encrypt(char *, int);
453*199767f8SToomas Soome long	 gethostid(void);
454*199767f8SToomas Soome int	 lockf(int, int, off_t);
455*199767f8SToomas Soome int	 nice(int);
456*199767f8SToomas Soome int	 setregid(gid_t, gid_t);
457*199767f8SToomas Soome int	 setreuid(uid_t, uid_t);
458*199767f8SToomas Soome 
459*199767f8SToomas Soome #ifndef _SWAB_DECLARED
460*199767f8SToomas Soome #define _SWAB_DECLARED
461*199767f8SToomas Soome void	 swab(const void * __restrict, void * __restrict, ssize_t);
462*199767f8SToomas Soome #endif /* _SWAB_DECLARED */
463*199767f8SToomas Soome 
464*199767f8SToomas Soome void	 sync(void);
465*199767f8SToomas Soome 
466*199767f8SToomas Soome #endif /* __XSI_VISIBLE */
467*199767f8SToomas Soome 
468*199767f8SToomas Soome #if (__XSI_VISIBLE && __XSI_VISIBLE <= 500) || __BSD_VISIBLE
469*199767f8SToomas Soome int	 brk(const void *);
470*199767f8SToomas Soome int	 chroot(const char *);
471*199767f8SToomas Soome int	 getdtablesize(void);
472*199767f8SToomas Soome int	 getpagesize(void) __pure2;
473*199767f8SToomas Soome char	*getpass(const char *);
474*199767f8SToomas Soome void	*sbrk(intptr_t);
475*199767f8SToomas Soome #endif
476*199767f8SToomas Soome 
477*199767f8SToomas Soome #if (__XSI_VISIBLE && __XSI_VISIBLE <= 600) || __BSD_VISIBLE
478*199767f8SToomas Soome char	*getwd(char *);			/* obsoleted by getcwd() */
479*199767f8SToomas Soome useconds_t
480*199767f8SToomas Soome 	 ualarm(useconds_t, useconds_t);
481*199767f8SToomas Soome int	 usleep(useconds_t);
482*199767f8SToomas Soome pid_t	 vfork(void) __returns_twice;
483*199767f8SToomas Soome #endif
484*199767f8SToomas Soome 
485*199767f8SToomas Soome #if __BSD_VISIBLE
486*199767f8SToomas Soome struct timeval;				/* select(2) */
487*199767f8SToomas Soome int	 acct(const char *);
488*199767f8SToomas Soome int	 async_daemon(void);
489*199767f8SToomas Soome int	 check_utility_compat(const char *);
490*199767f8SToomas Soome const char *
491*199767f8SToomas Soome 	 crypt_get_format(void);
492*199767f8SToomas Soome int	 crypt_set_format(const char *);
493*199767f8SToomas Soome int	 des_cipher(const char *, char *, long, int);
494*199767f8SToomas Soome int	 des_setkey(const char *key);
495*199767f8SToomas Soome int	 dup3(int, int, int);
496*199767f8SToomas Soome int	 eaccess(const char *, int);
497*199767f8SToomas Soome void	 endusershell(void);
498*199767f8SToomas Soome int	 exect(const char *, char * const *, char * const *);
499*199767f8SToomas Soome int	 execvP(const char *, const char *, char * const *);
500*199767f8SToomas Soome int	 feature_present(const char *);
501*199767f8SToomas Soome char	*fflagstostr(u_long);
502*199767f8SToomas Soome int	 getdomainname(char *, int);
503*199767f8SToomas Soome int	 getgrouplist(const char *, gid_t, gid_t *, int *);
504*199767f8SToomas Soome int	 getloginclass(char *, size_t);
505*199767f8SToomas Soome mode_t	 getmode(const void *, mode_t);
506*199767f8SToomas Soome int	 getosreldate(void);
507*199767f8SToomas Soome int	 getpeereid(int, uid_t *, gid_t *);
508*199767f8SToomas Soome int	 getresgid(gid_t *, gid_t *, gid_t *);
509*199767f8SToomas Soome int	 getresuid(uid_t *, uid_t *, uid_t *);
510*199767f8SToomas Soome char	*getusershell(void);
511*199767f8SToomas Soome int	 initgroups(const char *, gid_t);
512*199767f8SToomas Soome int	 iruserok(unsigned long, int, const char *, const char *);
513*199767f8SToomas Soome int	 iruserok_sa(const void *, int, int, const char *, const char *);
514*199767f8SToomas Soome int	 issetugid(void);
515*199767f8SToomas Soome void	__FreeBSD_libc_enter_restricted_mode(void);
516*199767f8SToomas Soome long	 lpathconf(const char *, int);
517*199767f8SToomas Soome #ifndef _MKDTEMP_DECLARED
518*199767f8SToomas Soome char	*mkdtemp(char *);
519*199767f8SToomas Soome #define	_MKDTEMP_DECLARED
520*199767f8SToomas Soome #endif
521*199767f8SToomas Soome #ifndef	_MKNOD_DECLARED
522*199767f8SToomas Soome int	 mknod(const char *, mode_t, dev_t);
523*199767f8SToomas Soome #define	_MKNOD_DECLARED
524*199767f8SToomas Soome #endif
525*199767f8SToomas Soome #ifndef _MKSTEMP_DECLARED
526*199767f8SToomas Soome int	 mkstemp(char *);
527*199767f8SToomas Soome #define	_MKSTEMP_DECLARED
528*199767f8SToomas Soome #endif
529*199767f8SToomas Soome int	 mkstemps(char *, int);
530*199767f8SToomas Soome #ifndef _MKTEMP_DECLARED
531*199767f8SToomas Soome char	*mktemp(char *);
532*199767f8SToomas Soome #define	_MKTEMP_DECLARED
533*199767f8SToomas Soome #endif
534*199767f8SToomas Soome int	 nfssvc(int, void *);
535*199767f8SToomas Soome int	 nlm_syscall(int, int, int, char **);
536*199767f8SToomas Soome int	 pipe2(int *, int);
537*199767f8SToomas Soome int	 profil(char *, size_t, vm_offset_t, int);
538*199767f8SToomas Soome int	 rcmd(char **, int, const char *, const char *, const char *, int *);
539*199767f8SToomas Soome int	 rcmd_af(char **, int, const char *,
540*199767f8SToomas Soome 		const char *, const char *, int *, int);
541*199767f8SToomas Soome int	 rcmdsh(char **, int, const char *,
542*199767f8SToomas Soome 		const char *, const char *, const char *);
543*199767f8SToomas Soome char	*re_comp(const char *);
544*199767f8SToomas Soome int	 re_exec(const char *);
545*199767f8SToomas Soome int	 reboot(int);
546*199767f8SToomas Soome int	 revoke(const char *);
547*199767f8SToomas Soome pid_t	 rfork(int);
548*199767f8SToomas Soome pid_t	 rfork_thread(int, void *, int (*)(void *), void *);
549*199767f8SToomas Soome int	 rresvport(int *);
550*199767f8SToomas Soome int	 rresvport_af(int *, int);
551*199767f8SToomas Soome int	 ruserok(const char *, int, const char *, const char *);
552*199767f8SToomas Soome #if __BSD_VISIBLE
553*199767f8SToomas Soome #ifndef _SELECT_DECLARED
554*199767f8SToomas Soome #define	_SELECT_DECLARED
555*199767f8SToomas Soome int	 select(int, fd_set *, fd_set *, fd_set *, struct timeval *);
556*199767f8SToomas Soome #endif
557*199767f8SToomas Soome #endif
558*199767f8SToomas Soome int	 setdomainname(const char *, int);
559*199767f8SToomas Soome int	 setgroups(int, const gid_t *);
560*199767f8SToomas Soome void	 sethostid(long);
561*199767f8SToomas Soome int	 sethostname(const char *, int);
562*199767f8SToomas Soome #ifndef _SETKEY_DECLARED
563*199767f8SToomas Soome int	 setkey(const char *);
564*199767f8SToomas Soome #define	_SETKEY_DECLARED
565*199767f8SToomas Soome #endif
566*199767f8SToomas Soome int	 setlogin(const char *);
567*199767f8SToomas Soome int	 setloginclass(const char *);
568*199767f8SToomas Soome void	*setmode(const char *);
569*199767f8SToomas Soome int	 setpgrp(pid_t, pid_t);			/* obsoleted by setpgid() */
570*199767f8SToomas Soome void	 setproctitle(const char *_fmt, ...) __printf0like(1, 2);
571*199767f8SToomas Soome int	 setresgid(gid_t, gid_t, gid_t);
572*199767f8SToomas Soome int	 setresuid(uid_t, uid_t, uid_t);
573*199767f8SToomas Soome int	 setrgid(gid_t);
574*199767f8SToomas Soome int	 setruid(uid_t);
575*199767f8SToomas Soome void	 setusershell(void);
576*199767f8SToomas Soome int	 strtofflags(char **, u_long *, u_long *);
577*199767f8SToomas Soome int	 swapon(const char *);
578*199767f8SToomas Soome int	 swapoff(const char *);
579*199767f8SToomas Soome int	 syscall(int, ...);
580*199767f8SToomas Soome off_t	 __syscall(quad_t, ...);
581*199767f8SToomas Soome int	 undelete(const char *);
582*199767f8SToomas Soome int	 unwhiteout(const char *);
583*199767f8SToomas Soome void	*valloc(size_t);			/* obsoleted by malloc() */
584*199767f8SToomas Soome 
585*199767f8SToomas Soome #ifndef _OPTRESET_DECLARED
586*199767f8SToomas Soome #define	_OPTRESET_DECLARED
587*199767f8SToomas Soome extern int optreset;			/* getopt(3) external variable */
588*199767f8SToomas Soome #endif
589*199767f8SToomas Soome #endif /* __BSD_VISIBLE */
590*199767f8SToomas Soome __END_DECLS
591*199767f8SToomas Soome 
592*199767f8SToomas Soome #endif /* !_UNISTD_H_ */
593