]>
git.saurik.com Git - apple/libc.git/blob - include/unistd.h
2bec5941740233b2fbddcc7b495ff3ff5b48c31c
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
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
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.
23 * @APPLE_LICENSE_HEADER_END@
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.
30 * Redistribution and use in source and binary forms, with or without
31 * modification, are permitted provided that the following conditions
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.
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
58 * @(#)unistd.h 8.12 (Berkeley) 4/27/95
60 * Copyright (c) 1998 Apple Compter, Inc.
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
73 #include <sys/cdefs.h>
74 #include <sys/types.h>
75 #include <sys/unistd.h>
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 */
82 #define NULL 0 /* null pointer constant */
85 #define _POSIX_THREADS /* We support pthreads */
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 */
94 /* configurable system variables */
96 #define _SC_CHILD_MAX 2
98 #define _SC_NGROUPS_MAX 4
99 #define _SC_OPEN_MAX 5
100 #define _SC_JOB_CONTROL 6
101 #define _SC_SAVED_IDS 7
102 #define _SC_VERSION 8
103 #define _SC_BC_BASE_MAX 9
104 #define _SC_BC_DIM_MAX 10
105 #define _SC_BC_SCALE_MAX 11
106 #define _SC_BC_STRING_MAX 12
107 #define _SC_COLL_WEIGHTS_MAX 13
108 #define _SC_EXPR_NEST_MAX 14
109 #define _SC_LINE_MAX 15
110 #define _SC_RE_DUP_MAX 16
111 #define _SC_2_VERSION 17
112 #define _SC_2_C_BIND 18
113 #define _SC_2_C_DEV 19
114 #define _SC_2_CHAR_TERM 20
115 #define _SC_2_FORT_DEV 21
116 #define _SC_2_FORT_RUN 22
117 #define _SC_2_LOCALEDEF 23
118 #define _SC_2_SW_DEV 24
120 #define _SC_STREAM_MAX 26
121 #define _SC_TZNAME_MAX 27
122 /* POSIX.1B sysconf options for async IO*/
123 #define _SC_ASYNCHRONOUS_IO 28
124 #define _SC_PAGESIZE 29
125 #define _SC_AIO_LISTIO_MAX 42
126 #define _SC_AIO_MAX 43
127 #define _SC_AIO_PRIO_DELTA_MAX 44
131 void _Exit(int) __dead2
;
132 void _exit(int) __dead2
;
133 int access(const char *, int);
134 unsigned int alarm(unsigned int);
135 int chdir(const char *);
136 int chown(const char *, uid_t
, gid_t
);
138 size_t confstr(int, char *, size_t);
141 int execl(const char *, const char *, ...);
142 int execle(const char *, const char *, ...);
143 int execlp(const char *, const char *, ...);
144 int execv(const char *, char * const *);
145 int execve(const char *, char * const *, char * const *);
146 int execvp(const char *, char * const *);
148 long fpathconf(int, int);
149 char *getcwd(char *, size_t);
150 int getdomainname(char *, int);
154 int getgroups(int, gid_t
[]);
155 char *getlogin(void);
156 int getlogin_r(char *, int);
162 int link(const char *, const char *);
163 off_t
lseek(int, off_t
, int);
164 long pathconf(const char *, int);
167 ssize_t
read(int, void *, size_t);
168 int rmdir(const char *);
169 int setdomainname(const char *, int);
171 int setpgid(pid_t
, pid_t
);
174 unsigned int sleep(unsigned int);
176 pid_t
tcgetpgrp(int);
177 int tcsetpgrp(int, pid_t
);
179 char *ttyname_r(int, char *, size_t);
180 int unlink(const char *);
181 ssize_t
write(int, const void *, size_t);
183 extern char *optarg
; /* getopt(3) external variables */
184 extern int optind
, opterr
, optopt
, optreset
;
185 int getopt(int, char * const [], const char *);
187 #ifndef _POSIX_SOURCE
189 struct timespec
; /* pselect(3) */
190 struct timeval
; /* select(2) */
192 int acct(const char *);
193 int async_daemon(void);
194 char *brk(const char *);
195 int chroot(const char *);
196 char *crypt(const char *, const char *);
197 int des_cipher(const char *, char *, long, int);
198 int des_setkey(const char *key
);
199 int encrypt(char *, int);
200 void endusershell(void);
202 int fchown(int, int, int);
203 char *fflagstostr(u_long
);
205 int ftruncate(int, off_t
);
206 int getdtablesize(void);
207 int getgrouplist(const char *, int, int *, int *);
208 long gethostid(void);
209 int gethostname(char *, int);
210 mode_t
getmode(const void *, mode_t
);
211 int getpagesize(void) __pure2
;
212 char *getpass(const char *);
213 int getpgid(pid_t _pid
);
214 int getsid(pid_t _pid
);
215 char *getusershell(void);
216 char *getwd(char *); /* obsoleted by getcwd() */
217 int lockf(int, int, off_t
);
218 int initgroups(const char *, int);
219 int iruserok(unsigned long, int, const char *, const char *);
221 char *mkdtemp(char *);
222 int mknod(const char *, mode_t
, dev_t
);
224 int mkstemps(char *, int);
225 char *mktemp(char *);
226 int nfssvc(int, void *);
228 ssize_t
pread(int, void *, size_t, off_t
);
230 void psignal(unsigned int, const char *);
231 extern __const
char *__const sys_siglist
[];
235 int profil(char *, int, int, int);
237 int pselect(int, fd_set
*, fd_set
*, fd_set
*,
238 const struct timespec
*, const sigset_t
*);
239 #endif /* ! __MWERKS__ */
240 ssize_t
pwrite(int, const void *, size_t, off_t
);
241 int rcmd(char **, int, const char *, const char *, const char *, int *);
242 int readlink(const char *, char *, int);
244 int revoke(const char *);
245 int rresvport(int *);
246 int rresvport_af(int *, int);
247 int ruserok(const char *, int, const char *, const char *);
249 int select(int, fd_set
*, fd_set
*, fd_set
*, struct timeval
*);
252 int setgroups(int, const gid_t
*);
253 void sethostid(long);
254 int sethostname(const char *, int);
255 int setkey(const char *);
256 int setlogin(const char *);
257 void *setmode(const char *);
258 int setpgrp(pid_t pid
, pid_t pgrp
); /* obsoleted by setpgid() */
259 int setregid(gid_t
, gid_t
);
260 int setreuid(uid_t
, uid_t
);
263 void setusershell(void);
264 int strtofflags(char **, u_long
*, u_long
*);
265 int swapon(const char *);
266 int symlink(const char *, const char *);
268 int syscall(int, ...);
269 int truncate(const char *, off_t
);
271 unsigned int ualarm(unsigned int, unsigned int);
272 int undelete(const char *);
273 int unwhiteout(const char *);
274 int usleep(unsigned int);
275 void *valloc(size_t);
278 extern char *suboptarg
; /* getsubopt(3) external variable */
279 int getsubopt(char **, char * const *, char **);
281 /* HFS & HFS Plus semantics system calls go here */
282 int getattrlist(const char*,void*,void*,size_t,unsigned long);
283 int setattrlist(const char*,void*,void*,size_t,unsigned long);
284 int exchangedata(const char*,const char*,unsigned long);
285 int checkuseraccess(const char*,uid_t
,gid_t
*,int,int,unsigned long);
286 int getdirentriesattr(int,void*,void*,size_t,unsigned long*,unsigned long*,unsigned long*,unsigned long);
287 int searchfs(const char*,void*,void*,unsigned long,unsigned long,void*);
289 int fsctl(const char *,unsigned long,void*,unsigned long);
292 #endif /* !_POSIX_SOURCE */
295 #endif /* !_UNISTD_H_ */