]> git.saurik.com Git - apple/libc.git/blob - include/unistd.h
d086ae8b26fe2bbbedef1ac4d8bccc6850950c0a
[apple/libc.git] / include / unistd.h
1 /*
2 * Copyright (c) 2000, 2002-2006, 2008, 2009 Apple Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
12 *
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23 /*-
24 * Copyright (c) 1998-1999 Apple Computer, Inc. All Rights Reserved
25 * Copyright (c) 1991, 1993, 1994
26 * The Regents of the University of California. All rights reserved.
27 *
28 * Redistribution and use in source and binary forms, with or without
29 * modification, are permitted provided that the following conditions
30 * are met:
31 * 1. Redistributions of source code must retain the above copyright
32 * notice, this list of conditions and the following disclaimer.
33 * 2. Redistributions in binary form must reproduce the above copyright
34 * notice, this list of conditions and the following disclaimer in the
35 * documentation and/or other materials provided with the distribution.
36 * 3. All advertising materials mentioning features or use of this software
37 * must display the following acknowledgement:
38 * This product includes software developed by the University of
39 * California, Berkeley and its contributors.
40 * 4. Neither the name of the University nor the names of its contributors
41 * may be used to endorse or promote products derived from this software
42 * without specific prior written permission.
43 *
44 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
45 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
46 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
47 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
48 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
49 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
50 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
51 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
52 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
53 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
54 * SUCH DAMAGE.
55 *
56 * @(#)unistd.h 8.12 (Berkeley) 4/27/95
57 *
58 * Copyright (c) 1998 Apple Compter, Inc.
59 * All Rights Reserved
60 */
61
62 /* History:
63 7/14/99 EKN at Apple fixed getdirentriesattr from getdirentryattr
64 3/26/98 CHW at Apple added real interface to searchfs call
65 3/5/98 CHW at Apple added hfs semantic system calls headers
66 */
67
68 #ifndef _UNISTD_H_
69 #define _UNISTD_H_
70
71 #include <_types.h>
72 #include <sys/unistd.h>
73
74 #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
75 #ifndef _DEV_T
76 #define _DEV_T
77 typedef __darwin_dev_t dev_t;
78 #endif
79 #endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */
80
81 #ifndef _GID_T
82 #define _GID_T
83 typedef __darwin_gid_t gid_t;
84 #endif
85
86 #ifndef _INTPTR_T
87 #define _INTPTR_T
88 typedef __darwin_intptr_t intptr_t;
89 #endif
90
91 #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
92 #ifndef _MODE_T
93 #define _MODE_T
94 typedef __darwin_mode_t mode_t;
95 #endif
96 #endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */
97
98 #ifndef _OFF_T
99 #define _OFF_T
100 typedef __darwin_off_t off_t;
101 #endif
102
103 #ifndef _PID_T
104 #define _PID_T
105 typedef __darwin_pid_t pid_t;
106 #endif
107
108 #ifndef _SIZE_T
109 #define _SIZE_T
110 /* DO NOT REMOVE THIS COMMENT: fixincludes needs to see:
111 * _GCC_SIZE_T */
112 typedef __darwin_size_t size_t;
113 #endif
114
115 #ifndef _SSIZE_T
116 #define _SSIZE_T
117 typedef __darwin_ssize_t ssize_t;
118 #endif
119
120 #ifndef _UID_T
121 #define _UID_T
122 typedef __darwin_uid_t uid_t; /* user id */
123 #endif
124
125 #ifndef _USECONDS_T
126 #define _USECONDS_T
127 typedef __darwin_useconds_t useconds_t;
128 #endif
129
130 #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
131 #ifndef _UUID_T
132 #define _UUID_T
133 typedef __darwin_uuid_t uuid_t;
134 #endif /* _UUID_T */
135 #endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */
136
137 #define STDIN_FILENO 0 /* standard input file descriptor */
138 #define STDOUT_FILENO 1 /* standard output file descriptor */
139 #define STDERR_FILENO 2 /* standard error file descriptor */
140
141 #ifndef NULL
142 #define NULL __DARWIN_NULL
143 #endif /* ! NULL */
144
145 /* Version test macros */
146 /* _POSIX_VERSION and _POSIX2_VERSION from sys/unistd.h */
147 #define _XOPEN_VERSION 600 /* [XSI] */
148 #define _XOPEN_XCU_VERSION 4 /* Older standard */
149
150
151 /* Please keep this list in the same order as the applicable standard */
152 #define _POSIX_ADVISORY_INFO (-1) /* [ADV] */
153 #define _POSIX_ASYNCHRONOUS_IO (-1) /* [AIO] */
154 #define _POSIX_BARRIERS (-1) /* [BAR] */
155 #define _POSIX_CHOWN_RESTRICTED 200112L
156 #define _POSIX_CLOCK_SELECTION (-1) /* [CS] */
157 #define _POSIX_CPUTIME (-1) /* [CPT] */
158 #define _POSIX_FSYNC 200112L /* [FSC] */
159 #define _POSIX_IPV6 200112L
160 #define _POSIX_JOB_CONTROL 200112L
161 #define _POSIX_MAPPED_FILES 200112L /* [MF] */
162 #define _POSIX_MEMLOCK (-1) /* [ML] */
163 #define _POSIX_MEMLOCK_RANGE (-1) /* [MR] */
164 #define _POSIX_MEMORY_PROTECTION 200112L /* [MPR] */
165 #define _POSIX_MESSAGE_PASSING (-1) /* [MSG] */
166 #define _POSIX_MONOTONIC_CLOCK (-1) /* [MON] */
167 #define _POSIX_NO_TRUNC 200112L
168 #define _POSIX_PRIORITIZED_IO (-1) /* [PIO] */
169 #define _POSIX_PRIORITY_SCHEDULING (-1) /* [PS] */
170 #define _POSIX_RAW_SOCKETS (-1) /* [RS] */
171 #define _POSIX_READER_WRITER_LOCKS 200112L /* [THR] */
172 #define _POSIX_REALTIME_SIGNALS (-1) /* [RTS] */
173 #define _POSIX_REGEXP 200112L
174 #define _POSIX_SAVED_IDS 200112L /* XXX required */
175 #define _POSIX_SEMAPHORES (-1) /* [SEM] */
176 #define _POSIX_SHARED_MEMORY_OBJECTS (-1) /* [SHM] */
177 #define _POSIX_SHELL 200112L
178 #define _POSIX_SPAWN (-1) /* [SPN] */
179 #define _POSIX_SPIN_LOCKS (-1) /* [SPI] */
180 #define _POSIX_SPORADIC_SERVER (-1) /* [SS] */
181 #define _POSIX_SYNCHRONIZED_IO (-1) /* [SIO] */
182 #define _POSIX_THREAD_ATTR_STACKADDR 200112L /* [TSA] */
183 #define _POSIX_THREAD_ATTR_STACKSIZE 200112L /* [TSS] */
184 #define _POSIX_THREAD_CPUTIME (-1) /* [TCT] */
185 #define _POSIX_THREAD_PRIO_INHERIT (-1) /* [TPI] */
186 #define _POSIX_THREAD_PRIO_PROTECT (-1) /* [TPP] */
187 #define _POSIX_THREAD_PRIORITY_SCHEDULING (-1) /* [TPS] */
188 #define _POSIX_THREAD_PROCESS_SHARED 200112L /* [TSH] */
189 #define _POSIX_THREAD_SAFE_FUNCTIONS 200112L /* [TSF] */
190 #define _POSIX_THREAD_SPORADIC_SERVER (-1) /* [TSP] */
191 #define _POSIX_THREADS 200112L /* [THR] */
192 #define _POSIX_TIMEOUTS (-1) /* [TMO] */
193 #define _POSIX_TIMERS (-1) /* [TMR] */
194 #define _POSIX_TRACE (-1) /* [TRC] */
195 #define _POSIX_TRACE_EVENT_FILTER (-1) /* [TEF] */
196 #define _POSIX_TRACE_INHERIT (-1) /* [TRI] */
197 #define _POSIX_TRACE_LOG (-1) /* [TRL] */
198 #define _POSIX_TYPED_MEMORY_OBJECTS (-1) /* [TYM] */
199 #ifndef _POSIX_VDISABLE
200 #define _POSIX_VDISABLE 0xff /* same as sys/termios.h */
201 #endif /* _POSIX_VDISABLE */
202
203 #define _POSIX2_C_BIND 200112L
204 #define _POSIX2_C_DEV 200112L /* c99 command */
205 #define _POSIX2_CHAR_TERM 200112L
206 #define _POSIX2_FORT_DEV (-1) /* fort77 command */
207 #define _POSIX2_FORT_RUN 200112L
208 #define _POSIX2_LOCALEDEF 200112L /* localedef command */
209 #define _POSIX2_PBS (-1)
210 #define _POSIX2_PBS_ACCOUNTING (-1)
211 #define _POSIX2_PBS_CHECKPOINT (-1)
212 #define _POSIX2_PBS_LOCATE (-1)
213 #define _POSIX2_PBS_MESSAGE (-1)
214 #define _POSIX2_PBS_TRACK (-1)
215 #define _POSIX2_SW_DEV 200112L
216 #define _POSIX2_UPE 200112L /* XXXX no fc, newgrp, tabs */
217
218 #define _V6_ILP32_OFF32 (-1)
219 #define _V6_ILP32_OFFBIG (1)
220 #define _V6_LP64_OFF64 (-1)
221 #define _V6_LPBIG_OFFBIG (-1)
222
223 #define _XBS5_ILP32_OFF32 _V6_ILP32_OFF32 /* legacy */
224 #define _XBS5_ILP32_OFFBIG _V6_ILP32_OFFBIG /* legacy */
225 #define _XBS5_LP64_OFF64 _V6_LP64_OFF64 /* legacy */
226 #define _XBS5_LPBIG_OFFBIG _V6_LPBIG_OFFBIG /* legacy */
227
228 #define _XOPEN_CRYPT (1)
229 #define _XOPEN_ENH_I18N (1) /* XXX required */
230 #define _XOPEN_LEGACY (-1) /* no ftime gcvt, wcswcs */
231 #define _XOPEN_REALTIME (-1) /* no q'ed signals, mq_* */
232 #define _XOPEN_REALTIME_THREADS (-1) /* no posix_spawn, et. al. */
233 #define _XOPEN_SHM (1)
234 #define _XOPEN_STREAMS (-1)
235 #define _XOPEN_UNIX (1)
236
237
238 #define F_ULOCK 0 /* unlock locked section */
239 #define F_LOCK 1 /* lock a section for exclusive use */
240 #define F_TLOCK 2 /* test and lock a section for exclusive use */
241 #define F_TEST 3 /* test a section for locks by other procs */
242
243 /* configurable system variables */
244 #define _SC_ARG_MAX 1
245 #define _SC_CHILD_MAX 2
246 #define _SC_CLK_TCK 3
247 #define _SC_NGROUPS_MAX 4
248 #define _SC_OPEN_MAX 5
249 #define _SC_JOB_CONTROL 6
250 #define _SC_SAVED_IDS 7
251 #define _SC_VERSION 8
252 #define _SC_BC_BASE_MAX 9
253 #define _SC_BC_DIM_MAX 10
254 #define _SC_BC_SCALE_MAX 11
255 #define _SC_BC_STRING_MAX 12
256 #define _SC_COLL_WEIGHTS_MAX 13
257 #define _SC_EXPR_NEST_MAX 14
258 #define _SC_LINE_MAX 15
259 #define _SC_RE_DUP_MAX 16
260 #define _SC_2_VERSION 17
261 #define _SC_2_C_BIND 18
262 #define _SC_2_C_DEV 19
263 #define _SC_2_CHAR_TERM 20
264 #define _SC_2_FORT_DEV 21
265 #define _SC_2_FORT_RUN 22
266 #define _SC_2_LOCALEDEF 23
267 #define _SC_2_SW_DEV 24
268 #define _SC_2_UPE 25
269 #define _SC_STREAM_MAX 26
270 #define _SC_TZNAME_MAX 27
271 #define _SC_ASYNCHRONOUS_IO 28
272 #define _SC_PAGESIZE 29
273 #define _SC_MEMLOCK 30
274 #define _SC_MEMLOCK_RANGE 31
275 #define _SC_MEMORY_PROTECTION 32
276 #define _SC_MESSAGE_PASSING 33
277 #define _SC_PRIORITIZED_IO 34
278 #define _SC_PRIORITY_SCHEDULING 35
279 #define _SC_REALTIME_SIGNALS 36
280 #define _SC_SEMAPHORES 37
281 #define _SC_FSYNC 38
282 #define _SC_SHARED_MEMORY_OBJECTS 39
283 #define _SC_SYNCHRONIZED_IO 40
284 #define _SC_TIMERS 41
285 #define _SC_AIO_LISTIO_MAX 42
286 #define _SC_AIO_MAX 43
287 #define _SC_AIO_PRIO_DELTA_MAX 44
288 #define _SC_DELAYTIMER_MAX 45
289 #define _SC_MQ_OPEN_MAX 46
290 #define _SC_MAPPED_FILES 47 /* swap _SC_PAGESIZE vs. BSD */
291 #define _SC_RTSIG_MAX 48
292 #define _SC_SEM_NSEMS_MAX 49
293 #define _SC_SEM_VALUE_MAX 50
294 #define _SC_SIGQUEUE_MAX 51
295 #define _SC_TIMER_MAX 52
296 #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
297 #define _SC_NPROCESSORS_CONF 57
298 #define _SC_NPROCESSORS_ONLN 58
299 #endif /* !_POSIX_C_SOURCE || _DARWIN_C_SOURCE */
300 #define _SC_2_PBS 59
301 #define _SC_2_PBS_ACCOUNTING 60
302 #define _SC_2_PBS_CHECKPOINT 61
303 #define _SC_2_PBS_LOCATE 62
304 #define _SC_2_PBS_MESSAGE 63
305 #define _SC_2_PBS_TRACK 64
306 #define _SC_ADVISORY_INFO 65
307 #define _SC_BARRIERS 66
308 #define _SC_CLOCK_SELECTION 67
309 #define _SC_CPUTIME 68
310 #define _SC_FILE_LOCKING 69
311 #define _SC_GETGR_R_SIZE_MAX 70
312 #define _SC_GETPW_R_SIZE_MAX 71
313 #define _SC_HOST_NAME_MAX 72
314 #define _SC_LOGIN_NAME_MAX 73
315 #define _SC_MONOTONIC_CLOCK 74
316 #define _SC_MQ_PRIO_MAX 75
317 #define _SC_READER_WRITER_LOCKS 76
318 #define _SC_REGEXP 77
319 #define _SC_SHELL 78
320 #define _SC_SPAWN 79
321 #define _SC_SPIN_LOCKS 80
322 #define _SC_SPORADIC_SERVER 81
323 #define _SC_THREAD_ATTR_STACKADDR 82
324 #define _SC_THREAD_ATTR_STACKSIZE 83
325 #define _SC_THREAD_CPUTIME 84
326 #define _SC_THREAD_DESTRUCTOR_ITERATIONS 85
327 #define _SC_THREAD_KEYS_MAX 86
328 #define _SC_THREAD_PRIO_INHERIT 87
329 #define _SC_THREAD_PRIO_PROTECT 88
330 #define _SC_THREAD_PRIORITY_SCHEDULING 89
331 #define _SC_THREAD_PROCESS_SHARED 90
332 #define _SC_THREAD_SAFE_FUNCTIONS 91
333 #define _SC_THREAD_SPORADIC_SERVER 92
334 #define _SC_THREAD_STACK_MIN 93
335 #define _SC_THREAD_THREADS_MAX 94
336 #define _SC_TIMEOUTS 95
337 #define _SC_THREADS 96
338 #define _SC_TRACE 97
339 #define _SC_TRACE_EVENT_FILTER 98
340 #define _SC_TRACE_INHERIT 99
341 #define _SC_TRACE_LOG 100
342 #define _SC_TTY_NAME_MAX 101
343 #define _SC_TYPED_MEMORY_OBJECTS 102
344 #define _SC_V6_ILP32_OFF32 103
345 #define _SC_V6_ILP32_OFFBIG 104
346 #define _SC_V6_LP64_OFF64 105
347 #define _SC_V6_LPBIG_OFFBIG 106
348 #define _SC_IPV6 118
349 #define _SC_RAW_SOCKETS 119
350 #define _SC_SYMLOOP_MAX 120
351 #define _SC_ATEXIT_MAX 107
352 #define _SC_IOV_MAX 56
353 #define _SC_PAGE_SIZE _SC_PAGESIZE
354 #define _SC_XOPEN_CRYPT 108
355 #define _SC_XOPEN_ENH_I18N 109
356 #define _SC_XOPEN_LEGACY 110
357 #define _SC_XOPEN_REALTIME 111
358 #define _SC_XOPEN_REALTIME_THREADS 112
359 #define _SC_XOPEN_SHM 113
360 #define _SC_XOPEN_STREAMS 114
361 #define _SC_XOPEN_UNIX 115
362 #define _SC_XOPEN_VERSION 116
363 #define _SC_XOPEN_XCU_VERSION 121
364 #define _SC_XBS5_ILP32_OFF32 122
365 #define _SC_XBS5_ILP32_OFFBIG 123
366 #define _SC_XBS5_LP64_OFF64 124
367 #define _SC_XBS5_LPBIG_OFFBIG 125
368 #define _SC_SS_REPL_MAX 126
369 #define _SC_TRACE_EVENT_NAME_MAX 127
370 #define _SC_TRACE_NAME_MAX 128
371 #define _SC_TRACE_SYS_MAX 129
372 #define _SC_TRACE_USER_EVENT_MAX 130
373 #define _SC_PASS_MAX 131
374
375 #ifndef _CS_PATH /* XXX temporary #ifdef'ed for <sys/unistd.h> */
376 #define _CS_PATH 1
377 #endif
378 #define _CS_POSIX_V6_ILP32_OFF32_CFLAGS 2
379 #define _CS_POSIX_V6_ILP32_OFF32_LDFLAGS 3
380 #define _CS_POSIX_V6_ILP32_OFF32_LIBS 4
381 #define _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS 5
382 #define _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS 6
383 #define _CS_POSIX_V6_ILP32_OFFBIG_LIBS 7
384 #define _CS_POSIX_V6_LP64_OFF64_CFLAGS 8
385 #define _CS_POSIX_V6_LP64_OFF64_LDFLAGS 9
386 #define _CS_POSIX_V6_LP64_OFF64_LIBS 10
387 #define _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS 11
388 #define _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS 12
389 #define _CS_POSIX_V6_LPBIG_OFFBIG_LIBS 13
390 #define _CS_POSIX_V6_WIDTH_RESTRICTED_ENVS 14
391
392 /* reserved for compatibility with Issue 5 */
393 #define _CS_XBS5_ILP32_OFF32_CFLAGS 20
394 #define _CS_XBS5_ILP32_OFF32_LDFLAGS 21
395 #define _CS_XBS5_ILP32_OFF32_LIBS 22
396 #define _CS_XBS5_ILP32_OFF32_LINTFLAGS 23
397 #define _CS_XBS5_ILP32_OFFBIG_CFLAGS 24
398 #define _CS_XBS5_ILP32_OFFBIG_LDFLAGS 25
399 #define _CS_XBS5_ILP32_OFFBIG_LIBS 26
400 #define _CS_XBS5_ILP32_OFFBIG_LINTFLAGS 27
401 #define _CS_XBS5_LP64_OFF64_CFLAGS 28
402 #define _CS_XBS5_LP64_OFF64_LDFLAGS 29
403 #define _CS_XBS5_LP64_OFF64_LIBS 30
404 #define _CS_XBS5_LP64_OFF64_LINTFLAGS 31
405 #define _CS_XBS5_LPBIG_OFFBIG_CFLAGS 32
406 #define _CS_XBS5_LPBIG_OFFBIG_LDFLAGS 33
407 #define _CS_XBS5_LPBIG_OFFBIG_LIBS 34
408 #define _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS 35
409
410 #define _CS_DARWIN_USER_DIR 65536
411 #define _CS_DARWIN_USER_TEMP_DIR 65537
412 #define _CS_DARWIN_USER_CACHE_DIR 65538
413
414 __BEGIN_DECLS
415
416 void _exit(int) __dead2;
417 int access(const char *, int);
418 unsigned int
419 alarm(unsigned int);
420 int chdir(const char *);
421 int chown(const char *, uid_t, gid_t);
422 //Begin-Libc
423 #ifndef LIBC_ALIAS_CLOSE
424 //End-Libc
425 int close(int) __DARWIN_ALIAS_C(close);
426 //Begin-Libc
427 #else /* LIBC_ALIAS_CLOSE */
428 int close(int) LIBC_ALIAS_C(close);
429 #endif /* !LIBC_ALIAS_CLOSE */
430 //End-Libc
431 //Begin-Libc
432 #ifndef LIBC_ALIAS_CONFSTR
433 //End-Libc
434 size_t confstr(int, char *, size_t) __DARWIN_ALIAS(confstr);
435 //Begin-Libc
436 #else /* LIBC_ALIAS_CONFSTR */
437 size_t confstr(int, char *, size_t) LIBC_ALIAS(confstr);
438 #endif /* !LIBC_ALIAS_CONFSTR */
439 //End-Libc
440 char *crypt(const char *, const char *);
441 char *ctermid(char *);
442 int dup(int);
443 int dup2(int, int);
444 #if __DARWIN_UNIX03
445 //Begin-Libc
446 #ifndef LIBC_ALIAS_ENCRYPT
447 //End-Libc
448 void encrypt(char *, int) __DARWIN_ALIAS(encrypt);
449 //Begin-Libc
450 #else /* LIBC_ALIAS_ENCRYPT */
451 void encrypt(char *, int) LIBC_ALIAS(encrypt);
452 #endif /* !LIBC_ALIAS_ENCRYPT */
453 //End-Libc
454 #else /* !__DARWIN_UNIX03 */
455 int encrypt(char *, int);
456 #endif /* __DARWIN_UNIX03 */
457 int execl(const char *, const char *, ...);
458 int execle(const char *, const char *, ...);
459 int execlp(const char *, const char *, ...);
460 int execv(const char *, char * const *);
461 int execve(const char *, char * const *, char * const *);
462 int execvp(const char *, char * const *);
463 int fchown(int, uid_t, gid_t);
464 int fchdir(int);
465 pid_t fork(void);
466 long fpathconf(int, int);
467 //Begin-Libc
468 #ifndef LIBC_ALIAS_FSYNC
469 //End-Libc
470 int fsync(int) __DARWIN_ALIAS_C(fsync);
471 //Begin-Libc
472 #else /* LIBC_ALIAS_FSYNC */
473 int fsync(int) LIBC_ALIAS_C(fsync);
474 #endif /* !LIBC_ALIAS_FSYNC */
475 //End-Libc
476 int ftruncate(int, off_t);
477 char *getcwd(char *, size_t);
478 gid_t getegid(void);
479 uid_t geteuid(void);
480 gid_t getgid(void);
481 #if defined(_DARWIN_UNLIMITED_GETGROUPS) || defined(_DARWIN_C_SOURCE)
482 int getgroups(int, gid_t []) __DARWIN_EXTSN(getgroups);
483 #else /* !_DARWIN_UNLIMITED_GETGROUPS && !_DARWIN_C_SOURCE */
484 int getgroups(int, gid_t []);
485 #endif /* _DARWIN_UNLIMITED_GETGROUPS || _DARWIN_C_SOURCE */
486 long gethostid(void);
487 int gethostname(char *, size_t);
488 char *getlogin(void);
489 int getlogin_r(char *, size_t);
490 //Begin-Libc
491 #ifndef LIBC_ALIAS_GETOPT
492 //End-Libc
493 int getopt(int, char * const [], const char *) __DARWIN_ALIAS(getopt);
494 //Begin-Libc
495 #else /* LIBC_ALIAS_GETOPT */
496 int getopt(int, char * const [], const char *) LIBC_ALIAS(getopt);
497 #endif /* !LIBC_ALIAS_GETOPT */
498 //End-Libc
499 pid_t getpgid(pid_t);
500 pid_t getpgrp(void);
501 pid_t getpid(void);
502 pid_t getppid(void);
503 pid_t getsid(pid_t);
504 uid_t getuid(void);
505 char *getwd(char *); /* obsoleted by getcwd() */
506 int isatty(int);
507 //Begin-Libc
508 #ifndef LIBC_ALIAS_LCHOWN
509 //End-Libc
510 int lchown(const char *, uid_t, gid_t) __DARWIN_ALIAS(lchown);
511 //Begin-Libc
512 #else /* LIBC_ALIAS_LCHOWN */
513 int lchown(const char *, uid_t, gid_t) LIBC_ALIAS(lchown);
514 #endif /* !LIBC_ALIAS_LCHOWN */
515 //End-Libc
516 int link(const char *, const char *);
517 //Begin-Libc
518 #ifndef LIBC_ALIAS_LOCKF
519 //End-Libc
520 int lockf(int, int, off_t) __DARWIN_ALIAS_C(lockf);
521 //Begin-Libc
522 #else /* LIBC_ALIAS_LOCKF */
523 int lockf(int, int, off_t) LIBC_ALIAS_C(lockf);
524 #endif /* !LIBC_ALIAS_LOCKF */
525 //End-Libc
526 off_t lseek(int, off_t, int);
527 //Begin-Libc
528 #ifndef LIBC_ALIAS_NICE
529 //End-Libc
530 int nice(int) __DARWIN_ALIAS(nice);
531 //Begin-Libc
532 #else /* LIBC_ALIAS_NICE */
533 int nice(int) LIBC_ALIAS(nice);
534 #endif /* !LIBC_ALIAS_NICE */
535 //End-Libc
536 long pathconf(const char *, int);
537 //Begin-Libc
538 #ifndef LIBC_ALIAS_PAUSE
539 //End-Libc
540 int pause(void) __DARWIN_ALIAS_C(pause);
541 //Begin-Libc
542 #else /* LIBC_ALIAS_PAUSE */
543 int pause(void) LIBC_ALIAS_C(pause);
544 #endif /* !LIBC_ALIAS_PAUSE */
545 //End-Libc
546 int pipe(int [2]);
547 //Begin-Libc
548 #ifndef LIBC_ALIAS_PREAD
549 //End-Libc
550 ssize_t pread(int, void *, size_t, off_t) __DARWIN_ALIAS_C(pread);
551 //Begin-Libc
552 #else /* LIBC_ALIAS_PREAD */
553 ssize_t pread(int, void *, size_t, off_t) LIBC_ALIAS_C(pread);
554 #endif /* !LIBC_ALIAS_PREAD */
555 //End-Libc
556 //Begin-Libc
557 #ifndef LIBC_ALIAS_PWRITE
558 //End-Libc
559 ssize_t pwrite(int, const void *, size_t, off_t) __DARWIN_ALIAS_C(pwrite);
560 //Begin-Libc
561 #else /* LIBC_ALIAS_PWRITE */
562 ssize_t pwrite(int, const void *, size_t, off_t) LIBC_ALIAS_C(pwrite);
563 #endif /* !LIBC_ALIAS_PWRITE */
564 //End-Libc
565 //Begin-Libc
566 #ifndef LIBC_ALIAS_READ
567 //End-Libc
568 ssize_t read(int, void *, size_t) __DARWIN_ALIAS_C(read);
569 //Begin-Libc
570 #else /* LIBC_ALIAS_READ */
571 ssize_t read(int, void *, size_t) LIBC_ALIAS_C(read);
572 #endif /* !LIBC_ALIAS_READ */
573 //End-Libc
574 ssize_t readlink(const char * __restrict, char * __restrict, size_t);
575 int rmdir(const char *);
576 int setegid(gid_t);
577 int seteuid(uid_t);
578 int setgid(gid_t);
579 int setpgid(pid_t, pid_t);
580 #if __DARWIN_UNIX03
581 //Begin-Libc
582 #ifndef LIBC_ALIAS_SETPGRP
583 //End-Libc
584 pid_t setpgrp(void) __DARWIN_ALIAS(setpgrp);
585 //Begin-Libc
586 #else /* LIBC_ALIAS_SETPGRP */
587 pid_t setpgrp(void) LIBC_ALIAS(setpgrp);
588 #endif /* !LIBC_ALIAS_SETPGRP */
589 //End-Libc
590 #else /* !__DARWIN_UNIX03 */
591 int setpgrp(pid_t pid, pid_t pgrp); /* obsoleted by setpgid() */
592 #endif /* __DARWIN_UNIX03 */
593 //Begin-Libc
594 #ifndef LIBC_ALIAS_SETREGID
595 //End-Libc
596 int setregid(gid_t, gid_t) __DARWIN_ALIAS(setregid);
597 //Begin-Libc
598 #else /* LIBC_ALIAS_SETREGID */
599 int setregid(gid_t, gid_t) LIBC_ALIAS(setregid);
600 #endif /* !LIBC_ALIAS_SETREGID */
601 //End-Libc
602 //Begin-Libc
603 #ifndef LIBC_ALIAS_SETREUID
604 //End-Libc
605 int setreuid(uid_t, uid_t) __DARWIN_ALIAS(setreuid);
606 //Begin-Libc
607 #else /* LIBC_ALIAS_SETREUID */
608 int setreuid(uid_t, uid_t) LIBC_ALIAS(setreuid);
609 #endif /* !LIBC_ALIAS_SETREUID */
610 //End-Libc
611 pid_t setsid(void);
612 int setuid(uid_t);
613 //Begin-Libc
614 #ifndef LIBC_ALIAS_SLEEP
615 //End-Libc
616 unsigned int
617 sleep(unsigned int) __DARWIN_ALIAS_C(sleep);
618 //Begin-Libc
619 #else /* LIBC_ALIAS_SLEEP */
620 unsigned int
621 sleep(unsigned int) LIBC_ALIAS_C(sleep);
622 #endif /* !LIBC_ALIAS_SLEEP */
623 //End-Libc
624 void swab(const void * __restrict, void * __restrict, ssize_t);
625 int symlink(const char *, const char *);
626 void sync(void);
627 long sysconf(int);
628 pid_t tcgetpgrp(int);
629 int tcsetpgrp(int, pid_t);
630 int truncate(const char *, off_t);
631 char *ttyname(int);
632 #if __DARWIN_UNIX03
633 //Begin-Libc
634 #ifndef LIBC_ALIAS_TTYNAME_R
635 //End-Libc
636 int ttyname_r(int, char *, size_t) __DARWIN_ALIAS(ttyname_r);
637 //Begin-Libc
638 #else /* LIBC_ALIAS_TTYNAME_R */
639 int ttyname_r(int, char *, size_t) LIBC_ALIAS(ttyname_r);
640 #endif /* !LIBC_ALIAS_TTYNAME_R */
641 //End-Libc
642 #else /* !__DARWIN_UNIX03 */
643 char *ttyname_r(int, char *, size_t);
644 #endif /* __DARWIN_UNIX03 */
645 useconds_t
646 ualarm(useconds_t, useconds_t);
647 int unlink(const char *);
648 //Begin-Libc
649 #ifndef LIBC_ALIAS_USLEEP
650 //End-Libc
651 int usleep(useconds_t) __DARWIN_ALIAS_C(usleep);
652 //Begin-Libc
653 #else /* LIBC_ALIAS_USLEEP */
654 int usleep(useconds_t) LIBC_ALIAS_C(usleep);
655 #endif /* !LIBC_ALIAS_USLEEP */
656 //End-Libc
657 pid_t vfork(void);
658 //Begin-Libc
659 #ifndef LIBC_ALIAS_WRITE
660 //End-Libc
661 ssize_t write(int, const void *, size_t) __DARWIN_ALIAS_C(write);
662 //Begin-Libc
663 #else /* LIBC_ALIAS_WRITE */
664 ssize_t write(int, const void *, size_t) LIBC_ALIAS_C(write);
665 #endif /* !LIBC_ALIAS_WRITE */
666 //End-Libc
667
668 extern char *optarg; /* getopt(3) external variables */
669 extern int optind, opterr, optopt;
670
671 #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
672 #include <sys/select.h>
673
674 void _Exit(int) __dead2;
675 int accessx_np(const struct accessx_descriptor *, size_t, int *, uid_t);
676 int acct(const char *);
677 int add_profil(char *, size_t, unsigned long, unsigned int);
678 void *brk(const void *);
679 int chroot(const char *);
680 void endusershell(void);
681 int execvP(const char *, const char *, char * const *);
682 char *fflagstostr(unsigned long);
683 int getdtablesize(void);
684 int getdomainname(char *, int);
685 int getgrouplist(const char *, int, int *, int *);
686 int gethostuuid(uuid_t, const struct timespec *);
687 mode_t getmode(const void *, mode_t);
688 int getpagesize(void) __pure2;
689 char *getpass(const char *);
690 int getpeereid(int, uid_t *, gid_t *);
691 int getpgid(pid_t _pid);
692 int getsgroups_np(int *, uuid_t);
693 int getsid(pid_t _pid);
694 char *getusershell(void);
695 int getwgroups_np(int *, uuid_t);
696 int initgroups(const char *, int);
697 int iruserok(unsigned long, int, const char *, const char *);
698 int iruserok_sa(const void *, int, int, const char *, const char *);
699 int issetugid(void);
700 char *mkdtemp(char *);
701 int mknod(const char *, mode_t, dev_t);
702 int mkstemp(char *);
703 int mkstemps(char *, int);
704 char *mktemp(char *);
705 int nfssvc(int, void *);
706 int profil(char *, size_t, unsigned long, unsigned int);
707 int pthread_setugid_np(uid_t, gid_t);
708 int pthread_getugid_np( uid_t *, gid_t *);
709 int rcmd(char **, int, const char *, const char *, const char *, int *);
710 int rcmd_af(char **, int, const char *, const char *, const char *, int *,
711 int);
712 int reboot(int);
713 int revoke(const char *);
714 int rresvport(int *);
715 int rresvport_af(int *, int);
716 int ruserok(const char *, int, const char *, const char *);
717 void *sbrk(int);
718 int setdomainname(const char *, int);
719 int setgroups(int, const gid_t *);
720 void sethostid(long);
721 int sethostname(const char *, int);
722 #if __DARWIN_UNIX03
723 //Begin-Libc
724 #ifndef LIBC_ALIAS_SETKEY
725 //End-Libc
726 void setkey(const char *) __DARWIN_ALIAS(setkey);
727 //Begin-Libc
728 #else /* LIBC_ALIAS_SETKEY */
729 void setkey(const char *) LIBC_ALIAS(setkey);
730 #endif /* !LIBC_ALIAS_SETKEY */
731 //End-Libc
732 #else /* !__DARWIN_UNIX03 */
733 int setkey(const char *);
734 #endif /* __DARWIN_UNIX03 */
735 int setlogin(const char *);
736 //Begin-Libc
737 #ifndef LIBC_ALIAS_SETMODE
738 //End-Libc
739 void *setmode(const char *) __DARWIN_ALIAS(setmode);
740 //Begin-Libc
741 #else /* LIBC_ALIAS_SETMODE */
742 void *setmode(const char *) LIBC_ALIAS(setmode);
743 #endif /* !LIBC_ALIAS_SETMODE */
744 //End-Libc
745 int setrgid(gid_t);
746 int setruid(uid_t);
747 int setsgroups_np(int, const uuid_t);
748 void setusershell(void);
749 int setwgroups_np(int, const uuid_t);
750 int strtofflags(char **, unsigned long *, unsigned long *);
751 int swapon(const char *);
752 int syscall(int, ...);
753 int ttyslot(void);
754 int undelete(const char *);
755 int unwhiteout(const char *);
756 void *valloc(size_t);
757
758 extern char *suboptarg; /* getsubopt(3) external variable */
759 int getsubopt(char **, char * const *, char **);
760
761 /* HFS & HFS Plus semantics system calls go here */
762 #ifdef __LP64__
763 int fgetattrlist(int,void*,void*,size_t,unsigned int);
764 int fsetattrlist(int,void*,void*,size_t,unsigned int);
765 //Begin-Libc
766 #ifndef LIBC_ALIAS_GETATTRLIST
767 //End-Libc
768 int getattrlist(const char*,void*,void*,size_t,unsigned int) __DARWIN_ALIAS(getattrlist);
769 //Begin-Libc
770 #else /* LIBC_ALIAS_GETATTRLIST */
771 int getattrlist(const char*,void*,void*,size_t,unsigned int) LIBC_ALIAS(getattrlist);
772 #endif /* !LIBC_ALIAS_GETATTRLIST */
773 //End-Libc
774 //Begin-Libc
775 #ifndef LIBC_ALIAS_SETATTRLIST
776 //End-Libc
777 int setattrlist(const char*,void*,void*,size_t,unsigned int) __DARWIN_ALIAS(setattrlist);
778 //Begin-Libc
779 #else /* LIBC_ALIAS_SETATTRLIST */
780 int setattrlist(const char*,void*,void*,size_t,unsigned int) LIBC_ALIAS(setattrlist);
781 #endif /* !LIBC_ALIAS_SETATTRLIST */
782 //End-Libc
783 int exchangedata(const char*,const char*,unsigned int);
784 int getdirentriesattr(int,void*,void*,size_t,unsigned int*,unsigned int*,unsigned int*,unsigned int);
785
786 #else /* __LP64__ */
787 int fgetattrlist(int,void*,void*,size_t,unsigned long);
788 int fsetattrlist(int,void*,void*,size_t,unsigned long);
789 //Begin-Libc
790 #ifndef LIBC_ALIAS_GETATTRLIST
791 //End-Libc
792 int getattrlist(const char*,void*,void*,size_t,unsigned long) __DARWIN_ALIAS(getattrlist);
793 //Begin-Libc
794 #else /* LIBC_ALIAS_GETATTRLIST */
795 int getattrlist(const char*,void*,void*,size_t,unsigned long) LIBC_ALIAS(getattrlist);
796 #endif /* !LIBC_ALIAS_GETATTRLIST */
797 //End-Libc
798 //Begin-Libc
799 #ifndef LIBC_ALIAS_SETATTRLIST
800 //End-Libc
801 int setattrlist(const char*,void*,void*,size_t,unsigned long) __DARWIN_ALIAS(setattrlist);
802 //Begin-Libc
803 #else /* LIBC_ALIAS_SETATTRLIST */
804 int setattrlist(const char*,void*,void*,size_t,unsigned long) LIBC_ALIAS(setattrlist);
805 #endif /* !LIBC_ALIAS_SETATTRLIST */
806 //End-Libc
807 int exchangedata(const char*,const char*,unsigned long);
808 int getdirentriesattr(int,void*,void*,size_t,unsigned long*,unsigned long*,unsigned long*,unsigned long);
809
810 #endif /* __LP64__ */
811
812 struct fssearchblock;
813 struct searchstate;
814
815 int searchfs(const char *, struct fssearchblock *, unsigned long *, unsigned int, unsigned int, struct searchstate *);
816 int fsctl(const char *,unsigned long,void*,unsigned int);
817 int ffsctl(int,unsigned long,void*,unsigned int);
818
819 extern int optreset;
820
821 #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
822 __END_DECLS
823
824 #endif /* !_UNISTD_H_ */