]> git.saurik.com Git - apple/libc.git/blob - include/unistd.h
Libc-262.3.2.tar.gz
[apple/libc.git] / include / unistd.h
1 /*
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
7 *
8 * This file contains Original Code and/or Modifications of Original Code
9 * as defined in and that are subject to the Apple Public Source License
10 * Version 2.0 (the 'License'). You may not use this file except in
11 * compliance with the License. Please obtain a copy of the License at
12 * http://www.opensource.apple.com/apsl/ and read it before using this
13 * file.
14 *
15 * The Original Code and all software distributed under the License are
16 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
17 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
18 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
20 * Please see the License for the specific language governing rights and
21 * limitations under the License.
22 *
23 * @APPLE_LICENSE_HEADER_END@
24 */
25 /*-
26 * Copyright (c) 1998-1999 Apple Computer, Inc. All Rights Reserved
27 * Copyright (c) 1991, 1993, 1994
28 * The Regents of the University of California. All rights reserved.
29 *
30 * Redistribution and use in source and binary forms, with or without
31 * modification, are permitted provided that the following conditions
32 * are met:
33 * 1. Redistributions of source code must retain the above copyright
34 * notice, this list of conditions and the following disclaimer.
35 * 2. Redistributions in binary form must reproduce the above copyright
36 * notice, this list of conditions and the following disclaimer in the
37 * documentation and/or other materials provided with the distribution.
38 * 3. All advertising materials mentioning features or use of this software
39 * must display the following acknowledgement:
40 * This product includes software developed by the University of
41 * California, Berkeley and its contributors.
42 * 4. Neither the name of the University nor the names of its contributors
43 * may be used to endorse or promote products derived from this software
44 * without specific prior written permission.
45 *
46 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
47 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
48 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
49 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
50 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
51 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
52 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
53 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
54 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
55 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
56 * SUCH DAMAGE.
57 *
58 * @(#)unistd.h 8.12 (Berkeley) 4/27/95
59 *
60 * Copyright (c) 1998 Apple Compter, Inc.
61 * All Rights Reserved
62 */
63
64 /* History:
65 7/14/99 EKN at Apple fixed getdirentriesattr from getdirentryattr
66 3/26/98 CHW at Apple added real interface to searchfs call
67 3/5/98 CHW at Apple added hfs semantic system calls headers
68 */
69
70 #ifndef _UNISTD_H_
71 #define _UNISTD_H_
72
73 #include <sys/cdefs.h>
74 #include <sys/types.h>
75 #include <sys/unistd.h>
76
77 #define STDIN_FILENO 0 /* standard input file descriptor */
78 #define STDOUT_FILENO 1 /* standard output file descriptor */
79 #define STDERR_FILENO 2 /* standard error file descriptor */
80
81 #ifndef NULL
82 #define NULL 0 /* null pointer constant */
83 #endif
84
85 #define _POSIX_THREADS /* We support pthreads */
86
87 #ifndef _POSIX_SOURCE
88 #define F_ULOCK 0 /* unlock locked section */
89 #define F_LOCK 1 /* lock a section for exclusive use */
90 #define F_TLOCK 2 /* test and lock a section for exclusive use */
91 #define F_TEST 3 /* test a section for locks by other procs */
92 #endif
93
94 __BEGIN_DECLS
95 __dead void
96 _exit __P((int));
97 int access __P((const char *, int));
98 unsigned int alarm __P((unsigned int));
99 int chdir __P((const char *));
100 int chown __P((const char *, uid_t, gid_t));
101 int close __P((int));
102 size_t confstr __P((int, char *, size_t));
103 int dup __P((int));
104 int dup2 __P((int, int));
105 int execl __P((const char *, const char *, ...));
106 int execle __P((const char *, const char *, ...));
107 int execlp __P((const char *, const char *, ...));
108 int execv __P((const char *, char * const *));
109 int execve __P((const char *, char * const *, char * const *));
110 int execvp __P((const char *, char * const *));
111 pid_t fork __P((void));
112 long fpathconf __P((int, int));
113 char *getcwd __P((char *, size_t));
114 gid_t getegid __P((void));
115 uid_t geteuid __P((void));
116 gid_t getgid __P((void));
117 int getgroups __P((int, gid_t []));
118 char *getlogin __P((void));
119 pid_t getpgrp __P((void));
120 pid_t getpid __P((void));
121 pid_t getppid __P((void));
122 uid_t getuid __P((void));
123 int isatty __P((int));
124 int link __P((const char *, const char *));
125 off_t lseek __P((int, off_t, int));
126 long pathconf __P((const char *, int));
127 int pause __P((void));
128 int pipe __P((int *));
129 ssize_t read __P((int, void *, size_t));
130 int rmdir __P((const char *));
131 int setgid __P((gid_t));
132 int setpgid __P((pid_t, pid_t));
133 pid_t setsid __P((void));
134 int setuid __P((uid_t));
135 unsigned int sleep __P((unsigned int));
136 long sysconf __P((int));
137 pid_t tcgetpgrp __P((int));
138 int tcsetpgrp __P((int, pid_t));
139 char *ttyname __P((int));
140 int unlink __P((const char *));
141 ssize_t write __P((int, const void *, size_t));
142
143 extern char *optarg; /* getopt(3) external variables */
144 extern int optind, opterr, optopt, optreset;
145 int getopt __P((int, char * const [], const char *));
146
147 #ifndef _POSIX_SOURCE
148 #ifdef __STDC__
149 struct timeval; /* select(2) */
150 #endif
151 int acct __P((const char *));
152 int async_daemon __P((void));
153 char *brk __P((const char *));
154 int chroot __P((const char *));
155 char *crypt __P((const char *, const char *));
156 int des_cipher __P((const char *, char *, long, int));
157 int des_setkey __P((const char *key));
158 int encrypt __P((char *, int));
159 void endusershell __P((void));
160 int exect __P((const char *, char * const *, char * const *));
161 int fchdir __P((int));
162 int fchown __P((int, int, int));
163 char *fflagstostr __P((u_long));
164 int fsync __P((int));
165 int ftruncate __P((int, off_t));
166 int getdtablesize __P((void));
167 int getgrouplist __P((const char *, int, int *, int *));
168 long gethostid __P((void));
169 int gethostname __P((char *, int));
170 mode_t getmode __P((const void *, mode_t));
171 __pure int
172 getpagesize __P((void));
173 char *getpass __P((const char *));
174 int getpgid __P((pid_t _pid));
175 int getsid __P((pid_t _pid));
176 char *getusershell __P((void));
177 char *getwd __P((char *)); /* obsoleted by getcwd() */
178 int initgroups __P((const char *, int));
179 int iruserok __P((unsigned long, int, const char *, const char *));
180 int issetugid __P((void));
181 char *mkdtemp __P((char *));
182 int mknod __P((const char *, mode_t, dev_t));
183 int mkstemp __P((char *));
184 int mkstemps __P((char *, int));
185 char *mktemp __P((char *));
186 int nfssvc __P((int, void *));
187 int nice __P((int));
188 ssize_t pread __P((int, void *, size_t, off_t));
189 #if 0
190 void psignal __P((unsigned int, const char *));
191 extern __const char *__const sys_siglist[];
192 #else
193 #include <signal.h>
194 #endif
195 int profil __P((char *, int, int, int));
196 ssize_t pwrite __P((int, const void *, size_t, off_t));
197 int rcmd __P((char **, int, const char *,
198 const char *, const char *, int *));
199 char *re_comp __P((const char *));
200 int re_exec __P((const char *));
201 int readlink __P((const char *, char *, int));
202 int reboot __P((int));
203 int revoke __P((const char *));
204 int rresvport __P((int *));
205 int ruserok __P((const char *, int, const char *, const char *));
206 char *sbrk __P((int));
207 int select __P((int, fd_set *, fd_set *, fd_set *, struct timeval *));
208 int setegid __P((gid_t));
209 int seteuid __P((uid_t));
210 int setgroups __P((int, const gid_t *));
211 void sethostid __P((long));
212 int sethostname __P((const char *, int));
213 int setkey __P((const char *));
214 int setlogin __P((const char *));
215 void *setmode __P((const char *));
216 int setpgrp __P((pid_t pid, pid_t pgrp)); /* obsoleted by setpgid() */
217 int setregid __P((gid_t, gid_t));
218 int setreuid __P((uid_t, uid_t));
219 int setrgid __P((gid_t));
220 int setruid __P((uid_t));
221 void setusershell __P((void));
222 int strtofflags __P((char **, u_long *, u_long *));
223 int swapon __P((const char *));
224 int symlink __P((const char *, const char *));
225 void sync __P((void));
226 int syscall __P((int, ...));
227 int truncate __P((const char *, off_t));
228 int ttyslot __P((void));
229 unsigned int ualarm __P((unsigned int, unsigned int));
230 int unwhiteout __P((const char *));
231 int usleep __P((unsigned int));
232 void *valloc __P((size_t));
233 pid_t vfork __P((void));
234
235 extern char *suboptarg; /* getsubopt(3) external variable */
236 int getsubopt __P((char **, char * const *, char **));
237
238 /* HFS & HFS Plus semantics system calls go here */
239 int getattrlist __P((const char*,void*,void*,size_t,unsigned long));
240 int setattrlist __P((const char*,void*,void*,size_t,unsigned long));
241 int exchangedata __P((const char*,const char*,unsigned long));
242 int checkuseraccess __P((const char*,uid_t,gid_t*,int,int,unsigned long));
243 int getdirentriesattr __P((int,void*,void*,size_t,unsigned long*,unsigned long*,unsigned long*,unsigned long));
244 int searchfs __P((const char*,void*,void*,unsigned long,unsigned long,void*));
245
246 int fsctl __P((const char *,unsigned long,void*,unsigned long));
247
248
249 #endif /* !_POSIX_SOURCE */
250 __END_DECLS
251
252 #endif /* !_UNISTD_H_ */