unistd.h revision 24896
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
511539Srgrimes__BEGIN_DECLS
5218286Sbdevoid	 _exit __P((int)) __dead2;
531539Srgrimesint	 access __P((const char *, int));
541539Srgrimesunsigned int	 alarm __P((unsigned int));
551539Srgrimesint	 chdir __P((const char *));
561539Srgrimesint	 chown __P((const char *, uid_t, gid_t));
571539Srgrimesint	 close __P((int));
581539Srgrimesint	 dup __P((int));
591539Srgrimesint	 dup2 __P((int, int));
601539Srgrimesint	 execl __P((const char *, const char *, ...));
611539Srgrimesint	 execle __P((const char *, const char *, ...));
621539Srgrimesint	 execlp __P((const char *, const char *, ...));
631539Srgrimesint	 execv __P((const char *, char * const *));
641539Srgrimesint	 execve __P((const char *, char * const *, char * const *));
651539Srgrimesint	 execvp __P((const char *, char * const *));
661539Srgrimespid_t	 fork __P((void));
671539Srgrimeslong	 fpathconf __P((int, int));
681539Srgrimeschar	*getcwd __P((char *, size_t));
691539Srgrimesgid_t	 getegid __P((void));
701539Srgrimesuid_t	 geteuid __P((void));
711539Srgrimesgid_t	 getgid __P((void));
721539Srgrimesint	 getgroups __P((int, gid_t []));
731539Srgrimeschar	*getlogin __P((void));
741539Srgrimespid_t	 getpgrp __P((void));
751539Srgrimespid_t	 getpid __P((void));
761539Srgrimespid_t	 getppid __P((void));
771539Srgrimesuid_t	 getuid __P((void));
781539Srgrimesint	 isatty __P((int));
791539Srgrimesint	 link __P((const char *, const char *));
8024896Sbde#ifndef _LSEEK_DECLARED
8124896Sbde#define	_LSEEK_DECLARED
821539Srgrimesoff_t	 lseek __P((int, off_t, int));
8324896Sbde#endif
841539Srgrimeslong	 pathconf __P((const char *, int));
851539Srgrimesint	 pause __P((void));
861539Srgrimesint	 pipe __P((int *));
871539Srgrimesssize_t	 read __P((int, void *, size_t));
881539Srgrimesint	 rmdir __P((const char *));
891539Srgrimesint	 setgid __P((gid_t));
901539Srgrimesint	 setpgid __P((pid_t, pid_t));
911539Srgrimespid_t	 setsid __P((void));
921539Srgrimesint	 setuid __P((uid_t));
931539Srgrimesunsigned int	 sleep __P((unsigned int));
941539Srgrimeslong	 sysconf __P((int));
951539Srgrimespid_t	 tcgetpgrp __P((int));
961539Srgrimesint	 tcsetpgrp __P((int, pid_t));
971539Srgrimeschar	*ttyname __P((int));
981539Srgrimesint	 unlink __P((const char *));
991539Srgrimesssize_t	 write __P((int, const void *, size_t));
1001539Srgrimes
10123657Speterextern char *optarg;			/* getopt(3) external variables */
10223657Speterextern int optind, opterr, optopt;
10323657Speterint	 getopt __P((int, char * const [], const char *));
10423657Speter
1051539Srgrimes#ifndef	_POSIX_SOURCE
1061539Srgrimes#ifdef	__STDC__
1071539Srgrimesstruct timeval;				/* select(2) */
1081539Srgrimes#endif
1091539Srgrimesint	 acct __P((const char *));
1101539Srgrimesint	 async_daemon __P((void));
1111539Srgrimeschar	*brk __P((const char *));
1121539Srgrimesint	 chroot __P((const char *));
11317192Sbdesize_t	 confstr __P((int, char *, size_t));
1141539Srgrimeschar	*crypt __P((const char *, const char *));
1151539Srgrimesint	 des_cipher __P((const char *, char *, long, int));
1161539Srgrimesint	 des_setkey __P((const char *key));
1171539Srgrimesint	 encrypt __P((char *, int));
1181539Srgrimesvoid	 endusershell __P((void));
1191539Srgrimesint	 exect __P((const char *, char * const *, char * const *));
1201539Srgrimesint	 fchdir __P((int));
1216490Sjoergint	 fchown __P((int, uid_t, gid_t));
1221539Srgrimesint	 fsync __P((int));
12324896Sbde#ifndef _FTRUNCATE_DECLARED
12424896Sbde#define	_FTRUNCATE_DECLARED
1251539Srgrimesint	 ftruncate __P((int, off_t));
12624896Sbde#endif
1272859Swollmanint	 getdomainname __P((char *, int));
1281539Srgrimesint	 getdtablesize __P((void));
12917192Sbdeint	 getgrouplist __P((const char *, int, int *, int *));
1301539Srgrimeslong	 gethostid __P((void));
1311539Srgrimesint	 gethostname __P((char *, int));
1321539Srgrimesmode_t	 getmode __P((const void *, mode_t));
13318286Sbdeint	 getpagesize __P((void)) __pure2;
1341539Srgrimeschar	*getpass __P((const char *));
1351539Srgrimeschar	*getusershell __P((void));
1361539Srgrimeschar	*getwd __P((char *));			/* obsoleted by getcwd() */
1371539Srgrimesint	 initgroups __P((const char *, int));
1381539Srgrimesint	 iruserok __P((unsigned long, int, const char *, const char *));
13924650Speterint	 issetugid __P((void));
14024444Speterint	 lchown __P((const char *, uid_t, gid_t));
1411539Srgrimesint	 mknod __P((const char *, mode_t, dev_t));
1421539Srgrimesint	 mkstemp __P((char *));
1431539Srgrimeschar	*mktemp __P((char *));
1441539Srgrimesint	 nfssvc __P((int, void *));
1451539Srgrimesint	 nice __P((int));
1461539Srgrimesvoid	 psignal __P((unsigned int, const char *));
1471539Srgrimesextern __const char *__const sys_siglist[];
1481539Srgrimesint	 profil __P((char *, int, int, int));
1491539Srgrimesint	 rcmd __P((char **, int, const char *,
1501539Srgrimes		const char *, const char *, int *));
1511539Srgrimeschar	*re_comp __P((const char *));
1521539Srgrimesint	 re_exec __P((const char *));
1531539Srgrimesint	 readlink __P((const char *, char *, int));
1541539Srgrimesint	 reboot __P((int));
1551539Srgrimesint	 revoke __P((const char *));
15614223Speterpid_t	 rfork __P((int));
1571539Srgrimesint	 rresvport __P((int *));
1581539Srgrimesint	 ruserok __P((const char *, int, const char *, const char *));
1591539Srgrimeschar	*sbrk __P((int));
1601539Srgrimesint	 select __P((int, fd_set *, fd_set *, fd_set *, struct timeval *));
1612859Swollmanint	 setdomainname __P((const char *, int));
1621539Srgrimesint	 setegid __P((gid_t));
1631539Srgrimesint	 seteuid __P((uid_t));
1641539Srgrimesint	 setgroups __P((int, const gid_t *));
1651539Srgrimesvoid	 sethostid __P((long));
1661539Srgrimesint	 sethostname __P((const char *, int));
1671539Srgrimesint	 setkey __P((const char *));
1681539Srgrimesint	 setlogin __P((const char *));
1691539Srgrimesvoid	*setmode __P((const char *));
1701539Srgrimesint	 setpgrp __P((pid_t pid, pid_t pgrp));	/* obsoleted by setpgid() */
1711539Srgrimesint	 setregid __P((gid_t, gid_t));
1721539Srgrimesint	 setreuid __P((uid_t, uid_t));
1731539Srgrimesint	 setrgid __P((gid_t));
1741539Srgrimesint	 setruid __P((uid_t));
1751539Srgrimesvoid	 setusershell __P((void));
1761539Srgrimesint	 swapon __P((const char *));
1771539Srgrimesint	 symlink __P((const char *, const char *));
1781539Srgrimesvoid	 sync __P((void));
1791539Srgrimesint	 syscall __P((int, ...));
18013545Sjulianoff_t	 __syscall __P((quad_t, ...));
18124896Sbde#ifndef _TRUNCATE_DECLARED
18224896Sbde#define	_TRUNCATE_DECLARED
1831539Srgrimesint	 truncate __P((const char *, off_t));
18424896Sbde#endif
1851539Srgrimesint	 ttyslot __P((void));
1861539Srgrimesunsigned int	 ualarm __P((unsigned int, unsigned int));
18724896Sbdeint	 undelete __P((const char *));
18823657Speterint	 unwhiteout __P((const char *));
1891539Srgrimesvoid	 usleep __P((unsigned int));
1901539Srgrimesvoid	*valloc __P((size_t));			/* obsoleted by malloc() */
1911539Srgrimespid_t	 vfork __P((void));
19223657Speter
19323657Speterextern char *suboptarg;			/* getsubopt(3) external variable */
19423657Speterint	 getsubopt __P((char **, char * const *, char **));
1951539Srgrimes#endif /* !_POSIX_SOURCE */
1961539Srgrimes__END_DECLS
1971539Srgrimes
1981539Srgrimes#endif /* !_UNISTD_H_ */
199