xref: /minix3/include/unistd.h (revision 08cbf5a04d9d252f1eec34cb0fea3101e5fa9b88)
10a6a1f1dSLionel Sambuc /*	$NetBSD: unistd.h,v 1.145 2015/03/24 07:44:52 wiz Exp $	*/
29865aeaaSBen Gras 
32fe8fb19SBen Gras /*-
42fe8fb19SBen Gras  * Copyright (c) 1998, 1999, 2008 The NetBSD Foundation, Inc.
52fe8fb19SBen Gras  * All rights reserved.
62fe8fb19SBen Gras  *
72fe8fb19SBen Gras  * This code is derived from software contributed to The NetBSD Foundation
82fe8fb19SBen Gras  * by Klaus Klein.
92fe8fb19SBen Gras  *
102fe8fb19SBen Gras  * Redistribution and use in source and binary forms, with or without
112fe8fb19SBen Gras  * modification, are permitted provided that the following conditions
122fe8fb19SBen Gras  * are met:
132fe8fb19SBen Gras  * 1. Redistributions of source code must retain the above copyright
142fe8fb19SBen Gras  *    notice, this list of conditions and the following disclaimer.
152fe8fb19SBen Gras  * 2. Redistributions in binary form must reproduce the above copyright
162fe8fb19SBen Gras  *    notice, this list of conditions and the following disclaimer in the
172fe8fb19SBen Gras  *    documentation and/or other materials provided with the distribution.
182fe8fb19SBen Gras  *
192fe8fb19SBen Gras  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
202fe8fb19SBen Gras  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
212fe8fb19SBen Gras  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
222fe8fb19SBen Gras  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
232fe8fb19SBen Gras  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
242fe8fb19SBen Gras  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
252fe8fb19SBen Gras  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
262fe8fb19SBen Gras  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
272fe8fb19SBen Gras  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
282fe8fb19SBen Gras  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
292fe8fb19SBen Gras  * POSSIBILITY OF SUCH DAMAGE.
302fe8fb19SBen Gras  */
319865aeaaSBen Gras 
322fe8fb19SBen Gras /*
332fe8fb19SBen Gras  * Copyright (c) 1991, 1993, 1994
342fe8fb19SBen Gras  *	The Regents of the University of California.  All rights reserved.
352fe8fb19SBen Gras  *
362fe8fb19SBen Gras  * Redistribution and use in source and binary forms, with or without
372fe8fb19SBen Gras  * modification, are permitted provided that the following conditions
382fe8fb19SBen Gras  * are met:
392fe8fb19SBen Gras  * 1. Redistributions of source code must retain the above copyright
402fe8fb19SBen Gras  *    notice, this list of conditions and the following disclaimer.
412fe8fb19SBen Gras  * 2. Redistributions in binary form must reproduce the above copyright
422fe8fb19SBen Gras  *    notice, this list of conditions and the following disclaimer in the
432fe8fb19SBen Gras  *    documentation and/or other materials provided with the distribution.
442fe8fb19SBen Gras  * 3. Neither the name of the University nor the names of its contributors
452fe8fb19SBen Gras  *    may be used to endorse or promote products derived from this software
462fe8fb19SBen Gras  *    without specific prior written permission.
472fe8fb19SBen Gras  *
482fe8fb19SBen Gras  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
492fe8fb19SBen Gras  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
502fe8fb19SBen Gras  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
512fe8fb19SBen Gras  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
522fe8fb19SBen Gras  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
532fe8fb19SBen Gras  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
542fe8fb19SBen Gras  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
552fe8fb19SBen Gras  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
562fe8fb19SBen Gras  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
572fe8fb19SBen Gras  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
582fe8fb19SBen Gras  * SUCH DAMAGE.
592fe8fb19SBen Gras  *
602fe8fb19SBen Gras  *	@(#)unistd.h	8.12 (Berkeley) 4/27/95
612fe8fb19SBen Gras  */
622fe8fb19SBen Gras 
632fe8fb19SBen Gras #ifndef _UNISTD_H_
642fe8fb19SBen Gras #define	_UNISTD_H_
652fe8fb19SBen Gras 
662fe8fb19SBen Gras #include <machine/ansi.h>
672fe8fb19SBen Gras #include <machine/int_types.h>
682fe8fb19SBen Gras #include <sys/cdefs.h>
692fe8fb19SBen Gras #include <sys/featuretest.h>
702fe8fb19SBen Gras #include <sys/types.h>
712fe8fb19SBen Gras #include <sys/unistd.h>
722fe8fb19SBen Gras 
732fe8fb19SBen Gras #if _FORTIFY_SOURCE > 0
742fe8fb19SBen Gras #include <ssp/unistd.h>
759865aeaaSBen Gras #endif
769865aeaaSBen Gras 
772fe8fb19SBen Gras /*
782fe8fb19SBen Gras  * IEEE Std 1003.1-90
792fe8fb19SBen Gras  */
802fe8fb19SBen Gras #define	STDIN_FILENO	0	/* standard input file descriptor */
812fe8fb19SBen Gras #define	STDOUT_FILENO	1	/* standard output file descriptor */
822fe8fb19SBen Gras #define	STDERR_FILENO	2	/* standard error file descriptor */
8317a0731fSThomas Veerman 
84dbde088dSArun Thomas #include <sys/null.h>
859865aeaaSBen Gras 
862fe8fb19SBen Gras __BEGIN_DECLS
872fe8fb19SBen Gras __dead	 void _exit(int);
882fe8fb19SBen Gras int	 access(const char *, int);
892fe8fb19SBen Gras unsigned int alarm(unsigned int);
902fe8fb19SBen Gras int	 chdir(const char *);
91d3b0a89bSLionel Sambuc #if defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE)
922fe8fb19SBen Gras int	chown(const char *, uid_t, gid_t) __RENAME(__posix_chown);
932fe8fb19SBen Gras #else
942fe8fb19SBen Gras int	chown(const char *, uid_t, gid_t);
952fe8fb19SBen Gras #endif /* defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE) */
962fe8fb19SBen Gras int	 close(int);
972fe8fb19SBen Gras size_t	 confstr(int, char *, size_t);
982fe8fb19SBen Gras #ifndef __CUSERID_DECLARED
992fe8fb19SBen Gras #define __CUSERID_DECLARED
1002fe8fb19SBen Gras /* also declared in stdio.h */
1012fe8fb19SBen Gras char	*cuserid(char *);	/* obsolete */
1022fe8fb19SBen Gras #endif /* __CUSERID_DECLARED */
1032fe8fb19SBen Gras int	 dup(int);
1042fe8fb19SBen Gras int	 dup2(int, int);
1052fe8fb19SBen Gras int	 execl(const char *, const char *, ...);
1062fe8fb19SBen Gras int	 execle(const char *, const char *, ...);
1072fe8fb19SBen Gras int	 execlp(const char *, const char *, ...);
1082fe8fb19SBen Gras int	 execv(const char *, char * const *);
1092fe8fb19SBen Gras int	 execve(const char *, char * const *, char * const *);
1102fe8fb19SBen Gras int	 execvp(const char *, char * const *);
1112fe8fb19SBen Gras pid_t	 fork(void);
1122fe8fb19SBen Gras long	 fpathconf(int, int);
1132fe8fb19SBen Gras #if __SSP_FORTIFY_LEVEL == 0
1142fe8fb19SBen Gras char	*getcwd(char *, size_t);
1152fe8fb19SBen Gras #endif
1162fe8fb19SBen Gras gid_t	 getegid(void);
1172fe8fb19SBen Gras uid_t	 geteuid(void);
1182fe8fb19SBen Gras gid_t	 getgid(void);
1192fe8fb19SBen Gras int	 getgroups(int, gid_t []);
1202fe8fb19SBen Gras __aconst char *getlogin(void);
1212fe8fb19SBen Gras int	 getlogin_r(char *, size_t);
1222fe8fb19SBen Gras pid_t	 getpgrp(void);
1232fe8fb19SBen Gras pid_t	 getpid(void);
1242fe8fb19SBen Gras pid_t	 getppid(void);
1252fe8fb19SBen Gras uid_t	 getuid(void);
1262fe8fb19SBen Gras int	 isatty(int);
1272fe8fb19SBen Gras int	 link(const char *, const char *);
1282fe8fb19SBen Gras long	 pathconf(const char *, int);
1292fe8fb19SBen Gras int	 pause(void);
1302fe8fb19SBen Gras int	 pipe(int *);
1312fe8fb19SBen Gras #if __SSP_FORTIFY_LEVEL == 0
1322fe8fb19SBen Gras ssize_t	 read(int, void *, size_t);
1332fe8fb19SBen Gras #endif
1342fe8fb19SBen Gras int	 rmdir(const char *);
1352fe8fb19SBen Gras int	 setgid(gid_t);
1362fe8fb19SBen Gras int	 setpgid(pid_t, pid_t);
1372fe8fb19SBen Gras pid_t	 setsid(void);
1382fe8fb19SBen Gras int	 setuid(uid_t);
1392fe8fb19SBen Gras unsigned int	 sleep(unsigned int);
1402fe8fb19SBen Gras long	 sysconf(int);
1412fe8fb19SBen Gras pid_t	 tcgetpgrp(int);
1422fe8fb19SBen Gras int	 tcsetpgrp(int, pid_t);
1432fe8fb19SBen Gras __aconst char *ttyname(int);
1442fe8fb19SBen Gras int	 unlink(const char *);
1452fe8fb19SBen Gras ssize_t	 write(int, const void *, size_t);
1469865aeaaSBen Gras 
1479865aeaaSBen Gras 
1482fe8fb19SBen Gras /*
1492fe8fb19SBen Gras  * IEEE Std 1003.2-92, adopted in X/Open Portability Guide Issue 4 and later
1509865aeaaSBen Gras  */
1512fe8fb19SBen Gras #if (_POSIX_C_SOURCE - 0) >= 2 || defined(_XOPEN_SOURCE) || \
1522fe8fb19SBen Gras     defined(_NETBSD_SOURCE)
1532fe8fb19SBen Gras int	 getopt(int, char * const [], const char *);
1549865aeaaSBen Gras 
1552fe8fb19SBen Gras extern	 char *optarg;			/* getopt(3) external variables */
1562fe8fb19SBen Gras extern	 int opterr;
1572fe8fb19SBen Gras extern	 int optind;
1582fe8fb19SBen Gras extern	 int optopt;
1592fe8fb19SBen Gras #endif
1609865aeaaSBen Gras 
1612fe8fb19SBen Gras /*
1620a6a1f1dSLionel Sambuc  * The Open Group Base Specifications, Issue 5; IEEE Std 1003.1-2001 (POSIX)
1630a6a1f1dSLionel Sambuc  */
1640a6a1f1dSLionel Sambuc #if (_POSIX_C_SOURCE - 0) >= 200112L || (_XOPEN_SOURCE - 0) >= 500 || \
1650a6a1f1dSLionel Sambuc     defined(_NETBSD_SOURCE)
1660a6a1f1dSLionel Sambuc #if __SSP_FORTIFY_LEVEL == 0
1670a6a1f1dSLionel Sambuc ssize_t	 readlink(const char * __restrict, char * __restrict, size_t);
1680a6a1f1dSLionel Sambuc #endif
1690a6a1f1dSLionel Sambuc #endif
1700a6a1f1dSLionel Sambuc 
1710a6a1f1dSLionel Sambuc /*
1722fe8fb19SBen Gras  * The Open Group Base Specifications, Issue 6; IEEE Std 1003.1-2001 (POSIX)
1732fe8fb19SBen Gras  */
1742fe8fb19SBen Gras #if (_POSIX_C_SOURCE - 0) >= 200112L || (_XOPEN_SOURCE - 0) >= 600 || \
1752fe8fb19SBen Gras     defined(_NETBSD_SOURCE)
1760a6a1f1dSLionel Sambuc #if !defined(__minix)
1770a6a1f1dSLionel Sambuc int	 posix_fallocate(int, off_t, off_t);
1780a6a1f1dSLionel Sambuc #endif /* !defined(__minix) */
1792fe8fb19SBen Gras int	 setegid(gid_t);
1802fe8fb19SBen Gras int	 seteuid(uid_t);
1812fe8fb19SBen Gras #endif
182dc23e18cSPhilip Homburg 
1832fe8fb19SBen Gras /*
1842fe8fb19SBen Gras  * The following three syscalls are also defined in <sys/types.h>
1852fe8fb19SBen Gras  * We protect them against double declarations.
1862fe8fb19SBen Gras  */
1872fe8fb19SBen Gras #ifndef __OFF_T_SYSCALLS_DECLARED
1882fe8fb19SBen Gras #define __OFF_T_SYSCALLS_DECLARED
1892fe8fb19SBen Gras off_t	 lseek(int, off_t, int);
1902fe8fb19SBen Gras int	 truncate(const char *, off_t);
1912fe8fb19SBen Gras /*
1922fe8fb19SBen Gras  * IEEE Std 1003.1b-93,
1932fe8fb19SBen Gras  * also found in X/Open Portability Guide >= Issue 4 Verion 2
1942fe8fb19SBen Gras  */
1952fe8fb19SBen Gras #if (_POSIX_C_SOURCE - 0) >= 199309L || \
1962fe8fb19SBen Gras     (defined(_XOPEN_SOURCE) && defined(_XOPEN_SOURCE_EXTENDED)) || \
1972fe8fb19SBen Gras     (_XOPEN_SOURCE - 0) >= 500 || defined(_NETBSD_SOURCE)
1982fe8fb19SBen Gras int	 ftruncate(int, off_t);
1992fe8fb19SBen Gras #endif
2002fe8fb19SBen Gras #endif /* __OFF_T_SYSCALLS_DECLARED */
20125dc0fc3SKees van Reeuwijk 
20225dc0fc3SKees van Reeuwijk 
2032fe8fb19SBen Gras /*
2042fe8fb19SBen Gras  * IEEE Std 1003.1b-93, adopted in X/Open CAE Specification Issue 5 Version 2
2052fe8fb19SBen Gras  */
2062fe8fb19SBen Gras #if (_POSIX_C_SOURCE - 0) >= 199309L || (_XOPEN_SOURCE - 0) >= 500 || \
2072fe8fb19SBen Gras     defined(_NETBSD_SOURCE)
20884d9c625SLionel Sambuc #if !defined(__minix)
2092fe8fb19SBen Gras int	 fdatasync(int);
21084d9c625SLionel Sambuc #endif /* !defined(__minix) */
2112fe8fb19SBen Gras int	 fsync(int);
2122fe8fb19SBen Gras #endif
21325dc0fc3SKees van Reeuwijk 
2142fe8fb19SBen Gras 
2152fe8fb19SBen Gras /*
2162fe8fb19SBen Gras  * IEEE Std 1003.1c-95, also adopted by X/Open CAE Spec Issue 5 Version 2
2172fe8fb19SBen Gras  */
2182fe8fb19SBen Gras #if (_POSIX_C_SOURCE - 0) >= 199506L || (_XOPEN_SOURCE - 0) >= 500 || \
2192fe8fb19SBen Gras     defined(_REENTRANT) || defined(_NETBSD_SOURCE)
2202fe8fb19SBen Gras int	 ttyname_r(int, char *, size_t);
2212fe8fb19SBen Gras int	 pthread_atfork(void (*)(void), void (*)(void), void (*)(void));
2222fe8fb19SBen Gras #endif
2232fe8fb19SBen Gras 
2242fe8fb19SBen Gras /*
2252fe8fb19SBen Gras  * X/Open Portability Guide, all issues
2262fe8fb19SBen Gras  */
2272fe8fb19SBen Gras #if defined(_XOPEN_SOURCE) || defined(_NETBSD_SOURCE)
2282fe8fb19SBen Gras int	 chroot(const char *);
2292fe8fb19SBen Gras int	 nice(int);
2302fe8fb19SBen Gras #endif
2312fe8fb19SBen Gras 
2322fe8fb19SBen Gras 
2332fe8fb19SBen Gras /*
2342fe8fb19SBen Gras  * X/Open Portability Guide >= Issue 4
2352fe8fb19SBen Gras  */
2362fe8fb19SBen Gras #if defined(_XOPEN_SOURCE) || defined(_NETBSD_SOURCE)
2372fe8fb19SBen Gras __aconst char *crypt(const char *, const char *);
2382fe8fb19SBen Gras int	 encrypt(char *, int);
2392fe8fb19SBen Gras char	*getpass(const char *);
2402fe8fb19SBen Gras pid_t	 getsid(pid_t);
2412fe8fb19SBen Gras #endif
2422fe8fb19SBen Gras 
2432fe8fb19SBen Gras 
2442fe8fb19SBen Gras /*
2452fe8fb19SBen Gras  * X/Open Portability Guide >= Issue 4 Version 2
2462fe8fb19SBen Gras  */
2472fe8fb19SBen Gras #if (defined(_XOPEN_SOURCE) && defined(_XOPEN_SOURCE_EXTENDED)) || \
2482fe8fb19SBen Gras     (_XOPEN_SOURCE - 0) >= 500 || defined(_NETBSD_SOURCE)
2492fe8fb19SBen Gras #ifndef	intptr_t
2502fe8fb19SBen Gras typedef	__intptr_t	intptr_t;
2512fe8fb19SBen Gras #define	intptr_t	__intptr_t
2522fe8fb19SBen Gras #endif
2532fe8fb19SBen Gras 
2542fe8fb19SBen Gras #define F_ULOCK		0
2552fe8fb19SBen Gras #define F_LOCK		1
2562fe8fb19SBen Gras #define F_TLOCK		2
2572fe8fb19SBen Gras #define F_TEST		3
2582fe8fb19SBen Gras 
2592fe8fb19SBen Gras int	 brk(void *);
2602fe8fb19SBen Gras int	 fchdir(int);
261d3b0a89bSLionel Sambuc #if defined(_XOPEN_SOURCE)
2622fe8fb19SBen Gras int	 fchown(int, uid_t, gid_t) __RENAME(__posix_fchown);
2632fe8fb19SBen Gras #else
2642fe8fb19SBen Gras int	 fchown(int, uid_t, gid_t);
2652fe8fb19SBen Gras #endif
2662fe8fb19SBen Gras int	 getdtablesize(void);
2672fe8fb19SBen Gras long	 gethostid(void);
2682fe8fb19SBen Gras int	 gethostname(char *, size_t);
2692fe8fb19SBen Gras __pure int
2702fe8fb19SBen Gras 	 getpagesize(void);		/* legacy */
27184d9c625SLionel Sambuc #if !defined(__minix)
2722fe8fb19SBen Gras pid_t	 getpgid(pid_t);
27318f97ad4SLionel Sambuc #endif /* !defined(__minix) */
2742fe8fb19SBen Gras #if defined(_XOPEN_SOURCE)
2752fe8fb19SBen Gras int	 lchown(const char *, uid_t, gid_t) __RENAME(__posix_lchown);
2762fe8fb19SBen Gras #else
2772fe8fb19SBen Gras int	 lchown(const char *, uid_t, gid_t);
2782fe8fb19SBen Gras #endif
2792fe8fb19SBen Gras int	 lockf(int, int, off_t);
2802fe8fb19SBen Gras #if __SSP_FORTIFY_LEVEL == 0
2812fe8fb19SBen Gras ssize_t	 readlink(const char * __restrict, char * __restrict, size_t);
2822fe8fb19SBen Gras #endif
2832fe8fb19SBen Gras void	*sbrk(intptr_t);
2842fe8fb19SBen Gras /* XXX prototype wrong! */
2852fe8fb19SBen Gras int	 setpgrp(pid_t, pid_t);			/* obsoleted by setpgid() */
286*08cbf5a0SDavid van Moolenbroek #if !defined(__minix)
2872fe8fb19SBen Gras int	 setregid(gid_t, gid_t);
2882fe8fb19SBen Gras int	 setreuid(uid_t, uid_t);
28984d9c625SLionel Sambuc #endif /* !defined(__minix) */
2902fe8fb19SBen Gras void	 swab(const void * __restrict, void * __restrict, ssize_t);
2912fe8fb19SBen Gras int	 symlink(const char *, const char *);
2922fe8fb19SBen Gras void	 sync(void);
2932fe8fb19SBen Gras useconds_t ualarm(useconds_t, useconds_t);
2942fe8fb19SBen Gras int	 usleep(useconds_t);
2952fe8fb19SBen Gras #ifndef __LIBC12_SOURCE__
296f14fb602SLionel Sambuc pid_t	 vfork(void) __RENAME(__vfork14) __returns_twice;
2972fe8fb19SBen Gras #endif
2982fe8fb19SBen Gras 
2992fe8fb19SBen Gras #ifndef __AUDIT__
3002fe8fb19SBen Gras char	*getwd(char *);				/* obsoleted by getcwd() */
3012fe8fb19SBen Gras #endif
3022fe8fb19SBen Gras #endif /* _XOPEN_SOURCE_EXTENDED || _XOPEN_SOURCE >= 500 || _NETBSD_SOURCE */
3032fe8fb19SBen Gras 
3042fe8fb19SBen Gras 
3052fe8fb19SBen Gras /*
3062fe8fb19SBen Gras  * X/Open CAE Specification Issue 5 Version 2
3072fe8fb19SBen Gras  */
3080a6a1f1dSLionel Sambuc #if (_POSIX_C_SOURCE - 0) >= 200112L || (_XOPEN_SOURCE - 0) >= 500 || \
3090a6a1f1dSLionel Sambuc     defined(_NETBSD_SOURCE)
3102fe8fb19SBen Gras ssize_t	 pread(int, void *, size_t, off_t);
3112fe8fb19SBen Gras ssize_t	 pwrite(int, const void *, size_t, off_t);
3120a6a1f1dSLionel Sambuc #endif /* (_POSIX_C_SOURCE - 0) >= 200112L || ... */
3132fe8fb19SBen Gras 
314f14fb602SLionel Sambuc /*
315f14fb602SLionel Sambuc  * X/Open Extended API set 2 (a.k.a. C063)
316f14fb602SLionel Sambuc  */
31784d9c625SLionel Sambuc #if (_POSIX_C_SOURCE - 0) >= 200809L || (_XOPEN_SOURCE - 0 >= 700) || \
31884d9c625SLionel Sambuc     defined(_INCOMPLETE_XOPEN_C063) || defined(_NETBSD_SOURCE)
319f14fb602SLionel Sambuc int	linkat(int, const char *, int, const char *, int);
320f14fb602SLionel Sambuc int	renameat(int, const char *, int, const char *);
321f14fb602SLionel Sambuc int	faccessat(int, const char *, int, int);
322f14fb602SLionel Sambuc int	fchownat(int, const char *, uid_t, gid_t, int);
3230a6a1f1dSLionel Sambuc ssize_t	readlinkat(int, const char *, char *, size_t);
324f14fb602SLionel Sambuc int	symlinkat(const char *, int, const char *);
325f14fb602SLionel Sambuc int	unlinkat(int, const char *, int);
326f14fb602SLionel Sambuc #endif
32784d9c625SLionel Sambuc #if defined(_INCOMPLETE_XOPEN_C063)
32884d9c625SLionel Sambuc int	fexecve(int, char * const *, char * const *);
32984d9c625SLionel Sambuc #endif
330f14fb602SLionel Sambuc 
3312fe8fb19SBen Gras 
3322fe8fb19SBen Gras /*
3332fe8fb19SBen Gras  * Implementation-defined extensions
3342fe8fb19SBen Gras  */
3352fe8fb19SBen Gras #if defined(_NETBSD_SOURCE)
33684d9c625SLionel Sambuc #if !defined(__minix)
3372fe8fb19SBen Gras int	 acct(const char *);
33884d9c625SLionel Sambuc #endif /* !defined(__minix) */
3392fe8fb19SBen Gras int	 closefrom(int);
3402fe8fb19SBen Gras int	 des_cipher(const char *, char *, long, int);
3412fe8fb19SBen Gras int	 des_setkey(const char *);
342f14fb602SLionel Sambuc int	 dup3(int, int, int);
3432fe8fb19SBen Gras void	 endusershell(void);
3442fe8fb19SBen Gras int	 exect(const char *, char * const *, char * const *);
3450a6a1f1dSLionel Sambuc int	 execvpe(const char *, char * const *, char * const *);
3460a6a1f1dSLionel Sambuc int	 execlpe(const char *, const char *, ...);
3472fe8fb19SBen Gras int	 fchroot(int);
3480a6a1f1dSLionel Sambuc #if !defined(__minix)
3490a6a1f1dSLionel Sambuc int	 fdiscard(int, off_t, off_t);
3500a6a1f1dSLionel Sambuc #endif /* !defined(__minix) */
3512fe8fb19SBen Gras int	 fsync_range(int, int, off_t, off_t);
3522fe8fb19SBen Gras int	 getdomainname(char *, size_t);
3532fe8fb19SBen Gras int	 getgrouplist(const char *, gid_t, gid_t *, int *);
3542fe8fb19SBen Gras int	 getgroupmembership(const char *, gid_t, gid_t *, int, int *);
3552fe8fb19SBen Gras mode_t	 getmode(const void *, mode_t);
356f14fb602SLionel Sambuc char	*getpassfd(const char *, char *, size_t, int *, int, int);
357f14fb602SLionel Sambuc #define	GETPASS_NEED_TTY	0x001	/* Fail if we cannot set tty */
358f14fb602SLionel Sambuc #define	GETPASS_FAIL_EOF	0x002	/* Fail on EOF */
359f14fb602SLionel Sambuc #define	GETPASS_BUF_LIMIT	0x004	/* beep on buffer limit */
360f14fb602SLionel Sambuc #define	GETPASS_NO_SIGNAL	0x008	/* don't make ttychars send signals */
361f14fb602SLionel Sambuc #define	GETPASS_NO_BEEP		0x010	/* don't beep */
362f14fb602SLionel Sambuc #define	GETPASS_ECHO		0x020	/* echo characters as they are typed */
363f14fb602SLionel Sambuc #define	GETPASS_ECHO_STAR	0x040	/* echo '*' for each character */
364f14fb602SLionel Sambuc #define	GETPASS_7BIT		0x080	/* mask the high bit each char */
365f14fb602SLionel Sambuc #define	GETPASS_FORCE_LOWER	0x100	/* lowercase each char */
366f14fb602SLionel Sambuc #define	GETPASS_FORCE_UPPER	0x200	/* uppercase each char */
367f14fb602SLionel Sambuc #define	GETPASS_ECHO_NL		0x400	/* echo a newline if successful */
368f14fb602SLionel Sambuc 
369f14fb602SLionel Sambuc char	*getpass_r(const char *, char *, size_t);
3702fe8fb19SBen Gras int	 getpeereid(int, uid_t *, gid_t *);
3712fe8fb19SBen Gras int	 getsubopt(char **, char * const *, char **);
3722fe8fb19SBen Gras __aconst char *getusershell(void);
3732fe8fb19SBen Gras int	 initgroups(const char *, gid_t);
3742fe8fb19SBen Gras int	 iruserok(uint32_t, int, const char *, const char *);
3752fe8fb19SBen Gras int      issetugid(void);
3760a6a1f1dSLionel Sambuc int	 mkstemps(char *, int);
3772fe8fb19SBen Gras int	 nfssvc(int, void *);
378f14fb602SLionel Sambuc int	 pipe2(int *, int);
37984d9c625SLionel Sambuc #if !defined(__minix)
3802fe8fb19SBen Gras int	 profil(char *, size_t, u_long, u_int);
38184d9c625SLionel Sambuc #endif /* !defined(__minix) */
3822fe8fb19SBen Gras #ifndef __PSIGNAL_DECLARED
3832fe8fb19SBen Gras #define __PSIGNAL_DECLARED
3842fe8fb19SBen Gras /* also in signal.h */
3852fe8fb19SBen Gras void	 psignal(int, const char *);
3862fe8fb19SBen Gras #endif /* __PSIGNAL_DECLARED */
3872fe8fb19SBen Gras int	 rcmd(char **, int, const char *, const char *, const char *, int *);
38850e46307SDavid van Moolenbroek int	 reboot(int, char *);
38984d9c625SLionel Sambuc #if !defined(__minix)
3902fe8fb19SBen Gras int	 revoke(const char *);
39184d9c625SLionel Sambuc #endif /* !defined(__minix) */
3922fe8fb19SBen Gras int	 rresvport(int *);
3932fe8fb19SBen Gras int	 ruserok(const char *, int, const char *, const char *);
3942fe8fb19SBen Gras int	 setdomainname(const char *, size_t);
3952fe8fb19SBen Gras int	 setgroups(int, const gid_t *);
3962fe8fb19SBen Gras int	 sethostid(long);
3972fe8fb19SBen Gras int	 sethostname(const char *, size_t);
3982fe8fb19SBen Gras int	 setlogin(const char *);
3992fe8fb19SBen Gras void	*setmode(const char *);
4002fe8fb19SBen Gras int	 setrgid(gid_t);
4012fe8fb19SBen Gras int	 setruid(uid_t);
4022fe8fb19SBen Gras void	 setusershell(void);
4032fe8fb19SBen Gras void	 strmode(mode_t, char *);
4042fe8fb19SBen Gras #ifndef __STRSIGNAL_DECLARED
4052fe8fb19SBen Gras #define __STRSIGNAL_DECLARED
4062fe8fb19SBen Gras /* backwards-compatibility; also in string.h */
4072fe8fb19SBen Gras __aconst char *strsignal(int);
4082fe8fb19SBen Gras #endif /* __STRSIGNAL_DECLARED */
40984d9c625SLionel Sambuc #if !defined(__minix)
4102fe8fb19SBen Gras int	 swapctl(int, void *, int);
4112fe8fb19SBen Gras int	 swapon(const char *);			/* obsoleted by swapctl() */
41284d9c625SLionel Sambuc #endif /* !defined(__minix) */
4132fe8fb19SBen Gras int	 syscall(int, ...);
4142fe8fb19SBen Gras quad_t	 __syscall(quad_t, ...);
4152fe8fb19SBen Gras int	 undelete(const char *);
4162fe8fb19SBen Gras 
4172fe8fb19SBen Gras #if 1 /*INET6*/
4182fe8fb19SBen Gras int	 rcmd_af(char **, int, const char *,
4192fe8fb19SBen Gras 	    const char *, const char *, int *, int);
4202fe8fb19SBen Gras int	 rresvport_af(int *, int);
421f14fb602SLionel Sambuc int	 rresvport_af_addr(int *, int, void *);
4222fe8fb19SBen Gras int	 iruserok_sa(const void *, int, int, const char *, const char *);
42325dc0fc3SKees van Reeuwijk #endif
42425dc0fc3SKees van Reeuwijk 
4252fe8fb19SBen Gras #ifndef __SYS_SIGLIST_DECLARED
4262fe8fb19SBen Gras #define __SYS_SIGLIST_DECLARED
4272fe8fb19SBen Gras /* also in signal.h */
4282fe8fb19SBen Gras extern const char *const *sys_siglist __RENAME(__sys_siglist14);
4292fe8fb19SBen Gras #endif /* __SYS_SIGLIST_DECLARED */
4302fe8fb19SBen Gras extern	 int optreset;		/* getopt(3) external variable */
4312fe8fb19SBen Gras extern	 char *suboptarg;	/* getsubopt(3) external variable */
4329865aeaaSBen Gras #endif
4339865aeaaSBen Gras 
4342fe8fb19SBen Gras __END_DECLS
4352fe8fb19SBen Gras #endif /* !_UNISTD_H_ */
436