unistd.h revision 55033
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 3455033Sbde * $FreeBSD: head/include/unistd.h 55033 1999-12-23 16:06:12Z bde $ 351539Srgrimes */ 361539Srgrimes 371539Srgrimes#ifndef _UNISTD_H_ 381539Srgrimes#define _UNISTD_H_ 391539Srgrimes 401539Srgrimes#include <sys/cdefs.h> 411539Srgrimes#include <sys/types.h> 421539Srgrimes#include <sys/unistd.h> 431539Srgrimes 441539Srgrimes#define STDIN_FILENO 0 /* standard input file descriptor */ 451539Srgrimes#define STDOUT_FILENO 1 /* standard output file descriptor */ 461539Srgrimes#define STDERR_FILENO 2 /* standard error file descriptor */ 471539Srgrimes 481539Srgrimes#ifndef NULL 491539Srgrimes#define NULL 0 /* null pointer constant */ 501539Srgrimes#endif 511539Srgrimes 5237509Sdt#ifndef _POSIX_SOURCE 5337566Sbde#define F_ULOCK 0 /* unlock locked section */ 5437566Sbde#define F_LOCK 1 /* lock a section for exclusive use */ 5537566Sbde#define F_TLOCK 2 /* test and lock a section for exclusive use */ 5637566Sbde#define F_TEST 3 /* test a section for locks by other procs */ 5737509Sdt#endif 5837509Sdt 591539Srgrimes__BEGIN_DECLS 6018286Sbdevoid _exit __P((int)) __dead2; 611539Srgrimesint access __P((const char *, int)); 621539Srgrimesunsigned int alarm __P((unsigned int)); 631539Srgrimesint chdir __P((const char *)); 641539Srgrimesint chown __P((const char *, uid_t, gid_t)); 651539Srgrimesint close __P((int)); 661539Srgrimesint dup __P((int)); 671539Srgrimesint dup2 __P((int, int)); 681539Srgrimesint execl __P((const char *, const char *, ...)); 691539Srgrimesint execle __P((const char *, const char *, ...)); 701539Srgrimesint execlp __P((const char *, const char *, ...)); 711539Srgrimesint execv __P((const char *, char * const *)); 721539Srgrimesint execve __P((const char *, char * const *, char * const *)); 731539Srgrimesint execvp __P((const char *, char * const *)); 741539Srgrimespid_t fork __P((void)); 751539Srgrimeslong fpathconf __P((int, int)); 761539Srgrimeschar *getcwd __P((char *, size_t)); 771539Srgrimesgid_t getegid __P((void)); 781539Srgrimesuid_t geteuid __P((void)); 791539Srgrimesgid_t getgid __P((void)); 801539Srgrimesint getgroups __P((int, gid_t [])); 811539Srgrimeschar *getlogin __P((void)); 821539Srgrimespid_t getpgrp __P((void)); 831539Srgrimespid_t getpid __P((void)); 841539Srgrimespid_t getppid __P((void)); 851539Srgrimesuid_t getuid __P((void)); 861539Srgrimesint isatty __P((int)); 871539Srgrimesint link __P((const char *, const char *)); 8824896Sbde#ifndef _LSEEK_DECLARED 8924896Sbde#define _LSEEK_DECLARED 901539Srgrimesoff_t lseek __P((int, off_t, int)); 9124896Sbde#endif 921539Srgrimeslong pathconf __P((const char *, int)); 931539Srgrimesint pause __P((void)); 941539Srgrimesint pipe __P((int *)); 951539Srgrimesssize_t read __P((int, void *, size_t)); 961539Srgrimesint rmdir __P((const char *)); 971539Srgrimesint setgid __P((gid_t)); 981539Srgrimesint setpgid __P((pid_t, pid_t)); 991539Srgrimespid_t setsid __P((void)); 1001539Srgrimesint setuid __P((uid_t)); 1011539Srgrimesunsigned int sleep __P((unsigned int)); 1021539Srgrimeslong sysconf __P((int)); 1031539Srgrimespid_t tcgetpgrp __P((int)); 1041539Srgrimesint tcsetpgrp __P((int, pid_t)); 1051539Srgrimeschar *ttyname __P((int)); 1061539Srgrimesint unlink __P((const char *)); 1071539Srgrimesssize_t write __P((int, const void *, size_t)); 1081539Srgrimes 10923657Speterextern char *optarg; /* getopt(3) external variables */ 11023657Speterextern int optind, opterr, optopt; 11123657Speterint getopt __P((int, char * const [], const char *)); 11223657Speter 1131539Srgrimes#ifndef _POSIX_SOURCE 1141539Srgrimes#ifdef __STDC__ 1151539Srgrimesstruct timeval; /* select(2) */ 1161539Srgrimes#endif 1171539Srgrimesint acct __P((const char *)); 1181539Srgrimesint async_daemon __P((void)); 1191539Srgrimeschar *brk __P((const char *)); 1201539Srgrimesint chroot __P((const char *)); 12117192Sbdesize_t confstr __P((int, char *, size_t)); 1221539Srgrimeschar *crypt __P((const char *, const char *)); 1231539Srgrimesint des_cipher __P((const char *, char *, long, int)); 1241539Srgrimesint des_setkey __P((const char *key)); 1251539Srgrimesint encrypt __P((char *, int)); 1261539Srgrimesvoid endusershell __P((void)); 1271539Srgrimesint exect __P((const char *, char * const *, char * const *)); 1281539Srgrimesint fchdir __P((int)); 1296490Sjoergint fchown __P((int, uid_t, gid_t)); 1301539Srgrimesint fsync __P((int)); 13124896Sbde#ifndef _FTRUNCATE_DECLARED 13224896Sbde#define _FTRUNCATE_DECLARED 1331539Srgrimesint ftruncate __P((int, off_t)); 13424896Sbde#endif 1352859Swollmanint getdomainname __P((char *, int)); 1361539Srgrimesint getdtablesize __P((void)); 13717192Sbdeint getgrouplist __P((const char *, int, int *, int *)); 1381539Srgrimeslong gethostid __P((void)); 1391539Srgrimesint gethostname __P((char *, int)); 14055033Sbdechar *getlogin_r __P((char *, int)); 1411539Srgrimesmode_t getmode __P((const void *, mode_t)); 14218286Sbdeint getpagesize __P((void)) __pure2; 1431539Srgrimeschar *getpass __P((const char *)); 14428402Speterint getpgid __P((pid_t _pid)); 14528402Speterint getsid __P((pid_t _pid)); 1461539Srgrimeschar *getusershell __P((void)); 1471539Srgrimeschar *getwd __P((char *)); /* obsoleted by getcwd() */ 1481539Srgrimesint initgroups __P((const char *, int)); 1491539Srgrimesint iruserok __P((unsigned long, int, const char *, const char *)); 15024650Speterint issetugid __P((void)); 15124444Speterint lchown __P((const char *, uid_t, gid_t)); 15237566Sbdeint lockf __P((int, int, off_t)); 15334521Sbdechar *mkdtemp __P((char *)); 1541539Srgrimesint mknod __P((const char *, mode_t, dev_t)); 1551539Srgrimesint mkstemp __P((char *)); 15645513Sbdeint mkstemps __P((char *, int)); 1571539Srgrimeschar *mktemp __P((char *)); 1581539Srgrimesint nfssvc __P((int, void *)); 1591539Srgrimesint nice __P((int)); 16045315Sdtssize_t pread __P((int, void *, size_t, off_t)); 16148835Ssimokawaint profil __P((char *, size_t, vm_offset_t, int)); 16245315Sdtssize_t pwrite __P((int, const void *, size_t, off_t)); 1631539Srgrimesint rcmd __P((char **, int, const char *, 1641539Srgrimes const char *, const char *, int *)); 1651539Srgrimeschar *re_comp __P((const char *)); 1661539Srgrimesint re_exec __P((const char *)); 1671539Srgrimesint readlink __P((const char *, char *, int)); 1681539Srgrimesint reboot __P((int)); 1691539Srgrimesint revoke __P((const char *)); 17014223Speterpid_t rfork __P((int)); 1711539Srgrimesint rresvport __P((int *)); 1721539Srgrimesint ruserok __P((const char *, int, const char *, const char *)); 1731539Srgrimeschar *sbrk __P((int)); 1741539Srgrimesint select __P((int, fd_set *, fd_set *, fd_set *, struct timeval *)); 1752859Swollmanint setdomainname __P((const char *, int)); 1761539Srgrimesint setegid __P((gid_t)); 1771539Srgrimesint seteuid __P((uid_t)); 1781539Srgrimesint setgroups __P((int, const gid_t *)); 1791539Srgrimesvoid sethostid __P((long)); 1801539Srgrimesint sethostname __P((const char *, int)); 1811539Srgrimesint setkey __P((const char *)); 1821539Srgrimesint setlogin __P((const char *)); 1831539Srgrimesvoid *setmode __P((const char *)); 18428402Speterint setpgrp __P((pid_t _pid, pid_t _pgrp)); /* obsoleted by setpgid() */ 1851539Srgrimesint setregid __P((gid_t, gid_t)); 1861539Srgrimesint setreuid __P((uid_t, uid_t)); 1871539Srgrimesint setrgid __P((gid_t)); 1881539Srgrimesint setruid __P((uid_t)); 1891539Srgrimesvoid setusershell __P((void)); 1901539Srgrimesint swapon __P((const char *)); 1911539Srgrimesint symlink __P((const char *, const char *)); 1921539Srgrimesvoid sync __P((void)); 1931539Srgrimesint syscall __P((int, ...)); 19413545Sjulianoff_t __syscall __P((quad_t, ...)); 19524896Sbde#ifndef _TRUNCATE_DECLARED 19624896Sbde#define _TRUNCATE_DECLARED 1971539Srgrimesint truncate __P((const char *, off_t)); 19824896Sbde#endif 1991539Srgrimesint ttyslot __P((void)); 2001539Srgrimesunsigned int ualarm __P((unsigned int, unsigned int)); 20124896Sbdeint undelete __P((const char *)); 20223657Speterint unwhiteout __P((const char *)); 20330647Sacheint usleep __P((unsigned int)); 2041539Srgrimesvoid *valloc __P((size_t)); /* obsoleted by malloc() */ 2051539Srgrimespid_t vfork __P((void)); 20623657Speter 20723657Speterextern char *suboptarg; /* getsubopt(3) external variable */ 20823657Speterint getsubopt __P((char **, char * const *, char **)); 2091539Srgrimes#endif /* !_POSIX_SOURCE */ 21042518Smsmithextern int optreset; /* getopt(3) external variable */ 2111539Srgrimes__END_DECLS 2121539Srgrimes 2131539Srgrimes#endif /* !_UNISTD_H_ */ 214