unistd.h revision 86214
1272850Shrs/*- 2272850Shrs * Copyright (c) 1991, 1993, 1994 3272850Shrs * The Regents of the University of California. All rights reserved. 4272850Shrs * 5272850Shrs * Redistribution and use in source and binary forms, with or without 6272850Shrs * modification, are permitted provided that the following conditions 7272850Shrs * are met: 8272850Shrs * 1. Redistributions of source code must retain the above copyright 9272850Shrs * notice, this list of conditions and the following disclaimer. 10272850Shrs * 2. Redistributions in binary form must reproduce the above copyright 11272850Shrs * notice, this list of conditions and the following disclaimer in the 12272850Shrs * documentation and/or other materials provided with the distribution. 13272850Shrs * 3. All advertising materials mentioning features or use of this software 14272850Shrs * must display the following acknowledgement: 15272850Shrs * This product includes software developed by the University of 16272850Shrs * California, Berkeley and its contributors. 17272850Shrs * 4. Neither the name of the University nor the names of its contributors 18272850Shrs * may be used to endorse or promote products derived from this software 19272850Shrs * without specific prior written permission. 20272850Shrs * 21272850Shrs * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 22272850Shrs * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23272850Shrs * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24272850Shrs * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 25272850Shrs * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 26272850Shrs * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27272850Shrs * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28272850Shrs * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29272850Shrs * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 301832Swollman * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 311832Swollman * SUCH DAMAGE. 321832Swollman * 331832Swollman * @(#)unistd.h 8.12 (Berkeley) 4/27/95 341832Swollman * $FreeBSD: head/include/unistd.h 86214 2001-11-09 15:19:25Z ru $ 351832Swollman */ 361832Swollman 371832Swollman#ifndef _UNISTD_H_ 381832Swollman#define _UNISTD_H_ 391832Swollman 401832Swollman#include <sys/cdefs.h> 41114629Sobrien#include <sys/types.h> 42114629Sobrien#include <sys/unistd.h> 431832Swollman 441832Swollman#define STDIN_FILENO 0 /* standard input file descriptor */ 451832Swollman#define STDOUT_FILENO 1 /* standard output file descriptor */ 461832Swollman#define STDERR_FILENO 2 /* standard error file descriptor */ 471832Swollman 481832Swollman#ifndef NULL 491832Swollman#define NULL 0 /* null pointer constant */ 501832Swollman#endif 511832Swollman 521832Swollman#ifndef _POSIX_SOURCE 531832Swollman#define F_ULOCK 0 /* unlock locked section */ 541832Swollman#define F_LOCK 1 /* lock a section for exclusive use */ 551832Swollman#define F_TLOCK 2 /* test and lock a section for exclusive use */ 561832Swollman#define F_TEST 3 /* test a section for locks by other procs */ 571832Swollman#endif 581832Swollman 591832Swollman__BEGIN_DECLS 601832Swollmanvoid _exit __P((int)) __dead2; 611832Swollmanint access __P((const char *, int)); 621832Swollmanunsigned int alarm __P((unsigned int)); 631832Swollmanint chdir __P((const char *)); 641832Swollmanint chown __P((const char *, uid_t, gid_t)); 6526208Swpaulint close __P((int)); 6626208Swpaulint dup __P((int)); 6726208Swpaulint dup2 __P((int, int)); 6826208Swpaulint eaccess __P((const char *, int)); 6926208Swpaulint execl __P((const char *, const char *, ...)); 7026208Swpaulint execle __P((const char *, const char *, ...)); 7126208Swpaulint execlp __P((const char *, const char *, ...)); 7226208Swpaulint execv __P((const char *, char * const *)); 7326208Swpaulint execve __P((const char *, char * const *, char * const *)); 7426208Swpaulint execvp __P((const char *, char * const *)); 7526208Swpaulpid_t fork __P((void)); 7626208Swpaullong fpathconf __P((int, int)); 7726208Swpaulchar *getcwd __P((char *, size_t)); 7826208Swpaulgid_t getegid __P((void)); 7926208Swpauluid_t geteuid __P((void)); 801832Swollmangid_t getgid __P((void)); 811832Swollmanint getgroups __P((int, gid_t [])); 821832Swollmanchar *getlogin __P((void)); 831832Swollmanpid_t getpgrp __P((void)); 841832Swollmanpid_t getpid __P((void)); 851832Swollmanpid_t getppid __P((void)); 861832Swollmanuid_t getuid __P((void)); 871832Swollmanint isatty __P((int)); 881832Swollmanint link __P((const char *, const char *)); 891832Swollman#ifndef _LSEEK_DECLARED 901832Swollman#define _LSEEK_DECLARED 911832Swollmanoff_t lseek __P((int, off_t, int)); 921832Swollman#endif 931832Swollmanlong pathconf __P((const char *, int)); 941832Swollmanint pause __P((void)); 951832Swollmanint pipe __P((int *)); 961832Swollmanssize_t read __P((int, void *, size_t)); 971832Swollmanint rmdir __P((const char *)); 981832Swollmanint setgid __P((gid_t)); 991832Swollmanint setpgid __P((pid_t, pid_t)); 1001832Swollmanvoid setproctitle __P((const char *_fmt, ...)) __printf0like(1, 2); 1011832Swollmanpid_t setsid __P((void)); 1021832Swollmanint setuid __P((uid_t)); 1031832Swollmanunsigned int sleep __P((unsigned int)); 1041832Swollmanlong sysconf __P((int)); 1051832Swollmanpid_t tcgetpgrp __P((int)); 1061832Swollmanint tcsetpgrp __P((int, pid_t)); 1071832Swollmanchar *ttyname __P((int)); 10826208Swpaulint unlink __P((const char *)); 10926208Swpaulssize_t write __P((int, const void *, size_t)); 11026208Swpaul 11126208Swpaulextern char *optarg; /* getopt(3) external variables */ 11226208Swpaulextern int optind, opterr, optopt; 11326208Swpaulint getopt __P((int, char * const [], const char *)); 11426208Swpaul 11526208Swpaul#ifndef _POSIX_SOURCE 11626208Swpaul#ifdef __STDC__ 11726208Swpaulstruct timeval; /* select(2) */ 11826208Swpaul#endif 11926208Swpaulint acct __P((const char *)); 12026208Swpaulint async_daemon __P((void)); 12126208Swpaulchar *brk __P((const char *)); 12226208Swpaulint chroot __P((const char *)); 12326208Swpaulsize_t confstr __P((int, char *, size_t)); 1241832Swollmanchar *crypt __P((const char *, const char *)); 12526208Swpaulconst char *crypt_get_format __P((void)); 126int crypt_set_format __P((const char *)); 127int des_cipher __P((const char *, char *, long, int)); 128int des_setkey __P((const char *key)); 129int encrypt __P((char *, int)); 130void endusershell __P((void)); 131int exect __P((const char *, char * const *, char * const *)); 132int fchdir __P((int)); 133int fchown __P((int, uid_t, gid_t)); 134char *fflagstostr __P((u_long)); 135int fsync __P((int)); 136#ifndef _FTRUNCATE_DECLARED 137#define _FTRUNCATE_DECLARED 138int ftruncate __P((int, off_t)); 139#endif 140int getdomainname __P((char *, int)); 141int getdtablesize __P((void)); 142int getgrouplist __P((const char *, int, int *, int *)); 143long gethostid __P((void)); 144int gethostname __P((char *, int)); 145int getlogin_r __P((char *, int)); 146mode_t getmode __P((const void *, mode_t)); 147int getpagesize __P((void)) __pure2; 148char *getpass __P((const char *)); 149int getpeereid __P((int, uid_t *, gid_t *)); 150int getpgid __P((pid_t _pid)); 151int getresgid __P((gid_t *, gid_t *, gid_t *)); 152int getresuid __P((uid_t *, uid_t *, uid_t *)); 153int getsid __P((pid_t _pid)); 154char *getusershell __P((void)); 155char *getwd __P((char *)); /* obsoleted by getcwd() */ 156int initgroups __P((const char *, int)); 157int iruserok __P((unsigned long, int, const char *, const char *)); 158int iruserok_sa __P((const void *, int, int, const char *, const char *)); 159int issetugid __P((void)); 160int lchown __P((const char *, uid_t, gid_t)); 161int lockf __P((int, int, off_t)); 162char *mkdtemp __P((char *)); 163int mknod __P((const char *, mode_t, dev_t)); 164int mkstemp __P((char *)); 165int mkstemps __P((char *, int)); 166char *mktemp __P((char *)); 167int nfssvc __P((int, void *)); 168int nice __P((int)); 169ssize_t pread __P((int, void *, size_t, off_t)); 170int profil __P((char *, size_t, vm_offset_t, int)); 171ssize_t pwrite __P((int, const void *, size_t, off_t)); 172int rcmd __P((char **, int, const char *, 173 const char *, const char *, int *)); 174int rcmd_af __P((char **, int, const char *, 175 const char *, const char *, int *, int)); 176int rcmdsh __P((char **, int, const char *, 177 const char *, const char *, const char *)); 178char *re_comp __P((const char *)); 179int re_exec __P((const char *)); 180int readlink __P((const char *, char *, int)); 181int reboot __P((int)); 182int revoke __P((const char *)); 183pid_t rfork __P((int)); 184pid_t rfork_thread __P((int, void *, int (*)(void *), void *)); 185int rresvport __P((int *)); 186int rresvport_af __P((int *, int)); 187int ruserok __P((const char *, int, const char *, const char *)); 188char *sbrk __P((int)); 189int select __P((int, fd_set *, fd_set *, fd_set *, struct timeval *)); 190int setdomainname __P((const char *, int)); 191int setegid __P((gid_t)); 192int seteuid __P((uid_t)); 193int setgroups __P((int, const gid_t *)); 194void sethostid __P((long)); 195int sethostname __P((const char *, int)); 196int setkey __P((const char *)); 197int setlogin __P((const char *)); 198void *setmode __P((const char *)); 199int setpgrp __P((pid_t _pid, pid_t _pgrp)); /* obsoleted by setpgid() */ 200int setregid __P((gid_t, gid_t)); 201int setresgid __P((gid_t, gid_t, gid_t)); 202int setresuid __P((uid_t, uid_t, uid_t)); 203int setreuid __P((uid_t, uid_t)); 204int setrgid __P((gid_t)); 205int setruid __P((uid_t)); 206void setusershell __P((void)); 207int strtofflags __P((char **, u_long *, u_long *)); 208int swapon __P((const char *)); 209int symlink __P((const char *, const char *)); 210void sync __P((void)); 211int syscall __P((int, ...)); 212off_t __syscall __P((quad_t, ...)); 213#ifndef _TRUNCATE_DECLARED 214#define _TRUNCATE_DECLARED 215int truncate __P((const char *, off_t)); 216#endif 217int ttyslot __P((void)); 218unsigned int ualarm __P((unsigned int, unsigned int)); 219int undelete __P((const char *)); 220int unwhiteout __P((const char *)); 221int usleep __P((unsigned int)); 222void *valloc __P((size_t)); /* obsoleted by malloc() */ 223pid_t vfork __P((void)); 224 225extern char *suboptarg; /* getsubopt(3) external variable */ 226int getsubopt __P((char **, char * const *, char **)); 227#endif /* !_POSIX_SOURCE */ 228extern int optreset; /* getopt(3) external variable */ 229__END_DECLS 230 231#endif /* !_UNISTD_H_ */ 232