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