unistd.h revision 1.39
1/* $NetBSD: unistd.h,v 1.39 1997/07/20 19:18:49 christos Exp $ */ 2 3/*- 4 * Copyright (c) 1991 The Regents of the University of California. 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions 9 * are met: 10 * 1. Redistributions of source code must retain the above copyright 11 * notice, this list of conditions and the following disclaimer. 12 * 2. Redistributions in binary form must reproduce the above copyright 13 * notice, this list of conditions and the following disclaimer in the 14 * documentation and/or other materials provided with the distribution. 15 * 3. All advertising materials mentioning features or use of this software 16 * must display the following acknowledgement: 17 * This product includes software developed by the University of 18 * California, Berkeley and its contributors. 19 * 4. Neither the name of the University nor the names of its contributors 20 * may be used to endorse or promote products derived from this software 21 * without specific prior written permission. 22 * 23 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 24 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 25 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 26 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 27 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 33 * SUCH DAMAGE. 34 * 35 * @(#)unistd.h 5.13 (Berkeley) 6/17/91 36 */ 37 38#ifndef _UNISTD_H_ 39#define _UNISTD_H_ 40 41#include <sys/cdefs.h> 42#include <sys/types.h> 43#include <sys/unistd.h> 44 45#define STDIN_FILENO 0 /* standard input file descriptor */ 46#define STDOUT_FILENO 1 /* standard output file descriptor */ 47#define STDERR_FILENO 2 /* standard error file descriptor */ 48 49#ifndef NULL 50#define NULL 0 /* null pointer constant */ 51#endif 52 53__BEGIN_DECLS 54__dead void _exit __P((int)) __attribute__((noreturn)); 55int access __P((const char *, int)); 56unsigned alarm __P((unsigned)); 57int chdir __P((const char *)); 58int chown __P((const char *, uid_t, gid_t)); 59int close __P((int)); 60size_t confstr __P((int, char *, size_t)); 61char *cuserid __P((char *)); 62int dup __P((int)); 63int dup2 __P((int, int)); 64int execl __P((const char *, const char *, ...)); 65int execle __P((const char *, const char *, ...)); 66int execlp __P((const char *, const char *, ...)); 67int execv __P((const char *, char * const *)); 68int execve __P((const char *, char * const *, char * const *)); 69int execvp __P((const char *, char * const *)); 70pid_t fork __P((void)); 71long fpathconf __P((int, int)); /* not yet */ 72char *getcwd __P((char *, size_t)); 73gid_t getegid __P((void)); 74uid_t geteuid __P((void)); 75gid_t getgid __P((void)); 76int getgrouplist __P((const char *, gid_t, gid_t *, int *)); 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)); /* not yet */ 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 sleep __P((unsigned)); 96long sysconf __P((int)); /* not yet */ 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)); 123long gethostid __P((void)); 124int gethostname __P((char *, int)); 125mode_t getmode __P((const void *, mode_t)); 126int getpagesize __P((void)); 127char *getpass __P((const char *)); 128char *getusershell __P((void)); 129char *getwd __P((char *)); /* obsoleted by getcwd() */ 130int initgroups __P((const char *, gid_t)); 131int iruserok __P((u_int32_t, int, const char *, const char *)); 132int mknod __P((const char *, mode_t, dev_t)); 133int mkstemp __P((char *)); 134char *mktemp __P((char *)); 135int nfssvc __P((int, void *)); 136int nice __P((int)); 137void psignal __P((unsigned int, const char *)); 138extern __const char *__const sys_siglist[]; 139int profil __P((char *, size_t, u_long, u_int)); 140int rcmd __P((char **, int, const char *, 141 const char *, const char *, int *)); 142char *re_comp __P((const char *)); 143int re_exec __P((const char *)); 144int readlink __P((const char *, char *, int)); 145int reboot __P((int, char *)); 146int revoke __P((const char *)); 147int rresvport __P((int *)); 148int ruserok __P((const char *, int, const char *, const char *)); 149char *sbrk __P((int)); 150int select __P((int, fd_set *, fd_set *, fd_set *, struct timeval *)); 151int setdomainname __P((const char *, int)); 152int setegid __P((gid_t)); 153int seteuid __P((uid_t)); 154int setgroups __P((int, const gid_t *)); 155int sethostid __P((long)); 156int sethostname __P((const char *, int)); 157int setkey __P((const char *)); 158int setlogin __P((const char *)); 159void *setmode __P((const char *)); 160int setpgrp __P((pid_t pid, pid_t pgrp)); /* obsoleted by setpgid() */ 161int setregid __P((gid_t, gid_t)); 162int setreuid __P((uid_t, uid_t)); 163int setrgid __P((gid_t)); 164int setruid __P((uid_t)); 165void setusershell __P((void)); 166int swapctl __P((int, const void *, int)); 167int swapon __P((const char *)); /* obsoleted by swapctl() */ 168int symlink __P((const char *, const char *)); 169void sync __P((void)); 170int syscall __P((int, ...)); 171quad_t __syscall __P((quad_t, ...)); 172int truncate __P((const char *, off_t)); 173int ttyslot __P((void)); 174u_int ualarm __P((u_int, u_int)); 175int undelete __P((const char *)); 176void usleep __P((u_int)); 177void *valloc __P((size_t)); /* obsoleted by malloc() */ 178pid_t vfork __P((void)); 179 180int getopt __P((int, char * const *, const char *)); 181extern char *optarg; /* getopt(3) external variables */ 182extern int opterr; 183extern int optind; 184extern int optopt; 185extern int optreset; 186int getsubopt __P((char **, char * const *, char **)); 187extern char *suboptarg; /* getsubopt(3) external variable */ 188#endif /* !_POSIX_SOURCE */ 189__END_DECLS 190 191#endif /* !_UNISTD_H_ */ 192