]> git.saurik.com Git - apple/libc.git/blame_incremental - include/unistd.h
Libc-763.11.tar.gz
[apple/libc.git] / include / unistd.h
... / ...
CommitLineData
1/*
2 * Copyright (c) 2000, 2002-2006, 2008-2010 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#include <Availability.h>
74
75#ifndef _GID_T
76#define _GID_T
77typedef __darwin_gid_t gid_t;
78#endif
79
80#ifndef _INTPTR_T
81#define _INTPTR_T
82typedef __darwin_intptr_t intptr_t;
83#endif
84
85#ifndef _OFF_T
86#define _OFF_T
87typedef __darwin_off_t off_t;
88#endif
89
90#ifndef _PID_T
91#define _PID_T
92typedef __darwin_pid_t pid_t;
93#endif
94
95#ifndef _SIZE_T
96#define _SIZE_T
97/* DO NOT REMOVE THIS COMMENT: fixincludes needs to see:
98 * _GCC_SIZE_T */
99typedef __darwin_size_t size_t;
100#endif
101
102#ifndef _SSIZE_T
103#define _SSIZE_T
104typedef __darwin_ssize_t ssize_t;
105#endif
106
107#ifndef _UID_T
108#define _UID_T
109typedef __darwin_uid_t uid_t; /* user id */
110#endif
111
112#ifndef _USECONDS_T
113#define _USECONDS_T
114typedef __darwin_useconds_t useconds_t;
115#endif
116
117#ifndef NULL
118#define NULL __DARWIN_NULL
119#endif /* ! NULL */
120
121#define STDIN_FILENO 0 /* standard input file descriptor */
122#define STDOUT_FILENO 1 /* standard output file descriptor */
123#define STDERR_FILENO 2 /* standard error file descriptor */
124
125
126/* Version test macros */
127/* _POSIX_VERSION and _POSIX2_VERSION from sys/unistd.h */
128#define _XOPEN_VERSION 600 /* [XSI] */
129#define _XOPEN_XCU_VERSION 4 /* Older standard */
130
131
132/* Please keep this list in the same order as the applicable standard */
133#define _POSIX_ADVISORY_INFO (-1) /* [ADV] */
134#define _POSIX_ASYNCHRONOUS_IO (-1) /* [AIO] */
135#define _POSIX_BARRIERS (-1) /* [BAR] */
136#define _POSIX_CHOWN_RESTRICTED 200112L
137#define _POSIX_CLOCK_SELECTION (-1) /* [CS] */
138#define _POSIX_CPUTIME (-1) /* [CPT] */
139#define _POSIX_FSYNC 200112L /* [FSC] */
140#define _POSIX_IPV6 200112L
141#define _POSIX_JOB_CONTROL 200112L
142#define _POSIX_MAPPED_FILES 200112L /* [MF] */
143#define _POSIX_MEMLOCK (-1) /* [ML] */
144#define _POSIX_MEMLOCK_RANGE (-1) /* [MR] */
145#define _POSIX_MEMORY_PROTECTION 200112L /* [MPR] */
146#define _POSIX_MESSAGE_PASSING (-1) /* [MSG] */
147#define _POSIX_MONOTONIC_CLOCK (-1) /* [MON] */
148#define _POSIX_NO_TRUNC 200112L
149#define _POSIX_PRIORITIZED_IO (-1) /* [PIO] */
150#define _POSIX_PRIORITY_SCHEDULING (-1) /* [PS] */
151#define _POSIX_RAW_SOCKETS (-1) /* [RS] */
152#define _POSIX_READER_WRITER_LOCKS 200112L /* [THR] */
153#define _POSIX_REALTIME_SIGNALS (-1) /* [RTS] */
154#define _POSIX_REGEXP 200112L
155#define _POSIX_SAVED_IDS 200112L /* XXX required */
156#define _POSIX_SEMAPHORES (-1) /* [SEM] */
157#define _POSIX_SHARED_MEMORY_OBJECTS (-1) /* [SHM] */
158#define _POSIX_SHELL 200112L
159#define _POSIX_SPAWN (-1) /* [SPN] */
160#define _POSIX_SPIN_LOCKS (-1) /* [SPI] */
161#define _POSIX_SPORADIC_SERVER (-1) /* [SS] */
162#define _POSIX_SYNCHRONIZED_IO (-1) /* [SIO] */
163#define _POSIX_THREAD_ATTR_STACKADDR 200112L /* [TSA] */
164#define _POSIX_THREAD_ATTR_STACKSIZE 200112L /* [TSS] */
165#define _POSIX_THREAD_CPUTIME (-1) /* [TCT] */
166#define _POSIX_THREAD_PRIO_INHERIT (-1) /* [TPI] */
167#define _POSIX_THREAD_PRIO_PROTECT (-1) /* [TPP] */
168#define _POSIX_THREAD_PRIORITY_SCHEDULING (-1) /* [TPS] */
169#define _POSIX_THREAD_PROCESS_SHARED 200112L /* [TSH] */
170#define _POSIX_THREAD_SAFE_FUNCTIONS 200112L /* [TSF] */
171#define _POSIX_THREAD_SPORADIC_SERVER (-1) /* [TSP] */
172#define _POSIX_THREADS 200112L /* [THR] */
173#define _POSIX_TIMEOUTS (-1) /* [TMO] */
174#define _POSIX_TIMERS (-1) /* [TMR] */
175#define _POSIX_TRACE (-1) /* [TRC] */
176#define _POSIX_TRACE_EVENT_FILTER (-1) /* [TEF] */
177#define _POSIX_TRACE_INHERIT (-1) /* [TRI] */
178#define _POSIX_TRACE_LOG (-1) /* [TRL] */
179#define _POSIX_TYPED_MEMORY_OBJECTS (-1) /* [TYM] */
180#ifndef _POSIX_VDISABLE
181#define _POSIX_VDISABLE 0xff /* same as sys/termios.h */
182#endif /* _POSIX_VDISABLE */
183
184#if __DARWIN_C_LEVEL >= 199209L
185#define _POSIX2_C_BIND 200112L
186#define _POSIX2_C_DEV 200112L /* c99 command */
187#define _POSIX2_CHAR_TERM 200112L
188#define _POSIX2_FORT_DEV (-1) /* fort77 command */
189#define _POSIX2_FORT_RUN 200112L
190#define _POSIX2_LOCALEDEF 200112L /* localedef command */
191#define _POSIX2_PBS (-1)
192#define _POSIX2_PBS_ACCOUNTING (-1)
193#define _POSIX2_PBS_CHECKPOINT (-1)
194#define _POSIX2_PBS_LOCATE (-1)
195#define _POSIX2_PBS_MESSAGE (-1)
196#define _POSIX2_PBS_TRACK (-1)
197#define _POSIX2_SW_DEV 200112L
198#define _POSIX2_UPE 200112L /* XXXX no fc, newgrp, tabs */
199#endif /* __DARWIN_C_LEVEL */
200
201#define __ILP32_OFF32 (-1)
202#define __ILP32_OFFBIG (-1)
203#define __LP64_OFF64 (-1)
204#define __LPBIG_OFFBIG (-1)
205
206#ifdef __LP64__
207#undef __LP64_OFF64
208#define __LP64_OFF64 (1)
209#undef __LPBIG_OFFBIG
210#define __LPBIG_OFFBIG (1)
211#else
212#undef __ILP32_OFFBIG
213#define __ILP32_OFFBIG (1)
214#endif
215
216#if __DARWIN_C_LEVEL >= 200112L
217#define _POSIX_V6_ILP32_OFF32 __ILP32_OFF32
218#define _POSIX_V6_ILP32_OFFBIG __ILP32_OFFBIG
219#define _POSIX_V6_LP64_OFF64 __LP64_OFF64
220#define _POSIX_V6_LPBIG_OFFBIG __LPBIG_OFFBIG
221#endif /* __DARWIN_C_LEVEL >= 200112L */
222
223#if __DARWIN_C_LEVEL >= 200809L
224#define _POSIX_V7_ILP32_OFF32 __ILP32_OFF32
225#define _POSIX_V7_ILP32_OFFBIG __ILP32_OFFBIG
226#define _POSIX_V7_LP64_OFF64 __LP64_OFF64
227#define _POSIX_V7_LPBIG_OFFBIG __LPBIG_OFFBIG
228#endif /* __DARWIN_C_LEVEL >= 200809L */
229
230#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
231#define _V6_ILP32_OFF32 __ILP32_OFF32
232#define _V6_ILP32_OFFBIG __ILP32_OFFBIG
233#define _V6_LP64_OFF64 __LP64_OFF64
234#define _V6_LPBIG_OFFBIG __LPBIG_OFFBIG
235#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */
236
237#if (__DARWIN_C_LEVEL >= 199506L && __DARWIN_C_LEVEL < 200809L) || __DARWIN_C_LEVEL >= __DARWIN_C_FULL
238/* Removed in Issue 7 */
239#define _XBS5_ILP32_OFF32 __ILP32_OFF32
240#define _XBS5_ILP32_OFFBIG __ILP32_OFFBIG
241#define _XBS5_LP64_OFF64 __LP64_OFF64
242#define _XBS5_LPBIG_OFFBIG __LPBIG_OFFBIG
243#endif /* __DARWIN_C_LEVEL < 200809L */
244
245#if __DARWIN_C_LEVEL >= 199506L /* This really should be XSI */
246#define _XOPEN_CRYPT (1)
247#define _XOPEN_ENH_I18N (1) /* XXX required */
248#define _XOPEN_LEGACY (-1) /* no ftime gcvt, wcswcs */
249#define _XOPEN_REALTIME (-1) /* no q'ed signals, mq_* */
250#define _XOPEN_REALTIME_THREADS (-1) /* no posix_spawn, et. al. */
251#define _XOPEN_SHM (1)
252#define _XOPEN_STREAMS (-1) /* Issue 6 */
253#define _XOPEN_UNIX (1)
254#endif /* XSI */
255
256/* configurable system variables */
257#define _SC_ARG_MAX 1
258#define _SC_CHILD_MAX 2
259#define _SC_CLK_TCK 3
260#define _SC_NGROUPS_MAX 4
261#define _SC_OPEN_MAX 5
262#define _SC_JOB_CONTROL 6
263#define _SC_SAVED_IDS 7
264#define _SC_VERSION 8
265#define _SC_BC_BASE_MAX 9
266#define _SC_BC_DIM_MAX 10
267#define _SC_BC_SCALE_MAX 11
268#define _SC_BC_STRING_MAX 12
269#define _SC_COLL_WEIGHTS_MAX 13
270#define _SC_EXPR_NEST_MAX 14
271#define _SC_LINE_MAX 15
272#define _SC_RE_DUP_MAX 16
273#define _SC_2_VERSION 17
274#define _SC_2_C_BIND 18
275#define _SC_2_C_DEV 19
276#define _SC_2_CHAR_TERM 20
277#define _SC_2_FORT_DEV 21
278#define _SC_2_FORT_RUN 22
279#define _SC_2_LOCALEDEF 23
280#define _SC_2_SW_DEV 24
281#define _SC_2_UPE 25
282#define _SC_STREAM_MAX 26
283#define _SC_TZNAME_MAX 27
284
285#if __DARWIN_C_LEVEL >= 199309L
286#define _SC_ASYNCHRONOUS_IO 28
287#define _SC_PAGESIZE 29
288#define _SC_MEMLOCK 30
289#define _SC_MEMLOCK_RANGE 31
290#define _SC_MEMORY_PROTECTION 32
291#define _SC_MESSAGE_PASSING 33
292#define _SC_PRIORITIZED_IO 34
293#define _SC_PRIORITY_SCHEDULING 35
294#define _SC_REALTIME_SIGNALS 36
295#define _SC_SEMAPHORES 37
296#define _SC_FSYNC 38
297#define _SC_SHARED_MEMORY_OBJECTS 39
298#define _SC_SYNCHRONIZED_IO 40
299#define _SC_TIMERS 41
300#define _SC_AIO_LISTIO_MAX 42
301#define _SC_AIO_MAX 43
302#define _SC_AIO_PRIO_DELTA_MAX 44
303#define _SC_DELAYTIMER_MAX 45
304#define _SC_MQ_OPEN_MAX 46
305#define _SC_MAPPED_FILES 47 /* swap _SC_PAGESIZE vs. BSD */
306#define _SC_RTSIG_MAX 48
307#define _SC_SEM_NSEMS_MAX 49
308#define _SC_SEM_VALUE_MAX 50
309#define _SC_SIGQUEUE_MAX 51
310#define _SC_TIMER_MAX 52
311#endif /* __DARWIN_C_LEVEL >= 199309L */
312
313#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
314#define _SC_NPROCESSORS_CONF 57
315#define _SC_NPROCESSORS_ONLN 58
316#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */
317
318#if __DARWIN_C_LEVEL >= 200112L
319#define _SC_2_PBS 59
320#define _SC_2_PBS_ACCOUNTING 60
321#define _SC_2_PBS_CHECKPOINT 61
322#define _SC_2_PBS_LOCATE 62
323#define _SC_2_PBS_MESSAGE 63
324#define _SC_2_PBS_TRACK 64
325#define _SC_ADVISORY_INFO 65
326#define _SC_BARRIERS 66
327#define _SC_CLOCK_SELECTION 67
328#define _SC_CPUTIME 68
329#define _SC_FILE_LOCKING 69
330#define _SC_GETGR_R_SIZE_MAX 70
331#define _SC_GETPW_R_SIZE_MAX 71
332#define _SC_HOST_NAME_MAX 72
333#define _SC_LOGIN_NAME_MAX 73
334#define _SC_MONOTONIC_CLOCK 74
335#define _SC_MQ_PRIO_MAX 75
336#define _SC_READER_WRITER_LOCKS 76
337#define _SC_REGEXP 77
338#define _SC_SHELL 78
339#define _SC_SPAWN 79
340#define _SC_SPIN_LOCKS 80
341#define _SC_SPORADIC_SERVER 81
342#define _SC_THREAD_ATTR_STACKADDR 82
343#define _SC_THREAD_ATTR_STACKSIZE 83
344#define _SC_THREAD_CPUTIME 84
345#define _SC_THREAD_DESTRUCTOR_ITERATIONS 85
346#define _SC_THREAD_KEYS_MAX 86
347#define _SC_THREAD_PRIO_INHERIT 87
348#define _SC_THREAD_PRIO_PROTECT 88
349#define _SC_THREAD_PRIORITY_SCHEDULING 89
350#define _SC_THREAD_PROCESS_SHARED 90
351#define _SC_THREAD_SAFE_FUNCTIONS 91
352#define _SC_THREAD_SPORADIC_SERVER 92
353#define _SC_THREAD_STACK_MIN 93
354#define _SC_THREAD_THREADS_MAX 94
355#define _SC_TIMEOUTS 95
356#define _SC_THREADS 96
357#define _SC_TRACE 97
358#define _SC_TRACE_EVENT_FILTER 98
359#define _SC_TRACE_INHERIT 99
360#define _SC_TRACE_LOG 100
361#define _SC_TTY_NAME_MAX 101
362#define _SC_TYPED_MEMORY_OBJECTS 102
363#define _SC_V6_ILP32_OFF32 103
364#define _SC_V6_ILP32_OFFBIG 104
365#define _SC_V6_LP64_OFF64 105
366#define _SC_V6_LPBIG_OFFBIG 106
367#define _SC_IPV6 118
368#define _SC_RAW_SOCKETS 119
369#define _SC_SYMLOOP_MAX 120
370#endif /* __DARWIN_C_LEVEL >= 200112L */
371
372#if __DARWIN_C_LEVEL >= 199506L /* Really XSI */
373#define _SC_ATEXIT_MAX 107
374#define _SC_IOV_MAX 56
375#define _SC_PAGE_SIZE _SC_PAGESIZE
376#define _SC_XOPEN_CRYPT 108
377#define _SC_XOPEN_ENH_I18N 109
378#define _SC_XOPEN_LEGACY 110 /* Issue 6 */
379#define _SC_XOPEN_REALTIME 111 /* Issue 6 */
380#define _SC_XOPEN_REALTIME_THREADS 112 /* Issue 6 */
381#define _SC_XOPEN_SHM 113
382#define _SC_XOPEN_STREAMS 114 /* Issue 6 */
383#define _SC_XOPEN_UNIX 115
384#define _SC_XOPEN_VERSION 116
385#define _SC_XOPEN_XCU_VERSION 121
386#endif /* XSI */
387
388#if (__DARWIN_C_LEVEL >= 199506L && __DARWIN_C_LEVEL < 200809L) || __DARWIN_C_LEVEL >= __DARWIN_C_FULL
389/* Removed in Issue 7 */
390#define _SC_XBS5_ILP32_OFF32 122
391#define _SC_XBS5_ILP32_OFFBIG 123
392#define _SC_XBS5_LP64_OFF64 124
393#define _SC_XBS5_LPBIG_OFFBIG 125
394#endif /* __DARWIN_C_LEVEL <= 200809L */
395
396#if __DARWIN_C_LEVEL >= 200112L
397#define _SC_SS_REPL_MAX 126
398#define _SC_TRACE_EVENT_NAME_MAX 127
399#define _SC_TRACE_NAME_MAX 128
400#define _SC_TRACE_SYS_MAX 129
401#define _SC_TRACE_USER_EVENT_MAX 130
402#endif
403
404#if __DARWIN_C_LEVEL < 200112L || __DARWIN_C_LEVEL >= __DARWIN_C_FULL
405/* Removed in Issue 6 */
406#define _SC_PASS_MAX 131
407#endif
408
409#if __DARWIN_C_LEVEL >= 199209L
410#ifndef _CS_PATH /* Defined in <sys/unistd.h> */
411#define _CS_PATH 1
412#endif
413#endif
414
415#if __DARWIN_C_LEVEL >= 200112
416#define _CS_POSIX_V6_ILP32_OFF32_CFLAGS 2
417#define _CS_POSIX_V6_ILP32_OFF32_LDFLAGS 3
418#define _CS_POSIX_V6_ILP32_OFF32_LIBS 4
419#define _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS 5
420#define _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS 6
421#define _CS_POSIX_V6_ILP32_OFFBIG_LIBS 7
422#define _CS_POSIX_V6_LP64_OFF64_CFLAGS 8
423#define _CS_POSIX_V6_LP64_OFF64_LDFLAGS 9
424#define _CS_POSIX_V6_LP64_OFF64_LIBS 10
425#define _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS 11
426#define _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS 12
427#define _CS_POSIX_V6_LPBIG_OFFBIG_LIBS 13
428#define _CS_POSIX_V6_WIDTH_RESTRICTED_ENVS 14
429#endif
430
431#if (__DARWIN_C_LEVEL >= 199506L && __DARWIN_C_LEVEL < 200809L) || __DARWIN_C_LEVEL >= __DARWIN_C_FULL
432/* Removed in Issue 7 */
433#define _CS_XBS5_ILP32_OFF32_CFLAGS 20
434#define _CS_XBS5_ILP32_OFF32_LDFLAGS 21
435#define _CS_XBS5_ILP32_OFF32_LIBS 22
436#define _CS_XBS5_ILP32_OFF32_LINTFLAGS 23
437#define _CS_XBS5_ILP32_OFFBIG_CFLAGS 24
438#define _CS_XBS5_ILP32_OFFBIG_LDFLAGS 25
439#define _CS_XBS5_ILP32_OFFBIG_LIBS 26
440#define _CS_XBS5_ILP32_OFFBIG_LINTFLAGS 27
441#define _CS_XBS5_LP64_OFF64_CFLAGS 28
442#define _CS_XBS5_LP64_OFF64_LDFLAGS 29
443#define _CS_XBS5_LP64_OFF64_LIBS 30
444#define _CS_XBS5_LP64_OFF64_LINTFLAGS 31
445#define _CS_XBS5_LPBIG_OFFBIG_CFLAGS 32
446#define _CS_XBS5_LPBIG_OFFBIG_LDFLAGS 33
447#define _CS_XBS5_LPBIG_OFFBIG_LIBS 34
448#define _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS 35
449#endif
450
451#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
452#define _CS_DARWIN_USER_DIR 65536
453#define _CS_DARWIN_USER_TEMP_DIR 65537
454#define _CS_DARWIN_USER_CACHE_DIR 65538
455#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */
456
457
458#ifdef _DARWIN_UNLIMITED_GETGROUPS
459#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_3_2
460#error "_DARWIN_UNLIMITED_GETGROUPS specified, but -miphoneos-version-min version does not support it."
461#elif defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_6
462#error "_DARWIN_UNLIMITED_GETGROUPS specified, but -mmacosx-version-min version does not support it."
463#endif
464#endif
465
466/* POSIX.1-1990 */
467
468__BEGIN_DECLS
469void _exit(int) __dead2;
470int access(const char *, int);
471unsigned int
472 alarm(unsigned int);
473int chdir(const char *);
474int chown(const char *, uid_t, gid_t);
475
476//Begin-Libc
477#ifndef LIBC_ALIAS_CLOSE
478//End-Libc
479int close(int) __DARWIN_ALIAS_C(close);
480//Begin-Libc
481#else /* LIBC_ALIAS_CLOSE */
482int close(int) LIBC_ALIAS_C(close);
483#endif /* !LIBC_ALIAS_CLOSE */
484//End-Libc
485
486int dup(int);
487int dup2(int, int);
488int execl(const char *, const char *, ...);
489int execle(const char *, const char *, ...);
490int execlp(const char *, const char *, ...);
491int execv(const char *, char * const *);
492int execve(const char *, char * const *, char * const *);
493int execvp(const char *, char * const *);
494pid_t fork(void);
495long fpathconf(int, int);
496char *getcwd(char *, size_t);
497gid_t getegid(void);
498uid_t geteuid(void);
499gid_t getgid(void);
500#if defined(_DARWIN_UNLIMITED_GETGROUPS) || defined(_DARWIN_C_SOURCE)
501int getgroups(int, gid_t []) __DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_3_2, __DARWIN_EXTSN(getgroups));
502#else /* !_DARWIN_UNLIMITED_GETGROUPS && !_DARWIN_C_SOURCE */
503int getgroups(int, gid_t []);
504#endif /* _DARWIN_UNLIMITED_GETGROUPS || _DARWIN_C_SOURCE */
505char *getlogin(void);
506pid_t getpgrp(void);
507pid_t getpid(void);
508pid_t getppid(void);
509uid_t getuid(void);
510int isatty(int);
511int link(const char *, const char *);
512off_t lseek(int, off_t, int);
513long pathconf(const char *, int);
514
515//Begin-Libc
516#ifndef LIBC_ALIAS_PAUSE
517//End-Libc
518int pause(void) __DARWIN_ALIAS_C(pause);
519//Begin-Libc
520#else /* LIBC_ALIAS_PAUSE */
521int pause(void) LIBC_ALIAS_C(pause);
522#endif /* !LIBC_ALIAS_PAUSE */
523//End-Libc
524
525int pipe(int [2]);
526
527//Begin-Libc
528#ifndef LIBC_ALIAS_READ
529//End-Libc
530ssize_t read(int, void *, size_t) __DARWIN_ALIAS_C(read);
531//Begin-Libc
532#else /* LIBC_ALIAS_READ */
533ssize_t read(int, void *, size_t) LIBC_ALIAS_C(read);
534#endif /* !LIBC_ALIAS_READ */
535//End-Libc
536
537int rmdir(const char *);
538int setgid(gid_t);
539int setpgid(pid_t, pid_t);
540pid_t setsid(void);
541int setuid(uid_t);
542
543//Begin-Libc
544#ifndef LIBC_ALIAS_SLEEP
545//End-Libc
546unsigned int
547 sleep(unsigned int) __DARWIN_ALIAS_C(sleep);
548//Begin-Libc
549#else /* LIBC_ALIAS_SLEEP */
550unsigned int
551 sleep(unsigned int) LIBC_ALIAS_C(sleep);
552#endif /* !LIBC_ALIAS_SLEEP */
553//End-Libc
554
555long sysconf(int);
556pid_t tcgetpgrp(int);
557int tcsetpgrp(int, pid_t);
558char *ttyname(int);
559
560#if __DARWIN_UNIX03
561//Begin-Libc
562#ifndef LIBC_ALIAS_TTYNAME_R
563//End-Libc
564int ttyname_r(int, char *, size_t) __DARWIN_ALIAS(ttyname_r);
565//Begin-Libc
566#else /* LIBC_ALIAS_TTYNAME_R */
567int ttyname_r(int, char *, size_t) LIBC_ALIAS(ttyname_r);
568#endif /* !LIBC_ALIAS_TTYNAME_R */
569//End-Libc
570#else /* !__DARWIN_UNIX03 */
571char *ttyname_r(int, char *, size_t);
572#endif /* __DARWIN_UNIX03 */
573
574int unlink(const char *);
575
576//Begin-Libc
577#ifndef LIBC_ALIAS_WRITE
578//End-Libc
579ssize_t write(int, const void *, size_t) __DARWIN_ALIAS_C(write);
580//Begin-Libc
581#else /* LIBC_ALIAS_WRITE */
582ssize_t write(int, const void *, size_t) LIBC_ALIAS_C(write);
583#endif /* !LIBC_ALIAS_WRITE */
584//End-Libc
585__END_DECLS
586
587
588
589/* Additional functionality provided by:
590 * POSIX.2-1992 C Language Binding Option
591 */
592
593#if __DARWIN_C_LEVEL >= 199209L
594__BEGIN_DECLS
595//Begin-Libc
596#ifndef LIBC_ALIAS_CONFSTR
597//End-Libc
598size_t confstr(int, char *, size_t) __DARWIN_ALIAS(confstr);
599//Begin-Libc
600#else /* LIBC_ALIAS_CONFSTR */
601size_t confstr(int, char *, size_t) LIBC_ALIAS(confstr);
602#endif /* !LIBC_ALIAS_CONFSTR */
603//End-Libc
604
605//Begin-Libc
606#ifndef LIBC_ALIAS_GETOPT
607//End-Libc
608int getopt(int, char * const [], const char *) __DARWIN_ALIAS(getopt);
609//Begin-Libc
610#else /* LIBC_ALIAS_GETOPT */
611int getopt(int, char * const [], const char *) LIBC_ALIAS(getopt);
612#endif /* !LIBC_ALIAS_GETOPT */
613//End-Libc
614
615extern char *optarg; /* getopt(3) external variables */
616extern int optind, opterr, optopt;
617__END_DECLS
618#endif /* __DARWIN_C_LEVEL >= 199209L */
619
620
621
622/* Additional functionality provided by:
623 * POSIX.1c-1995,
624 * POSIX.1i-1995,
625 * and the omnibus ISO/IEC 9945-1: 1996
626 */
627
628#if __DARWIN_C_LEVEL >= 199506L
629 /* These F_* are really XSI or Issue 6 */
630#define F_ULOCK 0 /* unlock locked section */
631#define F_LOCK 1 /* lock a section for exclusive use */
632#define F_TLOCK 2 /* test and lock a section for exclusive use */
633#define F_TEST 3 /* test a section for locks by other procs */
634
635 __BEGIN_DECLS
636
637/* Begin XSI */
638/* Removed in Issue 6 */
639#if !defined(_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 200112L
640void *brk(const void *);
641int chroot(const char *) __POSIX_C_DEPRECATED(199506L);
642#endif
643
644char *crypt(const char *, const char *);
645#ifndef __CTERMID_DEFINED
646/* Multiply defined in stdio.h and unistd.h by SUS */
647#define __CTERMID_DEFINED 1
648char *ctermid(char *);
649#endif
650#if __DARWIN_UNIX03
651//Begin-Libc
652#ifndef LIBC_ALIAS_ENCRYPT
653//End-Libc
654void encrypt(char *, int) __DARWIN_ALIAS(encrypt);
655//Begin-Libc
656#else /* LIBC_ALIAS_ENCRYPT */
657void encrypt(char *, int) LIBC_ALIAS(encrypt);
658#endif /* !LIBC_ALIAS_ENCRYPT */
659//End-Libc
660#else /* !__DARWIN_UNIX03 */
661int encrypt(char *, int);
662#endif /* __DARWIN_UNIX03 */
663int fchdir(int);
664long gethostid(void);
665pid_t getpgid(pid_t);
666pid_t getsid(pid_t);
667
668/* Removed in Issue 6 */
669#if !defined(_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 200112L
670int getdtablesize(void) __POSIX_C_DEPRECATED(199506L);
671int getpagesize(void) __pure2 __POSIX_C_DEPRECATED(199506L);
672char *getpass(const char *) __POSIX_C_DEPRECATED(199506L);
673#endif
674
675/* Removed in Issue 7 */
676#if !defined(_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 200809L
677char *getwd(char *) __POSIX_C_DEPRECATED(200112L); /* obsoleted by getcwd() */
678#endif
679
680//Begin-Libc
681#ifndef LIBC_ALIAS_LCHOWN
682//End-Libc
683int lchown(const char *, uid_t, gid_t) __DARWIN_ALIAS(lchown);
684//Begin-Libc
685#else /* LIBC_ALIAS_LCHOWN */
686int lchown(const char *, uid_t, gid_t) LIBC_ALIAS(lchown);
687#endif /* !LIBC_ALIAS_LCHOWN */
688//End-Libc
689
690//Begin-Libc
691#ifndef LIBC_ALIAS_LOCKF
692//End-Libc
693int lockf(int, int, off_t) __DARWIN_ALIAS_C(lockf);
694//Begin-Libc
695#else /* LIBC_ALIAS_LOCKF */
696int lockf(int, int, off_t) LIBC_ALIAS_C(lockf);
697#endif /* !LIBC_ALIAS_LOCKF */
698//End-Libc
699
700//Begin-Libc
701#ifndef LIBC_ALIAS_NICE
702//End-Libc
703int nice(int) __DARWIN_ALIAS(nice);
704//Begin-Libc
705#else /* LIBC_ALIAS_NICE */
706int nice(int) LIBC_ALIAS(nice);
707#endif /* !LIBC_ALIAS_NICE */
708//End-Libc
709
710//Begin-Libc
711#ifndef LIBC_ALIAS_PREAD
712//End-Libc
713ssize_t pread(int, void *, size_t, off_t) __DARWIN_ALIAS_C(pread);
714//Begin-Libc
715#else /* LIBC_ALIAS_PREAD */
716ssize_t pread(int, void *, size_t, off_t) LIBC_ALIAS_C(pread);
717#endif /* !LIBC_ALIAS_PREAD */
718//End-Libc
719
720//Begin-Libc
721#ifndef LIBC_ALIAS_PWRITE
722//End-Libc
723ssize_t pwrite(int, const void *, size_t, off_t) __DARWIN_ALIAS_C(pwrite);
724//Begin-Libc
725#else /* LIBC_ALIAS_PWRITE */
726ssize_t pwrite(int, const void *, size_t, off_t) LIBC_ALIAS_C(pwrite);
727#endif /* !LIBC_ALIAS_PWRITE */
728//End-Libc
729
730/* Removed in Issue 6 */
731#if !defined(_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 200112L
732/* Note that Issue 5 changed the argument as intprt_t,
733 * but we keep it as int for binary compatability. */
734void *sbrk(int);
735#endif
736
737#if __DARWIN_UNIX03
738//Begin-Libc
739#ifndef LIBC_ALIAS_SETPGRP
740//End-Libc
741pid_t setpgrp(void) __DARWIN_ALIAS(setpgrp);
742//Begin-Libc
743#else /* LIBC_ALIAS_SETPGRP */
744pid_t setpgrp(void) LIBC_ALIAS(setpgrp);
745#endif /* !LIBC_ALIAS_SETPGRP */
746//End-Libc
747#else /* !__DARWIN_UNIX03 */
748int setpgrp(pid_t pid, pid_t pgrp); /* obsoleted by setpgid() */
749#endif /* __DARWIN_UNIX03 */
750
751//Begin-Libc
752#ifndef LIBC_ALIAS_SETREGID
753//End-Libc
754int setregid(gid_t, gid_t) __DARWIN_ALIAS(setregid);
755//Begin-Libc
756#else /* LIBC_ALIAS_SETREGID */
757int setregid(gid_t, gid_t) LIBC_ALIAS(setregid);
758#endif /* !LIBC_ALIAS_SETREGID */
759//End-Libc
760
761//Begin-Libc
762#ifndef LIBC_ALIAS_SETREUID
763//End-Libc
764int setreuid(uid_t, uid_t) __DARWIN_ALIAS(setreuid);
765//Begin-Libc
766#else /* LIBC_ALIAS_SETREUID */
767int setreuid(uid_t, uid_t) LIBC_ALIAS(setreuid);
768#endif /* !LIBC_ALIAS_SETREUID */
769//End-Libc
770
771void swab(const void * __restrict, void * __restrict, ssize_t);
772void sync(void);
773int truncate(const char *, off_t);
774useconds_t ualarm(useconds_t, useconds_t);
775//Begin-Libc
776#ifndef LIBC_ALIAS_USLEEP
777//End-Libc
778int usleep(useconds_t) __DARWIN_ALIAS_C(usleep);
779//Begin-Libc
780#else /* LIBC_ALIAS_USLEEP */
781int usleep(useconds_t) LIBC_ALIAS_C(usleep);
782#endif /* !LIBC_ALIAS_USLEEP */
783//End-Libc
784pid_t vfork(void);
785/* End XSI */
786
787//Begin-Libc
788#ifndef LIBC_ALIAS_FSYNC
789//End-Libc
790int fsync(int) __DARWIN_ALIAS_C(fsync);
791//Begin-Libc
792#else /* LIBC_ALIAS_FSYNC */
793int fsync(int) LIBC_ALIAS_C(fsync);
794#endif /* !LIBC_ALIAS_FSYNC */
795//End-Libc
796
797int ftruncate(int, off_t);
798int getlogin_r(char *, size_t);
799__END_DECLS
800#endif /* __DARWIN_C_LEVEL >= 199506L */
801
802
803
804/* Additional functionality provided by:
805 * POSIX.1-2001
806 * ISO C99
807 */
808
809#if __DARWIN_C_LEVEL >= 200112L
810__BEGIN_DECLS
811int fchown(int, uid_t, gid_t);
812int gethostname(char *, size_t);
813ssize_t readlink(const char * __restrict, char * __restrict, size_t);
814int setegid(gid_t);
815int seteuid(uid_t);
816int symlink(const char *, const char *);
817__END_DECLS
818#endif /* __DARWIN_C_LEVEL >= 200112L */
819
820
821
822/* Darwin extensions */
823
824#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
825#include <sys/select.h>
826
827#ifndef _DEV_T
828#define _DEV_T
829typedef __darwin_dev_t dev_t;
830#endif
831
832#ifndef _MODE_T
833#define _MODE_T
834typedef __darwin_mode_t mode_t;
835#endif
836
837#ifndef _UUID_T
838#define _UUID_T
839typedef __darwin_uuid_t uuid_t;
840#endif /* _UUID_T */
841
842__BEGIN_DECLS
843void _Exit(int) __dead2;
844int accessx_np(const struct accessx_descriptor *, size_t, int *, uid_t);
845int acct(const char *);
846int add_profil(char *, size_t, unsigned long, unsigned int);
847void endusershell(void);
848int execvP(const char *, const char *, char * const *);
849char *fflagstostr(unsigned long);
850int getdomainname(char *, int);
851int getgrouplist(const char *, int, int *, int *);
852int gethostuuid(uuid_t, const struct timespec *) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
853mode_t getmode(const void *, mode_t);
854int getpeereid(int, uid_t *, gid_t *);
855int getsgroups_np(int *, uuid_t);
856char *getusershell(void);
857int getwgroups_np(int *, uuid_t);
858int initgroups(const char *, int);
859int iruserok(unsigned long, int, const char *, const char *);
860int iruserok_sa(const void *, int, int, const char *, const char *);
861int issetugid(void);
862char *mkdtemp(char *);
863int mknod(const char *, mode_t, dev_t);
864int mkstemp(char *);
865int mkstemps(char *, int);
866char *mktemp(char *);
867int nfssvc(int, void *);
868int profil(char *, size_t, unsigned long, unsigned int);
869int pthread_setugid_np(uid_t, gid_t);
870int pthread_getugid_np( uid_t *, gid_t *);
871int rcmd(char **, int, const char *, const char *, const char *, int *);
872int rcmd_af(char **, int, const char *, const char *, const char *, int *,
873 int);
874int reboot(int);
875int revoke(const char *);
876int rresvport(int *);
877int rresvport_af(int *, int);
878int ruserok(const char *, int, const char *, const char *);
879int setdomainname(const char *, int);
880int setgroups(int, const gid_t *);
881void sethostid(long);
882int sethostname(const char *, int);
883#if __DARWIN_UNIX03
884//Begin-Libc
885#ifndef LIBC_ALIAS_SETKEY
886//End-Libc
887void setkey(const char *) __DARWIN_ALIAS(setkey);
888//Begin-Libc
889#else /* LIBC_ALIAS_SETKEY */
890void setkey(const char *) LIBC_ALIAS(setkey);
891#endif /* !LIBC_ALIAS_SETKEY */
892//End-Libc
893#else /* !__DARWIN_UNIX03 */
894int setkey(const char *);
895#endif /* __DARWIN_UNIX03 */
896int setlogin(const char *);
897//Begin-Libc
898#ifndef LIBC_ALIAS_SETMODE
899//End-Libc
900void *setmode(const char *) __DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_2_0, __DARWIN_ALIAS(setmode));
901//Begin-Libc
902#else /* LIBC_ALIAS_SETMODE */
903void *setmode(const char *) LIBC_ALIAS(setmode);
904#endif /* !LIBC_ALIAS_SETMODE */
905//End-Libc
906int setrgid(gid_t);
907int setruid(uid_t);
908int setsgroups_np(int, const uuid_t);
909void setusershell(void);
910int setwgroups_np(int, const uuid_t);
911int strtofflags(char **, unsigned long *, unsigned long *);
912int swapon(const char *);
913int syscall(int, ...);
914int ttyslot(void);
915int undelete(const char *);
916int unwhiteout(const char *);
917void *valloc(size_t);
918
919extern char *suboptarg; /* getsubopt(3) external variable */
920int getsubopt(char **, char * const *, char **);
921
922/* HFS & HFS Plus semantics system calls go here */
923#ifdef __LP64__
924int fgetattrlist(int,void*,void*,size_t,unsigned int) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_0);
925int fsetattrlist(int,void*,void*,size_t,unsigned int) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_0);
926//Begin-Libc
927#ifndef LIBC_ALIAS_GETATTRLIST
928//End-Libc
929int getattrlist(const char*,void*,void*,size_t,unsigned int) __DARWIN_ALIAS(getattrlist);
930//Begin-Libc
931#else /* LIBC_ALIAS_GETATTRLIST */
932int getattrlist(const char*,void*,void*,size_t,unsigned int) LIBC_ALIAS(getattrlist);
933#endif /* !LIBC_ALIAS_GETATTRLIST */
934//End-Libc
935//Begin-Libc
936#ifndef LIBC_ALIAS_SETATTRLIST
937//End-Libc
938int setattrlist(const char*,void*,void*,size_t,unsigned int) __DARWIN_ALIAS(setattrlist);
939//Begin-Libc
940#else /* LIBC_ALIAS_SETATTRLIST */
941int setattrlist(const char*,void*,void*,size_t,unsigned int) LIBC_ALIAS(setattrlist);
942#endif /* !LIBC_ALIAS_SETATTRLIST */
943//End-Libc
944int exchangedata(const char*,const char*,unsigned int);
945int getdirentriesattr(int,void*,void*,size_t,unsigned int*,unsigned int*,unsigned int*,unsigned int);
946
947#else /* __LP64__ */
948int fgetattrlist(int,void*,void*,size_t,unsigned long) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_0);
949int fsetattrlist(int,void*,void*,size_t,unsigned long) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_0);
950//Begin-Libc
951#ifndef LIBC_ALIAS_GETATTRLIST
952//End-Libc
953int getattrlist(const char*,void*,void*,size_t,unsigned long) __DARWIN_ALIAS(getattrlist);
954//Begin-Libc
955#else /* LIBC_ALIAS_GETATTRLIST */
956int getattrlist(const char*,void*,void*,size_t,unsigned long) LIBC_ALIAS(getattrlist);
957#endif /* !LIBC_ALIAS_GETATTRLIST */
958//End-Libc
959//Begin-Libc
960#ifndef LIBC_ALIAS_SETATTRLIST
961//End-Libc
962int setattrlist(const char*,void*,void*,size_t,unsigned long) __DARWIN_ALIAS(setattrlist);
963//Begin-Libc
964#else /* LIBC_ALIAS_SETATTRLIST */
965int setattrlist(const char*,void*,void*,size_t,unsigned long) LIBC_ALIAS(setattrlist);
966#endif /* !LIBC_ALIAS_SETATTRLIST */
967//End-Libc
968int exchangedata(const char*,const char*,unsigned long);
969int getdirentriesattr(int,void*,void*,size_t,unsigned long*,unsigned long*,unsigned long*,unsigned long);
970
971#endif /* __LP64__ */
972
973struct fssearchblock;
974struct searchstate;
975
976int searchfs(const char *, struct fssearchblock *, unsigned long *, unsigned int, unsigned int, struct searchstate *);
977int fsctl(const char *,unsigned long,void*,unsigned int);
978int ffsctl(int,unsigned long,void*,unsigned int) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_0);
979
980extern int optreset;
981
982__END_DECLS
983#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */
984
985#endif /* _UNISTD_H_ */