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