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