Home | History | Annotate | Line # | Download | only in include
      1  1.169       nia /*	$NetBSD: unistd.h,v 1.169 2024/11/01 18:48:17 nia Exp $	*/
      2   1.22       cgd 
      3    1.1       cgd /*-
      4  1.117        ad  * Copyright (c) 1998, 1999, 2008 The NetBSD Foundation, Inc.
      5   1.55    kleink  * All rights reserved.
      6   1.55    kleink  *
      7   1.55    kleink  * This code is derived from software contributed to The NetBSD Foundation
      8   1.55    kleink  * by Klaus Klein.
      9   1.55    kleink  *
     10   1.55    kleink  * Redistribution and use in source and binary forms, with or without
     11   1.55    kleink  * modification, are permitted provided that the following conditions
     12   1.55    kleink  * are met:
     13   1.55    kleink  * 1. Redistributions of source code must retain the above copyright
     14   1.55    kleink  *    notice, this list of conditions and the following disclaimer.
     15   1.55    kleink  * 2. Redistributions in binary form must reproduce the above copyright
     16   1.55    kleink  *    notice, this list of conditions and the following disclaimer in the
     17   1.55    kleink  *    documentation and/or other materials provided with the distribution.
     18   1.55    kleink  *
     19   1.55    kleink  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     20   1.55    kleink  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     21   1.55    kleink  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     22   1.55    kleink  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     23   1.55    kleink  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     24   1.55    kleink  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     25   1.55    kleink  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     26   1.55    kleink  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     27   1.55    kleink  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     28   1.55    kleink  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     29   1.55    kleink  * POSSIBILITY OF SUCH DAMAGE.
     30   1.55    kleink  */
     31   1.55    kleink 
     32   1.55    kleink /*
     33   1.49     perry  * Copyright (c) 1991, 1993, 1994
     34   1.49     perry  *	The Regents of the University of California.  All rights reserved.
     35    1.1       cgd  *
     36    1.1       cgd  * Redistribution and use in source and binary forms, with or without
     37    1.1       cgd  * modification, are permitted provided that the following conditions
     38    1.1       cgd  * are met:
     39    1.1       cgd  * 1. Redistributions of source code must retain the above copyright
     40    1.1       cgd  *    notice, this list of conditions and the following disclaimer.
     41    1.1       cgd  * 2. Redistributions in binary form must reproduce the above copyright
     42    1.1       cgd  *    notice, this list of conditions and the following disclaimer in the
     43    1.1       cgd  *    documentation and/or other materials provided with the distribution.
     44   1.94       agc  * 3. Neither the name of the University nor the names of its contributors
     45    1.1       cgd  *    may be used to endorse or promote products derived from this software
     46    1.1       cgd  *    without specific prior written permission.
     47    1.1       cgd  *
     48    1.1       cgd  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
     49    1.1       cgd  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     50    1.1       cgd  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     51    1.1       cgd  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
     52    1.1       cgd  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     53    1.1       cgd  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     54    1.1       cgd  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     55    1.1       cgd  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     56    1.1       cgd  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     57    1.1       cgd  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     58    1.1       cgd  * SUCH DAMAGE.
     59    1.1       cgd  *
     60   1.49     perry  *	@(#)unistd.h	8.12 (Berkeley) 4/27/95
     61    1.1       cgd  */
     62    1.1       cgd 
     63    1.1       cgd #ifndef _UNISTD_H_
     64    1.1       cgd #define	_UNISTD_H_
     65    1.1       cgd 
     66   1.77    kleink #include <machine/ansi.h>
     67   1.85    kleink #include <machine/int_types.h>
     68    1.1       cgd #include <sys/cdefs.h>
     69   1.64   mycroft #include <sys/featuretest.h>
     70    1.1       cgd #include <sys/types.h>
     71    1.1       cgd #include <sys/unistd.h>
     72   1.50    kleink 
     73  1.125  christos #if _FORTIFY_SOURCE > 0
     74  1.125  christos #include <ssp/unistd.h>
     75  1.125  christos #endif
     76   1.55    kleink 
     77   1.55    kleink /*
     78   1.55    kleink  * IEEE Std 1003.1-90
     79   1.55    kleink  */
     80    1.4       jtc #define	STDIN_FILENO	0	/* standard input file descriptor */
     81    1.1       cgd #define	STDOUT_FILENO	1	/* standard output file descriptor */
     82    1.1       cgd #define	STDERR_FILENO	2	/* standard error file descriptor */
     83    1.1       cgd 
     84   1.80    kleink #include <sys/null.h>
     85    1.1       cgd 
     86    1.1       cgd __BEGIN_DECLS
     87  1.114     perry __dead	 void _exit(int);
     88  1.101     perry int	 access(const char *, int);
     89  1.101     perry unsigned int alarm(unsigned int);
     90  1.101     perry int	 chdir(const char *);
     91   1.55    kleink #if defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE)
     92  1.101     perry int	chown(const char *, uid_t, gid_t) __RENAME(__posix_chown);
     93   1.55    kleink #else
     94  1.101     perry int	chown(const char *, uid_t, gid_t);
     95   1.55    kleink #endif /* defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE) */
     96  1.101     perry int	 close(int);
     97  1.101     perry size_t	 confstr(int, char *, size_t);
     98   1.86  christos #ifndef __CUSERID_DECLARED
     99   1.86  christos #define __CUSERID_DECLARED
    100   1.86  christos /* also declared in stdio.h */
    101  1.101     perry char	*cuserid(char *);	/* obsolete */
    102   1.86  christos #endif /* __CUSERID_DECLARED */
    103  1.101     perry int	 dup(int);
    104  1.101     perry int	 dup2(int, int);
    105  1.161       kre int	 execl(const char *, const char *, ...) __null_sentinel;
    106  1.101     perry int	 execle(const char *, const char *, ...);
    107  1.160  christos int	 execlp(const char *, const char *, ...) __null_sentinel;
    108  1.101     perry int	 execv(const char *, char * const *);
    109  1.101     perry int	 execve(const char *, char * const *, char * const *);
    110  1.101     perry int	 execvp(const char *, char * const *);
    111  1.101     perry pid_t	 fork(void);
    112  1.101     perry long	 fpathconf(int, int);
    113  1.125  christos #if __SSP_FORTIFY_LEVEL == 0
    114  1.101     perry char	*getcwd(char *, size_t);
    115  1.125  christos #endif
    116  1.101     perry gid_t	 getegid(void);
    117  1.101     perry uid_t	 geteuid(void);
    118  1.101     perry gid_t	 getgid(void);
    119  1.101     perry int	 getgroups(int, gid_t []);
    120  1.101     perry __aconst char *getlogin(void);
    121  1.119     lukem int	 getlogin_r(char *, size_t);
    122  1.101     perry pid_t	 getpgrp(void);
    123  1.101     perry pid_t	 getpid(void);
    124  1.101     perry pid_t	 getppid(void);
    125  1.101     perry uid_t	 getuid(void);
    126  1.101     perry int	 isatty(int);
    127  1.101     perry int	 link(const char *, const char *);
    128  1.101     perry long	 pathconf(const char *, int);
    129  1.101     perry int	 pause(void);
    130  1.101     perry int	 pipe(int *);
    131  1.125  christos #if __SSP_FORTIFY_LEVEL == 0
    132  1.101     perry ssize_t	 read(int, void *, size_t);
    133  1.125  christos #endif
    134  1.101     perry int	 rmdir(const char *);
    135  1.101     perry int	 setgid(gid_t);
    136  1.101     perry int	 setpgid(pid_t, pid_t);
    137  1.101     perry pid_t	 setsid(void);
    138  1.101     perry int	 setuid(uid_t);
    139  1.101     perry unsigned int	 sleep(unsigned int);
    140  1.101     perry long	 sysconf(int);
    141  1.101     perry pid_t	 tcgetpgrp(int);
    142  1.101     perry int	 tcsetpgrp(int, pid_t);
    143  1.101     perry __aconst char *ttyname(int);
    144  1.101     perry int	 unlink(const char *);
    145  1.101     perry ssize_t	 write(int, const void *, size_t);
    146    1.1       cgd 
    147   1.55    kleink 
    148   1.55    kleink /*
    149   1.83  christos  * IEEE Std 1003.2-92, adopted in X/Open Portability Guide Issue 4 and later
    150   1.83  christos  */
    151  1.115  drochner #if (_POSIX_C_SOURCE - 0) >= 2 || defined(_XOPEN_SOURCE) || \
    152   1.92     bjh21     defined(_NETBSD_SOURCE)
    153  1.101     perry int	 getopt(int, char * const [], const char *);
    154   1.83  christos 
    155   1.83  christos extern	 char *optarg;			/* getopt(3) external variables */
    156   1.83  christos extern	 int opterr;
    157   1.83  christos extern	 int optind;
    158   1.83  christos extern	 int optopt;
    159   1.83  christos #endif
    160   1.83  christos 
    161   1.89  jdolecek /*
    162  1.140  christos  * The Open Group Base Specifications, Issue 5; IEEE Std 1003.1-2001 (POSIX)
    163  1.140  christos  */
    164  1.140  christos #if (_POSIX_C_SOURCE - 0) >= 200112L || (_XOPEN_SOURCE - 0) >= 500 || \
    165  1.140  christos     defined(_NETBSD_SOURCE)
    166  1.140  christos #if __SSP_FORTIFY_LEVEL == 0
    167  1.140  christos ssize_t	 readlink(const char * __restrict, char * __restrict, size_t);
    168  1.140  christos #endif
    169  1.140  christos #endif
    170  1.140  christos 
    171  1.140  christos /*
    172   1.91    kleink  * The Open Group Base Specifications, Issue 6; IEEE Std 1003.1-2001 (POSIX)
    173   1.89  jdolecek  */
    174   1.92     bjh21 #if (_POSIX_C_SOURCE - 0) >= 200112L || (_XOPEN_SOURCE - 0) >= 600 || \
    175   1.92     bjh21     defined(_NETBSD_SOURCE)
    176  1.168       kre int	 gethostname(char *, size_t);
    177  1.101     perry int	 setegid(gid_t);
    178  1.101     perry int	 seteuid(uid_t);
    179   1.89  jdolecek #endif
    180   1.83  christos 
    181   1.83  christos /*
    182   1.86  christos  * The following three syscalls are also defined in <sys/types.h>
    183   1.86  christos  * We protect them against double declarations.
    184   1.86  christos  */
    185   1.86  christos #ifndef __OFF_T_SYSCALLS_DECLARED
    186   1.86  christos #define __OFF_T_SYSCALLS_DECLARED
    187  1.101     perry off_t	 lseek(int, off_t, int);
    188  1.101     perry int	 truncate(const char *, off_t);
    189   1.86  christos /*
    190   1.55    kleink  * IEEE Std 1003.1b-93,
    191  1.162    andvar  * also found in X/Open Portability Guide >= Issue 4 Version 2
    192   1.55    kleink  */
    193   1.92     bjh21 #if (_POSIX_C_SOURCE - 0) >= 199309L || \
    194   1.55    kleink     (defined(_XOPEN_SOURCE) && defined(_XOPEN_SOURCE_EXTENDED)) || \
    195   1.92     bjh21     (_XOPEN_SOURCE - 0) >= 500 || defined(_NETBSD_SOURCE)
    196  1.101     perry int	 ftruncate(int, off_t);
    197   1.55    kleink #endif
    198   1.86  christos #endif /* __OFF_T_SYSCALLS_DECLARED */
    199   1.55    kleink 
    200   1.55    kleink 
    201   1.55    kleink /*
    202   1.55    kleink  * IEEE Std 1003.1b-93, adopted in X/Open CAE Specification Issue 5 Version 2
    203   1.55    kleink  */
    204   1.92     bjh21 #if (_POSIX_C_SOURCE - 0) >= 199309L || (_XOPEN_SOURCE - 0) >= 500 || \
    205   1.92     bjh21     defined(_NETBSD_SOURCE)
    206  1.101     perry int	 fdatasync(int);
    207  1.101     perry int	 fsync(int);
    208   1.49     perry #endif
    209   1.55    kleink 
    210   1.55    kleink 
    211   1.55    kleink /*
    212  1.108    kleink  * IEEE Std 1003.1c-95, also adopted by X/Open CAE Spec Issue 5 Version 2
    213  1.108    kleink  */
    214  1.108    kleink #if (_POSIX_C_SOURCE - 0) >= 199506L || (_XOPEN_SOURCE - 0) >= 500 || \
    215  1.108    kleink     defined(_REENTRANT) || defined(_NETBSD_SOURCE)
    216  1.108    kleink int	 ttyname_r(int, char *, size_t);
    217  1.149  christos #ifndef __PTHREAD_ATFORK_DECLARED
    218  1.149  christos #define __PTHREAD_ATFORK_DECLARED
    219  1.118        ad int	 pthread_atfork(void (*)(void), void (*)(void), void (*)(void));
    220  1.108    kleink #endif
    221  1.148  christos #endif
    222  1.108    kleink 
    223  1.108    kleink /*
    224   1.55    kleink  * X/Open Portability Guide, all issues
    225   1.55    kleink  */
    226   1.92     bjh21 #if defined(_XOPEN_SOURCE) || defined(_NETBSD_SOURCE)
    227  1.101     perry int	 chroot(const char *);
    228  1.101     perry int	 nice(int);
    229   1.55    kleink #endif
    230   1.55    kleink 
    231   1.55    kleink 
    232   1.55    kleink /*
    233   1.55    kleink  * X/Open Portability Guide >= Issue 4
    234   1.55    kleink  */
    235  1.115  drochner #if defined(_XOPEN_SOURCE) || defined(_NETBSD_SOURCE)
    236  1.101     perry __aconst char *crypt(const char *, const char *);
    237  1.101     perry int	 encrypt(char *, int);
    238  1.101     perry char	*getpass(const char *);
    239  1.155     kamil #endif
    240  1.156     kamil #if defined(_XOPEN_SOURCE) || (_POSIX_C_SOURCE - 0) >= 200809L || \
    241  1.156     kamil     defined(_NETBSD_SOURCE)
    242  1.101     perry pid_t	 getsid(pid_t);
    243   1.55    kleink #endif
    244   1.55    kleink 
    245   1.55    kleink 
    246   1.55    kleink /*
    247   1.55    kleink  * X/Open Portability Guide >= Issue 4 Version 2
    248   1.55    kleink  */
    249   1.92     bjh21 #if (defined(_XOPEN_SOURCE) && defined(_XOPEN_SOURCE_EXTENDED)) || \
    250   1.92     bjh21     (_XOPEN_SOURCE - 0) >= 500 || defined(_NETBSD_SOURCE)
    251  1.151  christos #ifndef _BSD_INTPTR_T_
    252  1.151  christos typedef __intptr_t      intptr_t;
    253  1.151  christos #define _BSD_INTPTR_T_
    254   1.77    kleink #endif
    255   1.77    kleink 
    256   1.55    kleink #define F_ULOCK		0
    257   1.55    kleink #define F_LOCK		1
    258   1.55    kleink #define F_TLOCK		2
    259   1.55    kleink #define F_TEST		3
    260   1.55    kleink 
    261  1.101     perry int	 brk(void *);
    262  1.101     perry int	 fchdir(int);
    263   1.55    kleink #if defined(_XOPEN_SOURCE)
    264  1.101     perry int	 fchown(int, uid_t, gid_t) __RENAME(__posix_fchown);
    265   1.55    kleink #else
    266  1.101     perry int	 fchown(int, uid_t, gid_t);
    267   1.55    kleink #endif
    268  1.101     perry int	 getdtablesize(void);
    269  1.101     perry long	 gethostid(void);
    270   1.55    kleink __pure int
    271  1.101     perry 	 getpagesize(void);		/* legacy */
    272  1.101     perry pid_t	 getpgid(pid_t);
    273   1.55    kleink #if defined(_XOPEN_SOURCE)
    274  1.101     perry int	 lchown(const char *, uid_t, gid_t) __RENAME(__posix_lchown);
    275   1.55    kleink #else
    276  1.101     perry int	 lchown(const char *, uid_t, gid_t);
    277   1.55    kleink #endif
    278  1.101     perry int	 lockf(int, int, off_t);
    279  1.101     perry void	*sbrk(intptr_t);
    280   1.55    kleink /* XXX prototype wrong! */
    281  1.101     perry int	 setpgrp(pid_t, pid_t);			/* obsoleted by setpgid() */
    282  1.101     perry int	 setregid(gid_t, gid_t);
    283  1.101     perry int	 setreuid(uid_t, uid_t);
    284  1.123  christos void	 swab(const void * __restrict, void * __restrict, ssize_t);
    285  1.101     perry int	 symlink(const char *, const char *);
    286  1.101     perry void	 sync(void);
    287  1.101     perry useconds_t ualarm(useconds_t, useconds_t);
    288  1.101     perry int	 usleep(useconds_t);
    289  1.105  christos #ifndef __LIBC12_SOURCE__
    290  1.128     joerg pid_t	 vfork(void) __RENAME(__vfork14) __returns_twice;
    291   1.55    kleink #endif
    292   1.55    kleink 
    293   1.63   mycroft #ifndef __AUDIT__
    294  1.101     perry char	*getwd(char *);				/* obsoleted by getcwd() */
    295   1.63   mycroft #endif
    296   1.92     bjh21 #endif /* _XOPEN_SOURCE_EXTENDED || _XOPEN_SOURCE >= 500 || _NETBSD_SOURCE */
    297   1.58    kleink 
    298   1.58    kleink 
    299   1.58    kleink /*
    300   1.58    kleink  * X/Open CAE Specification Issue 5 Version 2
    301   1.58    kleink  */
    302  1.145       wiz #if (_POSIX_C_SOURCE - 0) >= 200112L || (_XOPEN_SOURCE - 0) >= 500 || \
    303  1.145       wiz     defined(_NETBSD_SOURCE)
    304  1.101     perry ssize_t	 pread(int, void *, size_t, off_t);
    305  1.101     perry ssize_t	 pwrite(int, const void *, size_t, off_t);
    306  1.145       wiz #endif /* (_POSIX_C_SOURCE - 0) >= 200112L || ... */
    307   1.55    kleink 
    308  1.127      manu /*
    309  1.127      manu  * X/Open Extended API set 2 (a.k.a. C063)
    310  1.127      manu  */
    311  1.136      manu #if (_POSIX_C_SOURCE - 0) >= 200809L || (_XOPEN_SOURCE - 0 >= 700) || \
    312  1.153  christos     defined(_NETBSD_SOURCE)
    313  1.127      manu int	linkat(int, const char *, int, const char *, int);
    314  1.127      manu int	renameat(int, const char *, int, const char *);
    315  1.127      manu int	faccessat(int, const char *, int, int);
    316  1.127      manu int	fchownat(int, const char *, uid_t, gid_t, int);
    317  1.144  christos ssize_t	readlinkat(int, const char *, char *, size_t);
    318  1.127      manu int	symlinkat(const char *, int, const char *);
    319  1.127      manu int	unlinkat(int, const char *, int);
    320  1.136      manu int	fexecve(int, char * const *, char * const *);
    321  1.136      manu #endif
    322  1.127      manu 
    323  1.167  riastrad /*
    324  1.167  riastrad  * IEEE Std 1003.1-2024 (POSIX.1-2024)
    325  1.167  riastrad  */
    326  1.167  riastrad #if (_POSIX_C_SOURCE - 0) >= 202405L || (_XOPEN_SOURCE - 0 >= 800) || \
    327  1.167  riastrad     defined(_NETBSD_SOURCE)
    328  1.167  riastrad int	 getentropy(void *, size_t);
    329  1.169       nia #ifndef __LIBC12_SOURCE__
    330  1.169       nia int	 dup3(int, int, int) __RENAME(__dup3100);
    331  1.169       nia #endif
    332  1.169       nia int	 pipe2(int *, int);
    333  1.167  riastrad #endif
    334  1.167  riastrad 
    335   1.55    kleink /*
    336   1.55    kleink  * Implementation-defined extensions
    337   1.55    kleink  */
    338   1.92     bjh21 #if defined(_NETBSD_SOURCE)
    339  1.101     perry int	 acct(const char *);
    340  1.101     perry int	 closefrom(int);
    341  1.101     perry int	 des_cipher(const char *, char *, long, int);
    342  1.101     perry int	 des_setkey(const char *);
    343  1.101     perry void	 endusershell(void);
    344  1.101     perry int	 exect(const char *, char * const *, char * const *);
    345  1.143  christos int	 execvpe(const char *, char * const *, char * const *);
    346  1.143  christos int	 execlpe(const char *, const char *, ...);
    347  1.101     perry int	 fchroot(int);
    348  1.142  dholland int	 fdiscard(int, off_t, off_t);
    349  1.101     perry int	 fsync_range(int, int, off_t, off_t);
    350  1.101     perry int	 getdomainname(char *, size_t);
    351  1.101     perry int	 getgrouplist(const char *, gid_t, gid_t *, int *);
    352  1.101     perry int	 getgroupmembership(const char *, gid_t, gid_t *, int, int *);
    353  1.101     perry mode_t	 getmode(const void *, mode_t);
    354  1.134  christos char	*getpassfd(const char *, char *, size_t, int *, int, int);
    355  1.133  christos #define	GETPASS_NEED_TTY	0x001	/* Fail if we cannot set tty */
    356  1.133  christos #define	GETPASS_FAIL_EOF	0x002	/* Fail on EOF */
    357  1.133  christos #define	GETPASS_BUF_LIMIT	0x004	/* beep on buffer limit */
    358  1.133  christos #define	GETPASS_NO_SIGNAL	0x008	/* don't make ttychars send signals */
    359  1.133  christos #define	GETPASS_NO_BEEP		0x010	/* don't beep */
    360  1.133  christos #define	GETPASS_ECHO		0x020	/* echo characters as they are typed */
    361  1.133  christos #define	GETPASS_ECHO_STAR	0x040	/* echo '*' for each character */
    362  1.133  christos #define	GETPASS_7BIT		0x080	/* mask the high bit each char */
    363  1.133  christos #define	GETPASS_FORCE_LOWER	0x100	/* lowercase each char */
    364  1.133  christos #define	GETPASS_FORCE_UPPER	0x200	/* uppercase each char */
    365  1.134  christos #define	GETPASS_ECHO_NL		0x400	/* echo a newline if successful */
    366  1.133  christos 
    367  1.129  christos char	*getpass_r(const char *, char *, size_t);
    368  1.113        he int	 getpeereid(int, uid_t *, gid_t *);
    369  1.101     perry __aconst char *getusershell(void);
    370  1.101     perry int	 initgroups(const char *, gid_t);
    371  1.110     perry int	 iruserok(uint32_t, int, const char *, const char *);
    372  1.101     perry int      issetugid(void);
    373  1.158  christos long	 lpathconf(const char *, int);
    374  1.141  christos int	 mkstemps(char *, int);
    375  1.101     perry int	 nfssvc(int, void *);
    376  1.146     kamil int	 profil(char *, size_t, unsigned long, unsigned int);
    377   1.86  christos #ifndef __PSIGNAL_DECLARED
    378   1.86  christos #define __PSIGNAL_DECLARED
    379   1.86  christos /* also in signal.h */
    380  1.126  christos void	 psignal(int, const char *);
    381   1.86  christos #endif /* __PSIGNAL_DECLARED */
    382  1.101     perry int	 rcmd(char **, int, const char *, const char *, const char *, int *);
    383  1.101     perry int	 reboot(int, char *);
    384  1.101     perry int	 revoke(const char *);
    385  1.101     perry int	 rresvport(int *);
    386  1.101     perry int	 ruserok(const char *, int, const char *, const char *);
    387  1.101     perry int	 setdomainname(const char *, size_t);
    388  1.101     perry int	 setgroups(int, const gid_t *);
    389  1.101     perry int	 sethostid(long);
    390  1.101     perry int	 sethostname(const char *, size_t);
    391  1.101     perry int	 setlogin(const char *);
    392  1.101     perry void	*setmode(const char *);
    393  1.101     perry int	 setrgid(gid_t);
    394  1.101     perry int	 setruid(uid_t);
    395  1.101     perry void	 setusershell(void);
    396  1.101     perry void	 strmode(mode_t, char *);
    397  1.121    kleink #ifndef __STRSIGNAL_DECLARED
    398  1.121    kleink #define __STRSIGNAL_DECLARED
    399  1.121    kleink /* backwards-compatibility; also in string.h */
    400  1.101     perry __aconst char *strsignal(int);
    401  1.121    kleink #endif /* __STRSIGNAL_DECLARED */
    402  1.104  christos int	 swapctl(int, void *, int);
    403  1.101     perry int	 swapon(const char *);			/* obsoleted by swapctl() */
    404  1.101     perry int	 syscall(int, ...);
    405  1.101     perry quad_t	 __syscall(quad_t, ...);
    406  1.101     perry int	 undelete(const char *);
    407    1.1       cgd 
    408   1.76    kleink #if 1 /*INET6*/
    409  1.101     perry int	 rcmd_af(char **, int, const char *,
    410  1.101     perry 	    const char *, const char *, int *, int);
    411  1.101     perry int	 rresvport_af(int *, int);
    412  1.135   darrenr int	 rresvport_af_addr(int *, int, void *);
    413  1.101     perry int	 iruserok_sa(const void *, int, int, const char *, const char *);
    414   1.76    kleink #endif
    415   1.76    kleink 
    416   1.86  christos #ifndef __SYS_SIGLIST_DECLARED
    417   1.86  christos #define __SYS_SIGLIST_DECLARED
    418   1.86  christos /* also in signal.h */
    419  1.109     perry extern const char *const *sys_siglist __RENAME(__sys_siglist14);
    420   1.86  christos #endif /* __SYS_SIGLIST_DECLARED */
    421   1.83  christos extern	 int optreset;		/* getopt(3) external variable */
    422   1.83  christos extern	 char *suboptarg;	/* getsubopt(3) external variable */
    423   1.54    kleink #endif
    424   1.46    kleink 
    425  1.164  christos #ifdef _LIBC_INTERNAL
    426  1.164  christos pid_t	__fork(void);
    427  1.164  christos pid_t	__locked_fork(int *) __weak;
    428  1.164  christos #endif
    429  1.164  christos 
    430    1.1       cgd __END_DECLS
    431    1.1       cgd #endif /* !_UNISTD_H_ */
    432