unistd.h revision 37566
11539Srgrimes/*-
21539Srgrimes * Copyright (c) 1991, 1993, 1994
31539Srgrimes *	The Regents of the University of California.  All rights reserved.
41539Srgrimes *
51539Srgrimes * Redistribution and use in source and binary forms, with or without
61539Srgrimes * modification, are permitted provided that the following conditions
71539Srgrimes * are met:
81539Srgrimes * 1. Redistributions of source code must retain the above copyright
91539Srgrimes *    notice, this list of conditions and the following disclaimer.
101539Srgrimes * 2. Redistributions in binary form must reproduce the above copyright
111539Srgrimes *    notice, this list of conditions and the following disclaimer in the
121539Srgrimes *    documentation and/or other materials provided with the distribution.
131539Srgrimes * 3. All advertising materials mentioning features or use of this software
141539Srgrimes *    must display the following acknowledgement:
151539Srgrimes *	This product includes software developed by the University of
161539Srgrimes *	California, Berkeley and its contributors.
171539Srgrimes * 4. Neither the name of the University nor the names of its contributors
181539Srgrimes *    may be used to endorse or promote products derived from this software
191539Srgrimes *    without specific prior written permission.
201539Srgrimes *
211539Srgrimes * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
221539Srgrimes * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
231539Srgrimes * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
241539Srgrimes * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
251539Srgrimes * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
261539Srgrimes * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
271539Srgrimes * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
281539Srgrimes * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
291539Srgrimes * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
301539Srgrimes * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
311539Srgrimes * SUCH DAMAGE.
321539Srgrimes *
3323657Speter *	@(#)unistd.h	8.12 (Berkeley) 4/27/95
341539Srgrimes */
351539Srgrimes
361539Srgrimes#ifndef _UNISTD_H_
371539Srgrimes#define	_UNISTD_H_
381539Srgrimes
391539Srgrimes#include <sys/cdefs.h>
401539Srgrimes#include <sys/types.h>
411539Srgrimes#include <sys/unistd.h>
421539Srgrimes
431539Srgrimes#define	 STDIN_FILENO	0	/* standard input file descriptor */
441539Srgrimes#define	STDOUT_FILENO	1	/* standard output file descriptor */
451539Srgrimes#define	STDERR_FILENO	2	/* standard error file descriptor */
461539Srgrimes
471539Srgrimes#ifndef NULL
481539Srgrimes#define	NULL		0	/* null pointer constant */
491539Srgrimes#endif
501539Srgrimes
5137509Sdt#ifndef _POSIX_SOURCE
5237566Sbde#define	F_ULOCK		0	/* unlock locked section */
5337566Sbde#define	F_LOCK		1	/* lock a section for exclusive use */
5437566Sbde#define	F_TLOCK		2	/* test and lock a section for exclusive use */
5537566Sbde#define	F_TEST		3	/* test a section for locks by other procs */
5637509Sdt#endif
5737509Sdt
581539Srgrimes__BEGIN_DECLS
5918286Sbdevoid	 _exit __P((int)) __dead2;
601539Srgrimesint	 access __P((const char *, int));
611539Srgrimesunsigned int	 alarm __P((unsigned int));
621539Srgrimesint	 chdir __P((const char *));
631539Srgrimesint	 chown __P((const char *, uid_t, gid_t));
641539Srgrimesint	 close __P((int));
651539Srgrimesint	 dup __P((int));
661539Srgrimesint	 dup2 __P((int, int));
671539Srgrimesint	 execl __P((const char *, const char *, ...));
681539Srgrimesint	 execle __P((const char *, const char *, ...));
691539Srgrimesint	 execlp __P((const char *, const char *, ...));
701539Srgrimesint	 execv __P((const char *, char * const *));
711539Srgrimesint	 execve __P((const char *, char * const *, char * const *));
721539Srgrimesint	 execvp __P((const char *, char * const *));
731539Srgrimespid_t	 fork __P((void));
741539Srgrimeslong	 fpathconf __P((int, int));
751539Srgrimeschar	*getcwd __P((char *, size_t));
761539Srgrimesgid_t	 getegid __P((void));
771539Srgrimesuid_t	 geteuid __P((void));
781539Srgrimesgid_t	 getgid __P((void));
791539Srgrimesint	 getgroups __P((int, gid_t []));
801539Srgrimeschar	*getlogin __P((void));
811539Srgrimespid_t	 getpgrp __P((void));
821539Srgrimespid_t	 getpid __P((void));
831539Srgrimespid_t	 getppid __P((void));
841539Srgrimesuid_t	 getuid __P((void));
851539Srgrimesint	 isatty __P((int));
861539Srgrimesint	 link __P((const char *, const char *));
8724896Sbde#ifndef _LSEEK_DECLARED
8824896Sbde#define	_LSEEK_DECLARED
891539Srgrimesoff_t	 lseek __P((int, off_t, int));
9024896Sbde#endif
911539Srgrimeslong	 pathconf __P((const char *, int));
921539Srgrimesint	 pause __P((void));
931539Srgrimesint	 pipe __P((int *));
941539Srgrimesssize_t	 read __P((int, void *, size_t));
951539Srgrimesint	 rmdir __P((const char *));
961539Srgrimesint	 setgid __P((gid_t));
971539Srgrimesint	 setpgid __P((pid_t, pid_t));
981539Srgrimespid_t	 setsid __P((void));
991539Srgrimesint	 setuid __P((uid_t));
1001539Srgrimesunsigned int	 sleep __P((unsigned int));
1011539Srgrimeslong	 sysconf __P((int));
1021539Srgrimespid_t	 tcgetpgrp __P((int));
1031539Srgrimesint	 tcsetpgrp __P((int, pid_t));
1041539Srgrimeschar	*ttyname __P((int));
1051539Srgrimesint	 unlink __P((const char *));
1061539Srgrimesssize_t	 write __P((int, const void *, size_t));
1071539Srgrimes
10823657Speterextern char *optarg;			/* getopt(3) external variables */
10923657Speterextern int optind, opterr, optopt;
11023657Speterint	 getopt __P((int, char * const [], const char *));
11123657Speter
1121539Srgrimes#ifndef	_POSIX_SOURCE
1131539Srgrimes#ifdef	__STDC__
1141539Srgrimesstruct timeval;				/* select(2) */
1151539Srgrimes#endif
1161539Srgrimesint	 acct __P((const char *));
1171539Srgrimesint	 async_daemon __P((void));
1181539Srgrimeschar	*brk __P((const char *));
1191539Srgrimesint	 chroot __P((const char *));
12017192Sbdesize_t	 confstr __P((int, char *, size_t));
1211539Srgrimeschar	*crypt __P((const char *, const char *));
1221539Srgrimesint	 des_cipher __P((const char *, char *, long, int));
1231539Srgrimesint	 des_setkey __P((const char *key));
1241539Srgrimesint	 encrypt __P((char *, int));
1251539Srgrimesvoid	 endusershell __P((void));
1261539Srgrimesint	 exect __P((const char *, char * const *, char * const *));
1271539Srgrimesint	 fchdir __P((int));
1286490Sjoergint	 fchown __P((int, uid_t, gid_t));
1291539Srgrimesint	 fsync __P((int));
13024896Sbde#ifndef _FTRUNCATE_DECLARED
13124896Sbde#define	_FTRUNCATE_DECLARED
1321539Srgrimesint	 ftruncate __P((int, off_t));
13324896Sbde#endif
1342859Swollmanint	 getdomainname __P((char *, int));
1351539Srgrimesint	 getdtablesize __P((void));
13617192Sbdeint	 getgrouplist __P((const char *, int, int *, int *));
1371539Srgrimeslong	 gethostid __P((void));
1381539Srgrimesint	 gethostname __P((char *, int));
1391539Srgrimesmode_t	 getmode __P((const void *, mode_t));
14018286Sbdeint	 getpagesize __P((void)) __pure2;
1411539Srgrimeschar	*getpass __P((const char *));
14228402Speterint	 getpgid __P((pid_t _pid));
14328402Speterint	 getsid __P((pid_t _pid));
1441539Srgrimeschar	*getusershell __P((void));
1451539Srgrimeschar	*getwd __P((char *));			/* obsoleted by getcwd() */
1461539Srgrimesint	 initgroups __P((const char *, int));
1471539Srgrimesint	 iruserok __P((unsigned long, int, const char *, const char *));
14824650Speterint	 issetugid __P((void));
14924444Speterint	 lchown __P((const char *, uid_t, gid_t));
15037566Sbdeint	 lockf __P((int, int, off_t));
15134521Sbdechar	*mkdtemp __P((char *));
1521539Srgrimesint	 mknod __P((const char *, mode_t, dev_t));
1531539Srgrimesint	 mkstemp __P((char *));
1541539Srgrimeschar	*mktemp __P((char *));
1551539Srgrimesint	 nfssvc __P((int, void *));
1561539Srgrimesint	 nice __P((int));
1571539Srgrimesint	 profil __P((char *, int, int, int));
1581539Srgrimesint	 rcmd __P((char **, int, const char *,
1591539Srgrimes		const char *, const char *, int *));
1601539Srgrimeschar	*re_comp __P((const char *));
1611539Srgrimesint	 re_exec __P((const char *));
1621539Srgrimesint	 readlink __P((const char *, char *, int));
1631539Srgrimesint	 reboot __P((int));
1641539Srgrimesint	 revoke __P((const char *));
16514223Speterpid_t	 rfork __P((int));
1661539Srgrimesint	 rresvport __P((int *));
1671539Srgrimesint	 ruserok __P((const char *, int, const char *, const char *));
1681539Srgrimeschar	*sbrk __P((int));
1691539Srgrimesint	 select __P((int, fd_set *, fd_set *, fd_set *, struct timeval *));
1702859Swollmanint	 setdomainname __P((const char *, int));
1711539Srgrimesint	 setegid __P((gid_t));
1721539Srgrimesint	 seteuid __P((uid_t));
1731539Srgrimesint	 setgroups __P((int, const gid_t *));
1741539Srgrimesvoid	 sethostid __P((long));
1751539Srgrimesint	 sethostname __P((const char *, int));
1761539Srgrimesint	 setkey __P((const char *));
1771539Srgrimesint	 setlogin __P((const char *));
1781539Srgrimesvoid	*setmode __P((const char *));
17928402Speterint	 setpgrp __P((pid_t _pid, pid_t _pgrp)); /* obsoleted by setpgid() */
1801539Srgrimesint	 setregid __P((gid_t, gid_t));
1811539Srgrimesint	 setreuid __P((uid_t, uid_t));
1821539Srgrimesint	 setrgid __P((gid_t));
1831539Srgrimesint	 setruid __P((uid_t));
1841539Srgrimesvoid	 setusershell __P((void));
1851539Srgrimesint	 swapon __P((const char *));
1861539Srgrimesint	 symlink __P((const char *, const char *));
1871539Srgrimesvoid	 sync __P((void));
1881539Srgrimesint	 syscall __P((int, ...));
18913545Sjulianoff_t	 __syscall __P((quad_t, ...));
19024896Sbde#ifndef _TRUNCATE_DECLARED
19124896Sbde#define	_TRUNCATE_DECLARED
1921539Srgrimesint	 truncate __P((const char *, off_t));
19324896Sbde#endif
1941539Srgrimesint	 ttyslot __P((void));
1951539Srgrimesunsigned int	 ualarm __P((unsigned int, unsigned int));
19624896Sbdeint	 undelete __P((const char *));
19723657Speterint	 unwhiteout __P((const char *));
19830647Sacheint	 usleep __P((unsigned int));
1991539Srgrimesvoid	*valloc __P((size_t));			/* obsoleted by malloc() */
2001539Srgrimespid_t	 vfork __P((void));
20123657Speter
20223657Speterextern char *suboptarg;			/* getsubopt(3) external variable */
20323657Speterint	 getsubopt __P((char **, char * const *, char **));
2041539Srgrimes#endif /* !_POSIX_SOURCE */
2051539Srgrimes__END_DECLS
2061539Srgrimes
2071539Srgrimes#endif /* !_UNISTD_H_ */
208