unistd.h revision 1.18
1/* $OpenBSD: unistd.h,v 1.18 1998/02/10 02:44:38 deraadt Exp $ */ 2/* $NetBSD: unistd.h,v 1.26.4.1 1996/05/28 02:31:51 mrg Exp $ */ 3 4/*- 5 * Copyright (c) 1991 The Regents of the University of California. 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without 9 * modification, are permitted provided that the following conditions 10 * are met: 11 * 1. Redistributions of source code must retain the above copyright 12 * notice, this list of conditions and the following disclaimer. 13 * 2. Redistributions in binary form must reproduce the above copyright 14 * notice, this list of conditions and the following disclaimer in the 15 * documentation and/or other materials provided with the distribution. 16 * 3. All advertising materials mentioning features or use of this software 17 * must display the following acknowledgement: 18 * This product includes software developed by the University of 19 * California, Berkeley and its contributors. 20 * 4. Neither the name of the University nor the names of its contributors 21 * may be used to endorse or promote products derived from this software 22 * without specific prior written permission. 23 * 24 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 25 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 27 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 34 * SUCH DAMAGE. 35 * 36 * @(#)unistd.h 5.13 (Berkeley) 6/17/91 37 */ 38 39#ifndef _UNISTD_H_ 40#define _UNISTD_H_ 41 42#include <sys/cdefs.h> 43#include <sys/types.h> 44#include <sys/unistd.h> 45 46#define STDIN_FILENO 0 /* standard input file descriptor */ 47#define STDOUT_FILENO 1 /* standard output file descriptor */ 48#define STDERR_FILENO 2 /* standard error file descriptor */ 49 50#ifndef NULL 51#define NULL 0 /* null pointer constant */ 52#endif 53 54__BEGIN_DECLS 55__dead void _exit __P((int)) __attribute__((noreturn)); 56int access __P((const char *, int)); 57unsigned int alarm __P((unsigned int)); 58int chdir __P((const char *)); 59int chown __P((const char *, uid_t, gid_t)); 60int close __P((int)); 61size_t confstr __P((int, char *, size_t)); 62char *cuserid __P((char *)); 63int dup __P((int)); 64int dup2 __P((int, int)); 65int execl __P((const char *, const char *, ...)); 66int execle __P((const char *, const char *, ...)); 67int execlp __P((const char *, const char *, ...)); 68int execv __P((const char *, char * const *)); 69int execve __P((const char *, char * const *, char * const *)); 70int execvp __P((const char *, char * const *)); 71pid_t fork __P((void)); 72long fpathconf __P((int, int)); 73char *getcwd __P((char *, size_t)); 74gid_t getegid __P((void)); 75uid_t geteuid __P((void)); 76gid_t getgid __P((void)); 77int getgroups __P((int, gid_t *)); 78char *getlogin __P((void)); 79pid_t getpgrp __P((void)); 80pid_t getpid __P((void)); 81pid_t getppid __P((void)); 82uid_t getuid __P((void)); 83int isatty __P((int)); 84int link __P((const char *, const char *)); 85off_t lseek __P((int, off_t, int)); 86long pathconf __P((const char *, int)); 87int pause __P((void)); 88int pipe __P((int *)); 89ssize_t read __P((int, void *, size_t)); 90int rmdir __P((const char *)); 91int setgid __P((gid_t)); 92int setpgid __P((pid_t, pid_t)); 93pid_t setsid __P((void)); 94int setuid __P((uid_t)); 95unsigned int sleep __P((unsigned int)); 96long sysconf __P((int)); 97pid_t tcgetpgrp __P((int)); 98int tcsetpgrp __P((int, pid_t)); 99char *ttyname __P((int)); 100int unlink __P((const char *)); 101ssize_t write __P((int, const void *, size_t)); 102 103#ifndef _POSIX_SOURCE 104 105/* structure timeval required for select() */ 106#include <sys/time.h> 107 108int acct __P((const char *)); 109char *brk __P((const char *)); 110int chroot __P((const char *)); 111char *crypt __P((const char *, const char *)); 112int des_cipher __P((const char *, char *, long, int)); 113int des_setkey __P((const char *key)); 114int encrypt __P((char *, int)); 115void endusershell __P((void)); 116int exect __P((const char *, char * const *, char * const *)); 117int fchdir __P((int)); 118int fchown __P((int, uid_t, gid_t)); 119int fsync __P((int)); 120int ftruncate __P((int, off_t)); 121int getdomainname __P((char *, int)); 122int getdtablesize __P((void)); 123int getgrouplist __P((const char *, gid_t, gid_t *, int *)); 124long gethostid __P((void)); 125int gethostname __P((char *, int)); 126mode_t getmode __P((const void *, mode_t)); 127int getpagesize __P((void)); 128char *getpass __P((const char *)); 129char *getusershell __P((void)); 130char *getwd __P((char *)); /* obsoleted by getcwd() */ 131int initgroups __P((const char *, gid_t)); 132int iruserok __P((u_int32_t, int, const char *, const char *)); 133int lchown __P((const char *, uid_t, gid_t)); 134char *mkdtemp __P((char *)); 135int mkstemp __P((char *)); 136char *mktemp __P((char *)); 137int nfssvc __P((int, void *)); 138int nice __P((int)); 139void psignal __P((unsigned int, const char *)); 140extern __const char *__const sys_siglist[]; 141int profil __P((char *, size_t, u_long, u_int)); 142int rcmd __P((char **, int, const char *, 143 const char *, const char *, int *)); 144int rcmdsh __P((char **, int, const char *, 145 const char *, const char *, char *)); 146char *re_comp __P((const char *)); 147int re_exec __P((const char *)); 148int readlink __P((const char *, char *, int)); 149int reboot __P((int)); 150int revoke __P((const char *)); 151int rfork __P((int opts)); 152int rresvport __P((int *)); 153int ruserok __P((const char *, int, const char *, const char *)); 154int quotactl __P((const char *, int, int, char *)); 155char *sbrk __P((int)); 156int select __P((int, fd_set *, fd_set *, fd_set *, struct timeval *)); 157int setdomainname __P((const char *, int)); 158int setegid __P((gid_t)); 159int seteuid __P((uid_t)); 160int setgroups __P((int, const gid_t *)); 161int sethostid __P((long)); 162int sethostname __P((const char *, int)); 163int setkey __P((const char *)); 164int setlogin __P((const char *)); 165void *setmode __P((const char *)); 166int setpgrp __P((pid_t pid, pid_t pgrp)); /* obsoleted by setpgid() */ 167int setregid __P((int, int)); 168int setreuid __P((int, int)); 169int setrgid __P((gid_t)); 170int setruid __P((uid_t)); 171void setusershell __P((void)); 172void swab __P((const void *, void *, size_t)); 173int swapon __P((const char *)); 174int symlink __P((const char *, const char *)); 175void sync __P((void)); 176int syscall __P((int, ...)); 177int truncate __P((const char *, off_t)); 178int ttyslot __P((void)); 179u_int ualarm __P((u_int, u_int)); 180int undelete __P((const char *)); 181int usleep __P((useconds_t)); 182void *valloc __P((size_t)); /* obsoleted by malloc() */ 183pid_t vfork __P((void)); 184int issetugid __P((void)); 185 186int getopt __P((int, char * const *, const char *)); 187extern char *optarg; /* getopt(3) external variables */ 188extern int opterr; 189extern int optind; 190extern int optopt; 191extern int optreset; 192int getsubopt __P((char **, char * const *, char **)); 193extern char *suboptarg; /* getsubopt(3) external variable */ 194#endif /* !_POSIX_SOURCE */ 195 196#if (!defined(_POSIX_SOURCE) && !defined(_POSIX_C_SOURCE) && \ 197 !defined(_XOPEN_SOURCE)) || \ 198 (defined(_XOPEN_SOURCE) && _XOPEN_SOURCE_EXTENDED - 0 == 1) 199#define F_ULOCK 0 200#define F_LOCK 1 201#define F_TLOCK 2 202#define F_TEST 3 203int lockf __P((int, int, off_t)); 204#endif /* (!defined(_POSIX_SOURCE) && !defined(_XOPEN_SOURCE)) || ... */ 205__END_DECLS 206 207#endif /* !_UNISTD_H_ */ 208