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