]>
Commit | Line | Data |
---|---|---|
5b2abdfb | 1 | /* |
1f2f436a | 2 | * Copyright (c) 2000, 2002-2006, 2008-2010 Apple Inc. All rights reserved. |
5b2abdfb A |
3 | * |
4 | * @APPLE_LICENSE_HEADER_START@ | |
5 | * | |
734aad71 A |
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 | |
5b2abdfb A |
15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, |
16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | |
734aad71 A |
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. | |
5b2abdfb A |
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 | ||
3d9156a7 | 71 | #include <_types.h> |
3d9156a7 | 72 | #include <sys/unistd.h> |
1f2f436a | 73 | #include <Availability.h> |
224c7076 | 74 | |
3d9156a7 | 75 | #ifndef _GID_T |
224c7076 | 76 | #define _GID_T |
3d9156a7 A |
77 | typedef __darwin_gid_t gid_t; |
78 | #endif | |
5b2abdfb | 79 | |
3d9156a7 | 80 | #ifndef _INTPTR_T |
224c7076 | 81 | #define _INTPTR_T |
3d9156a7 A |
82 | typedef __darwin_intptr_t intptr_t; |
83 | #endif | |
5b2abdfb | 84 | |
3d9156a7 | 85 | #ifndef _OFF_T |
224c7076 | 86 | #define _OFF_T |
3d9156a7 A |
87 | typedef __darwin_off_t off_t; |
88 | #endif | |
59e0d9fe | 89 | |
3d9156a7 | 90 | #ifndef _PID_T |
224c7076 | 91 | #define _PID_T |
3d9156a7 | 92 | typedef __darwin_pid_t pid_t; |
59e0d9fe | 93 | #endif |
3d9156a7 A |
94 | |
95 | #ifndef _SIZE_T | |
224c7076 | 96 | #define _SIZE_T |
3d9156a7 A |
97 | /* DO NOT REMOVE THIS COMMENT: fixincludes needs to see: |
98 | * _GCC_SIZE_T */ | |
99 | typedef __darwin_size_t size_t; | |
59e0d9fe | 100 | #endif |
3d9156a7 A |
101 | |
102 | #ifndef _SSIZE_T | |
103 | #define _SSIZE_T | |
104 | typedef __darwin_ssize_t ssize_t; | |
5b2abdfb | 105 | #endif |
3d9156a7 A |
106 | |
107 | #ifndef _UID_T | |
224c7076 | 108 | #define _UID_T |
3d9156a7 | 109 | typedef __darwin_uid_t uid_t; /* user id */ |
59e0d9fe A |
110 | #endif |
111 | ||
3d9156a7 | 112 | #ifndef _USECONDS_T |
224c7076 | 113 | #define _USECONDS_T |
3d9156a7 A |
114 | typedef __darwin_useconds_t useconds_t; |
115 | #endif | |
59e0d9fe | 116 | |
1f2f436a A |
117 | #ifndef NULL |
118 | #define NULL __DARWIN_NULL | |
119 | #endif /* ! NULL */ | |
3d9156a7 A |
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 | ||
3d9156a7 A |
125 | |
126 | /* Version test macros */ | |
127 | /* _POSIX_VERSION and _POSIX2_VERSION from sys/unistd.h */ | |
59e0d9fe | 128 | #define _XOPEN_VERSION 600 /* [XSI] */ |
224c7076 | 129 | #define _XOPEN_XCU_VERSION 4 /* Older standard */ |
59e0d9fe A |
130 | |
131 | ||
132 | /* Please keep this list in the same order as the applicable standard */ | |
133 | #define _POSIX_ADVISORY_INFO (-1) /* [ADV] */ | |
3d9156a7 | 134 | #define _POSIX_ASYNCHRONOUS_IO (-1) /* [AIO] */ |
59e0d9fe A |
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] */ | |
224c7076 | 139 | #define _POSIX_FSYNC 200112L /* [FSC] */ |
59e0d9fe A |
140 | #define _POSIX_IPV6 200112L |
141 | #define _POSIX_JOB_CONTROL 200112L | |
142 | #define _POSIX_MAPPED_FILES 200112L /* [MF] */ | |
3d9156a7 A |
143 | #define _POSIX_MEMLOCK (-1) /* [ML] */ |
144 | #define _POSIX_MEMLOCK_RANGE (-1) /* [MR] */ | |
59e0d9fe A |
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] */ | |
3d9156a7 | 151 | #define _POSIX_RAW_SOCKETS (-1) /* [RS] */ |
59e0d9fe A |
152 | #define _POSIX_READER_WRITER_LOCKS 200112L /* [THR] */ |
153 | #define _POSIX_REALTIME_SIGNALS (-1) /* [RTS] */ | |
154 | #define _POSIX_REGEXP 200112L | |
3d9156a7 A |
155 | #define _POSIX_SAVED_IDS 200112L /* XXX required */ |
156 | #define _POSIX_SEMAPHORES (-1) /* [SEM] */ | |
157 | #define _POSIX_SHARED_MEMORY_OBJECTS (-1) /* [SHM] */ | |
59e0d9fe A |
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] */ | |
3d9156a7 | 162 | #define _POSIX_SYNCHRONIZED_IO (-1) /* [SIO] */ |
59e0d9fe A |
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] */ | |
224c7076 | 169 | #define _POSIX_THREAD_PROCESS_SHARED 200112L /* [TSH] */ |
59e0d9fe A |
170 | #define _POSIX_THREAD_SAFE_FUNCTIONS 200112L /* [TSF] */ |
171 | #define _POSIX_THREAD_SPORADIC_SERVER (-1) /* [TSP] */ | |
224c7076 | 172 | #define _POSIX_THREADS 200112L /* [THR] */ |
59e0d9fe A |
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 | ||
1f2f436a | 184 | #if __DARWIN_C_LEVEL >= 199209L |
59e0d9fe | 185 | #define _POSIX2_C_BIND 200112L |
3d9156a7 | 186 | #define _POSIX2_C_DEV 200112L /* c99 command */ |
59e0d9fe A |
187 | #define _POSIX2_CHAR_TERM 200112L |
188 | #define _POSIX2_FORT_DEV (-1) /* fort77 command */ | |
189 | #define _POSIX2_FORT_RUN 200112L | |
3d9156a7 | 190 | #define _POSIX2_LOCALEDEF 200112L /* localedef command */ |
59e0d9fe A |
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 */ | |
1f2f436a | 199 | #endif /* __DARWIN_C_LEVEL */ |
59e0d9fe | 200 | |
1f2f436a A |
201 | #define __ILP32_OFF32 (-1) |
202 | #define __ILP32_OFFBIG (-1) | |
203 | #define __LP64_OFF64 (-1) | |
204 | #define __LPBIG_OFFBIG (-1) | |
59e0d9fe | 205 | |
1f2f436a A |
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 | |
59e0d9fe | 215 | |
1f2f436a A |
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 */ | |
59e0d9fe A |
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) | |
1f2f436a | 252 | #define _XOPEN_STREAMS (-1) /* Issue 6 */ |
59e0d9fe | 253 | #define _XOPEN_UNIX (1) |
1f2f436a | 254 | #endif /* XSI */ |
5b2abdfb | 255 | |
9385eb3d | 256 | /* configurable system variables */ |
59e0d9fe A |
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 | |
1f2f436a A |
284 | |
285 | #if __DARWIN_C_LEVEL >= 199309L | |
224c7076 | 286 | #define _SC_ASYNCHRONOUS_IO 28 |
59e0d9fe A |
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 | |
1f2f436a A |
311 | #endif /* __DARWIN_C_LEVEL >= 199309L */ |
312 | ||
313 | #if __DARWIN_C_LEVEL >= __DARWIN_C_FULL | |
224c7076 A |
314 | #define _SC_NPROCESSORS_CONF 57 |
315 | #define _SC_NPROCESSORS_ONLN 58 | |
1f2f436a A |
316 | #endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */ |
317 | ||
318 | #if __DARWIN_C_LEVEL >= 200112L | |
59e0d9fe A |
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 | |
1f2f436a A |
370 | #endif /* __DARWIN_C_LEVEL >= 200112L */ |
371 | ||
372 | #if __DARWIN_C_LEVEL >= 199506L /* Really XSI */ | |
59e0d9fe A |
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 | |
1f2f436a A |
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 */ | |
59e0d9fe | 381 | #define _SC_XOPEN_SHM 113 |
1f2f436a | 382 | #define _SC_XOPEN_STREAMS 114 /* Issue 6 */ |
59e0d9fe A |
383 | #define _SC_XOPEN_UNIX 115 |
384 | #define _SC_XOPEN_VERSION 116 | |
385 | #define _SC_XOPEN_XCU_VERSION 121 | |
1f2f436a A |
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 */ | |
224c7076 A |
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 | |
1f2f436a A |
394 | #endif /* __DARWIN_C_LEVEL <= 200809L */ |
395 | ||
396 | #if __DARWIN_C_LEVEL >= 200112L | |
224c7076 A |
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 | |
1f2f436a A |
402 | #endif |
403 | ||
404 | #if __DARWIN_C_LEVEL < 200112L || __DARWIN_C_LEVEL >= __DARWIN_C_FULL | |
405 | /* Removed in Issue 6 */ | |
224c7076 | 406 | #define _SC_PASS_MAX 131 |
1f2f436a | 407 | #endif |
59e0d9fe | 408 | |
1f2f436a A |
409 | #if __DARWIN_C_LEVEL >= 199209L |
410 | #ifndef _CS_PATH /* Defined in <sys/unistd.h> */ | |
59e0d9fe A |
411 | #define _CS_PATH 1 |
412 | #endif | |
1f2f436a A |
413 | #endif |
414 | ||
415 | #if __DARWIN_C_LEVEL >= 200112 | |
224c7076 | 416 | #define _CS_POSIX_V6_ILP32_OFF32_CFLAGS 2 |
59e0d9fe A |
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 | |
1f2f436a | 429 | #endif |
59e0d9fe | 430 | |
1f2f436a A |
431 | #if (__DARWIN_C_LEVEL >= 199506L && __DARWIN_C_LEVEL < 200809L) || __DARWIN_C_LEVEL >= __DARWIN_C_FULL |
432 | /* Removed in Issue 7 */ | |
59e0d9fe A |
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 | |
1f2f436a | 449 | #endif |
59e0d9fe | 450 | |
1f2f436a | 451 | #if __DARWIN_C_LEVEL >= __DARWIN_C_FULL |
224c7076 A |
452 | #define _CS_DARWIN_USER_DIR 65536 |
453 | #define _CS_DARWIN_USER_TEMP_DIR 65537 | |
454 | #define _CS_DARWIN_USER_CACHE_DIR 65538 | |
1f2f436a | 455 | #endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */ |
224c7076 | 456 | |
9385eb3d | 457 | |
1f2f436a A |
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 | |
9385eb3d A |
469 | void _exit(int) __dead2; |
470 | int access(const char *, int); | |
3d9156a7 A |
471 | unsigned int |
472 | alarm(unsigned int); | |
9385eb3d A |
473 | int chdir(const char *); |
474 | int chown(const char *, uid_t, gid_t); | |
1f2f436a | 475 | |
224c7076 A |
476 | //Begin-Libc |
477 | #ifndef LIBC_ALIAS_CLOSE | |
478 | //End-Libc | |
479 | int close(int) __DARWIN_ALIAS_C(close); | |
480 | //Begin-Libc | |
481 | #else /* LIBC_ALIAS_CLOSE */ | |
482 | int close(int) LIBC_ALIAS_C(close); | |
483 | #endif /* !LIBC_ALIAS_CLOSE */ | |
484 | //End-Libc | |
1f2f436a | 485 | |
9385eb3d A |
486 | int dup(int); |
487 | int dup2(int, int); | |
488 | int execl(const char *, const char *, ...); | |
489 | int execle(const char *, const char *, ...); | |
490 | int execlp(const char *, const char *, ...); | |
491 | int execv(const char *, char * const *); | |
492 | int execve(const char *, char * const *, char * const *); | |
493 | int execvp(const char *, char * const *); | |
494 | pid_t fork(void); | |
495 | long fpathconf(int, int); | |
496 | char *getcwd(char *, size_t); | |
9385eb3d A |
497 | gid_t getegid(void); |
498 | uid_t geteuid(void); | |
499 | gid_t getgid(void); | |
34e8f829 | 500 | #if defined(_DARWIN_UNLIMITED_GETGROUPS) || defined(_DARWIN_C_SOURCE) |
1f2f436a | 501 | int getgroups(int, gid_t []) __DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_3_2, __DARWIN_EXTSN(getgroups)); |
34e8f829 | 502 | #else /* !_DARWIN_UNLIMITED_GETGROUPS && !_DARWIN_C_SOURCE */ |
9385eb3d | 503 | int getgroups(int, gid_t []); |
34e8f829 | 504 | #endif /* _DARWIN_UNLIMITED_GETGROUPS || _DARWIN_C_SOURCE */ |
9385eb3d | 505 | char *getlogin(void); |
1f2f436a A |
506 | pid_t getpgrp(void); |
507 | pid_t getpid(void); | |
508 | pid_t getppid(void); | |
509 | uid_t getuid(void); | |
510 | int isatty(int); | |
511 | int link(const char *, const char *); | |
512 | off_t lseek(int, off_t, int); | |
513 | long pathconf(const char *, int); | |
514 | ||
515 | //Begin-Libc | |
516 | #ifndef LIBC_ALIAS_PAUSE | |
517 | //End-Libc | |
518 | int pause(void) __DARWIN_ALIAS_C(pause); | |
519 | //Begin-Libc | |
520 | #else /* LIBC_ALIAS_PAUSE */ | |
521 | int pause(void) LIBC_ALIAS_C(pause); | |
522 | #endif /* !LIBC_ALIAS_PAUSE */ | |
523 | //End-Libc | |
524 | ||
525 | int pipe(int [2]); | |
526 | ||
527 | //Begin-Libc | |
528 | #ifndef LIBC_ALIAS_READ | |
529 | //End-Libc | |
530 | ssize_t read(int, void *, size_t) __DARWIN_ALIAS_C(read); | |
531 | //Begin-Libc | |
532 | #else /* LIBC_ALIAS_READ */ | |
533 | ssize_t read(int, void *, size_t) LIBC_ALIAS_C(read); | |
534 | #endif /* !LIBC_ALIAS_READ */ | |
535 | //End-Libc | |
536 | ||
537 | int rmdir(const char *); | |
538 | int setgid(gid_t); | |
539 | int setpgid(pid_t, pid_t); | |
540 | pid_t setsid(void); | |
541 | int setuid(uid_t); | |
542 | ||
543 | //Begin-Libc | |
544 | #ifndef LIBC_ALIAS_SLEEP | |
545 | //End-Libc | |
546 | unsigned int | |
547 | sleep(unsigned int) __DARWIN_ALIAS_C(sleep); | |
548 | //Begin-Libc | |
549 | #else /* LIBC_ALIAS_SLEEP */ | |
550 | unsigned int | |
551 | sleep(unsigned int) LIBC_ALIAS_C(sleep); | |
552 | #endif /* !LIBC_ALIAS_SLEEP */ | |
553 | //End-Libc | |
554 | ||
555 | long sysconf(int); | |
556 | pid_t tcgetpgrp(int); | |
557 | int tcsetpgrp(int, pid_t); | |
558 | char *ttyname(int); | |
559 | ||
560 | #if __DARWIN_UNIX03 | |
561 | //Begin-Libc | |
562 | #ifndef LIBC_ALIAS_TTYNAME_R | |
563 | //End-Libc | |
564 | int ttyname_r(int, char *, size_t) __DARWIN_ALIAS(ttyname_r); | |
565 | //Begin-Libc | |
566 | #else /* LIBC_ALIAS_TTYNAME_R */ | |
567 | int ttyname_r(int, char *, size_t) LIBC_ALIAS(ttyname_r); | |
568 | #endif /* !LIBC_ALIAS_TTYNAME_R */ | |
569 | //End-Libc | |
570 | #else /* !__DARWIN_UNIX03 */ | |
571 | char *ttyname_r(int, char *, size_t); | |
572 | #endif /* __DARWIN_UNIX03 */ | |
573 | ||
574 | int unlink(const char *); | |
575 | ||
576 | //Begin-Libc | |
577 | #ifndef LIBC_ALIAS_WRITE | |
578 | //End-Libc | |
579 | ssize_t write(int, const void *, size_t) __DARWIN_ALIAS_C(write); | |
580 | //Begin-Libc | |
581 | #else /* LIBC_ALIAS_WRITE */ | |
582 | ssize_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 | |
598 | size_t confstr(int, char *, size_t) __DARWIN_ALIAS(confstr); | |
599 | //Begin-Libc | |
600 | #else /* LIBC_ALIAS_CONFSTR */ | |
601 | size_t confstr(int, char *, size_t) LIBC_ALIAS(confstr); | |
602 | #endif /* !LIBC_ALIAS_CONFSTR */ | |
603 | //End-Libc | |
604 | ||
224c7076 A |
605 | //Begin-Libc |
606 | #ifndef LIBC_ALIAS_GETOPT | |
607 | //End-Libc | |
608 | int getopt(int, char * const [], const char *) __DARWIN_ALIAS(getopt); | |
609 | //Begin-Libc | |
610 | #else /* LIBC_ALIAS_GETOPT */ | |
611 | int getopt(int, char * const [], const char *) LIBC_ALIAS(getopt); | |
612 | #endif /* !LIBC_ALIAS_GETOPT */ | |
613 | //End-Libc | |
1f2f436a A |
614 | |
615 | extern char *optarg; /* getopt(3) external variables */ | |
616 | extern 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 | |
640 | void *brk(const void *); | |
641 | int chroot(const char *) __POSIX_C_DEPRECATED(199506L); | |
642 | #endif | |
643 | ||
644 | char *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 | |
648 | char *ctermid(char *); | |
649 | #endif | |
650 | #if __DARWIN_UNIX03 | |
651 | //Begin-Libc | |
652 | #ifndef LIBC_ALIAS_ENCRYPT | |
653 | //End-Libc | |
654 | void encrypt(char *, int) __DARWIN_ALIAS(encrypt); | |
655 | //Begin-Libc | |
656 | #else /* LIBC_ALIAS_ENCRYPT */ | |
657 | void encrypt(char *, int) LIBC_ALIAS(encrypt); | |
658 | #endif /* !LIBC_ALIAS_ENCRYPT */ | |
659 | //End-Libc | |
660 | #else /* !__DARWIN_UNIX03 */ | |
661 | int encrypt(char *, int); | |
662 | #endif /* __DARWIN_UNIX03 */ | |
663 | int fchdir(int); | |
664 | long gethostid(void); | |
3d9156a7 | 665 | pid_t getpgid(pid_t); |
3d9156a7 | 666 | pid_t getsid(pid_t); |
1f2f436a A |
667 | |
668 | /* Removed in Issue 6 */ | |
669 | #if !defined(_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 200112L | |
670 | int getdtablesize(void) __POSIX_C_DEPRECATED(199506L); | |
671 | int getpagesize(void) __pure2 __POSIX_C_DEPRECATED(199506L); | |
672 | char *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 | |
677 | char *getwd(char *) __POSIX_C_DEPRECATED(200112L); /* obsoleted by getcwd() */ | |
678 | #endif | |
679 | ||
224c7076 A |
680 | //Begin-Libc |
681 | #ifndef LIBC_ALIAS_LCHOWN | |
682 | //End-Libc | |
3d9156a7 | 683 | int lchown(const char *, uid_t, gid_t) __DARWIN_ALIAS(lchown); |
224c7076 A |
684 | //Begin-Libc |
685 | #else /* LIBC_ALIAS_LCHOWN */ | |
686 | int lchown(const char *, uid_t, gid_t) LIBC_ALIAS(lchown); | |
687 | #endif /* !LIBC_ALIAS_LCHOWN */ | |
688 | //End-Libc | |
1f2f436a | 689 | |
224c7076 A |
690 | //Begin-Libc |
691 | #ifndef LIBC_ALIAS_LOCKF | |
692 | //End-Libc | |
693 | int lockf(int, int, off_t) __DARWIN_ALIAS_C(lockf); | |
694 | //Begin-Libc | |
695 | #else /* LIBC_ALIAS_LOCKF */ | |
696 | int lockf(int, int, off_t) LIBC_ALIAS_C(lockf); | |
697 | #endif /* !LIBC_ALIAS_LOCKF */ | |
698 | //End-Libc | |
1f2f436a | 699 | |
224c7076 A |
700 | //Begin-Libc |
701 | #ifndef LIBC_ALIAS_NICE | |
702 | //End-Libc | |
703 | int nice(int) __DARWIN_ALIAS(nice); | |
704 | //Begin-Libc | |
705 | #else /* LIBC_ALIAS_NICE */ | |
706 | int nice(int) LIBC_ALIAS(nice); | |
707 | #endif /* !LIBC_ALIAS_NICE */ | |
708 | //End-Libc | |
1f2f436a | 709 | |
224c7076 A |
710 | //Begin-Libc |
711 | #ifndef LIBC_ALIAS_PREAD | |
712 | //End-Libc | |
713 | ssize_t pread(int, void *, size_t, off_t) __DARWIN_ALIAS_C(pread); | |
714 | //Begin-Libc | |
715 | #else /* LIBC_ALIAS_PREAD */ | |
716 | ssize_t pread(int, void *, size_t, off_t) LIBC_ALIAS_C(pread); | |
717 | #endif /* !LIBC_ALIAS_PREAD */ | |
718 | //End-Libc | |
1f2f436a | 719 | |
224c7076 A |
720 | //Begin-Libc |
721 | #ifndef LIBC_ALIAS_PWRITE | |
722 | //End-Libc | |
723 | ssize_t pwrite(int, const void *, size_t, off_t) __DARWIN_ALIAS_C(pwrite); | |
724 | //Begin-Libc | |
725 | #else /* LIBC_ALIAS_PWRITE */ | |
726 | ssize_t pwrite(int, const void *, size_t, off_t) LIBC_ALIAS_C(pwrite); | |
727 | #endif /* !LIBC_ALIAS_PWRITE */ | |
728 | //End-Libc | |
1f2f436a A |
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. */ | |
734 | void *sbrk(int); | |
735 | #endif | |
736 | ||
3d9156a7 | 737 | #if __DARWIN_UNIX03 |
224c7076 A |
738 | //Begin-Libc |
739 | #ifndef LIBC_ALIAS_SETPGRP | |
740 | //End-Libc | |
3d9156a7 | 741 | pid_t setpgrp(void) __DARWIN_ALIAS(setpgrp); |
224c7076 A |
742 | //Begin-Libc |
743 | #else /* LIBC_ALIAS_SETPGRP */ | |
744 | pid_t setpgrp(void) LIBC_ALIAS(setpgrp); | |
745 | #endif /* !LIBC_ALIAS_SETPGRP */ | |
746 | //End-Libc | |
3d9156a7 A |
747 | #else /* !__DARWIN_UNIX03 */ |
748 | int setpgrp(pid_t pid, pid_t pgrp); /* obsoleted by setpgid() */ | |
749 | #endif /* __DARWIN_UNIX03 */ | |
1f2f436a | 750 | |
224c7076 A |
751 | //Begin-Libc |
752 | #ifndef LIBC_ALIAS_SETREGID | |
753 | //End-Libc | |
754 | int setregid(gid_t, gid_t) __DARWIN_ALIAS(setregid); | |
755 | //Begin-Libc | |
756 | #else /* LIBC_ALIAS_SETREGID */ | |
757 | int setregid(gid_t, gid_t) LIBC_ALIAS(setregid); | |
758 | #endif /* !LIBC_ALIAS_SETREGID */ | |
759 | //End-Libc | |
1f2f436a | 760 | |
224c7076 A |
761 | //Begin-Libc |
762 | #ifndef LIBC_ALIAS_SETREUID | |
763 | //End-Libc | |
764 | int setreuid(uid_t, uid_t) __DARWIN_ALIAS(setreuid); | |
765 | //Begin-Libc | |
766 | #else /* LIBC_ALIAS_SETREUID */ | |
767 | int setreuid(uid_t, uid_t) LIBC_ALIAS(setreuid); | |
768 | #endif /* !LIBC_ALIAS_SETREUID */ | |
769 | //End-Libc | |
1f2f436a | 770 | |
3d9156a7 | 771 | void swab(const void * __restrict, void * __restrict, ssize_t); |
3d9156a7 | 772 | void sync(void); |
3d9156a7 | 773 | int truncate(const char *, off_t); |
1f2f436a | 774 | useconds_t ualarm(useconds_t, useconds_t); |
224c7076 A |
775 | //Begin-Libc |
776 | #ifndef LIBC_ALIAS_USLEEP | |
777 | //End-Libc | |
778 | int usleep(useconds_t) __DARWIN_ALIAS_C(usleep); | |
779 | //Begin-Libc | |
780 | #else /* LIBC_ALIAS_USLEEP */ | |
781 | int usleep(useconds_t) LIBC_ALIAS_C(usleep); | |
782 | #endif /* !LIBC_ALIAS_USLEEP */ | |
783 | //End-Libc | |
3d9156a7 | 784 | pid_t vfork(void); |
1f2f436a A |
785 | /* End XSI */ |
786 | ||
224c7076 | 787 | //Begin-Libc |
1f2f436a | 788 | #ifndef LIBC_ALIAS_FSYNC |
224c7076 | 789 | //End-Libc |
1f2f436a | 790 | int fsync(int) __DARWIN_ALIAS_C(fsync); |
224c7076 | 791 | //Begin-Libc |
1f2f436a A |
792 | #else /* LIBC_ALIAS_FSYNC */ |
793 | int fsync(int) LIBC_ALIAS_C(fsync); | |
794 | #endif /* !LIBC_ALIAS_FSYNC */ | |
224c7076 | 795 | //End-Libc |
5b2abdfb | 796 | |
1f2f436a A |
797 | int ftruncate(int, off_t); |
798 | int 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 | |
811 | int fchown(int, uid_t, gid_t); | |
812 | int gethostname(char *, size_t); | |
813 | ssize_t readlink(const char * __restrict, char * __restrict, size_t); | |
814 | int setegid(gid_t); | |
815 | int seteuid(uid_t); | |
816 | int symlink(const char *, const char *); | |
817 | __END_DECLS | |
818 | #endif /* __DARWIN_C_LEVEL >= 200112L */ | |
5b2abdfb | 819 | |
1f2f436a A |
820 | |
821 | ||
822 | /* Darwin extensions */ | |
823 | ||
824 | #if __DARWIN_C_LEVEL >= __DARWIN_C_FULL | |
3d9156a7 A |
825 | #include <sys/select.h> |
826 | ||
1f2f436a A |
827 | #ifndef _DEV_T |
828 | #define _DEV_T | |
829 | typedef __darwin_dev_t dev_t; | |
830 | #endif | |
831 | ||
832 | #ifndef _MODE_T | |
833 | #define _MODE_T | |
834 | typedef __darwin_mode_t mode_t; | |
835 | #endif | |
836 | ||
837 | #ifndef _UUID_T | |
838 | #define _UUID_T | |
839 | typedef __darwin_uuid_t uuid_t; | |
840 | #endif /* _UUID_T */ | |
841 | ||
842 | __BEGIN_DECLS | |
3d9156a7 A |
843 | void _Exit(int) __dead2; |
844 | int accessx_np(const struct accessx_descriptor *, size_t, int *, uid_t); | |
9385eb3d | 845 | int acct(const char *); |
3d9156a7 | 846 | int add_profil(char *, size_t, unsigned long, unsigned int); |
9385eb3d | 847 | void endusershell(void); |
3d9156a7 A |
848 | int execvP(const char *, const char *, char * const *); |
849 | char *fflagstostr(unsigned long); | |
3d9156a7 | 850 | int getdomainname(char *, int); |
9385eb3d | 851 | int getgrouplist(const char *, int, int *, int *); |
1f2f436a | 852 | int gethostuuid(uuid_t, const struct timespec *) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0); |
9385eb3d | 853 | mode_t getmode(const void *, mode_t); |
59e0d9fe | 854 | int getpeereid(int, uid_t *, gid_t *); |
3d9156a7 | 855 | int getsgroups_np(int *, uuid_t); |
9385eb3d | 856 | char *getusershell(void); |
3d9156a7 | 857 | int getwgroups_np(int *, uuid_t); |
9385eb3d A |
858 | int initgroups(const char *, int); |
859 | int iruserok(unsigned long, int, const char *, const char *); | |
224c7076 | 860 | int iruserok_sa(const void *, int, int, const char *, const char *); |
9385eb3d A |
861 | int issetugid(void); |
862 | char *mkdtemp(char *); | |
863 | int mknod(const char *, mode_t, dev_t); | |
864 | int mkstemp(char *); | |
865 | int mkstemps(char *, int); | |
866 | char *mktemp(char *); | |
867 | int nfssvc(int, void *); | |
3d9156a7 A |
868 | int profil(char *, size_t, unsigned long, unsigned int); |
869 | int pthread_setugid_np(uid_t, gid_t); | |
870 | int pthread_getugid_np( uid_t *, gid_t *); | |
9385eb3d | 871 | int rcmd(char **, int, const char *, const char *, const char *, int *); |
224c7076 A |
872 | int rcmd_af(char **, int, const char *, const char *, const char *, int *, |
873 | int); | |
9385eb3d A |
874 | int reboot(int); |
875 | int revoke(const char *); | |
876 | int rresvport(int *); | |
877 | int rresvport_af(int *, int); | |
878 | int ruserok(const char *, int, const char *, const char *); | |
3d9156a7 | 879 | int setdomainname(const char *, int); |
9385eb3d A |
880 | int setgroups(int, const gid_t *); |
881 | void sethostid(long); | |
882 | int sethostname(const char *, int); | |
3d9156a7 | 883 | #if __DARWIN_UNIX03 |
224c7076 A |
884 | //Begin-Libc |
885 | #ifndef LIBC_ALIAS_SETKEY | |
886 | //End-Libc | |
3d9156a7 | 887 | void setkey(const char *) __DARWIN_ALIAS(setkey); |
224c7076 A |
888 | //Begin-Libc |
889 | #else /* LIBC_ALIAS_SETKEY */ | |
890 | void setkey(const char *) LIBC_ALIAS(setkey); | |
891 | #endif /* !LIBC_ALIAS_SETKEY */ | |
892 | //End-Libc | |
3d9156a7 A |
893 | #else /* !__DARWIN_UNIX03 */ |
894 | int setkey(const char *); | |
895 | #endif /* __DARWIN_UNIX03 */ | |
9385eb3d | 896 | int setlogin(const char *); |
34e8f829 A |
897 | //Begin-Libc |
898 | #ifndef LIBC_ALIAS_SETMODE | |
899 | //End-Libc | |
1f2f436a | 900 | void *setmode(const char *) __DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_2_0, __DARWIN_ALIAS(setmode)); |
34e8f829 A |
901 | //Begin-Libc |
902 | #else /* LIBC_ALIAS_SETMODE */ | |
903 | void *setmode(const char *) LIBC_ALIAS(setmode); | |
904 | #endif /* !LIBC_ALIAS_SETMODE */ | |
905 | //End-Libc | |
9385eb3d A |
906 | int setrgid(gid_t); |
907 | int setruid(uid_t); | |
3d9156a7 | 908 | int setsgroups_np(int, const uuid_t); |
9385eb3d | 909 | void setusershell(void); |
3d9156a7 A |
910 | int setwgroups_np(int, const uuid_t); |
911 | int strtofflags(char **, unsigned long *, unsigned long *); | |
9385eb3d | 912 | int swapon(const char *); |
9385eb3d | 913 | int syscall(int, ...); |
9385eb3d | 914 | int ttyslot(void); |
9385eb3d A |
915 | int undelete(const char *); |
916 | int unwhiteout(const char *); | |
9385eb3d | 917 | void *valloc(size_t); |
5b2abdfb A |
918 | |
919 | extern char *suboptarg; /* getsubopt(3) external variable */ | |
9385eb3d | 920 | int getsubopt(char **, char * const *, char **); |
5b2abdfb A |
921 | |
922 | /* HFS & HFS Plus semantics system calls go here */ | |
59e0d9fe | 923 | #ifdef __LP64__ |
1f2f436a A |
924 | int fgetattrlist(int,void*,void*,size_t,unsigned int) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_0); |
925 | int fsetattrlist(int,void*,void*,size_t,unsigned int) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_0); | |
224c7076 A |
926 | //Begin-Libc |
927 | #ifndef LIBC_ALIAS_GETATTRLIST | |
928 | //End-Libc | |
3d9156a7 | 929 | int getattrlist(const char*,void*,void*,size_t,unsigned int) __DARWIN_ALIAS(getattrlist); |
224c7076 A |
930 | //Begin-Libc |
931 | #else /* LIBC_ALIAS_GETATTRLIST */ | |
932 | int 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 | |
3d9156a7 | 938 | int setattrlist(const char*,void*,void*,size_t,unsigned int) __DARWIN_ALIAS(setattrlist); |
224c7076 A |
939 | //Begin-Libc |
940 | #else /* LIBC_ALIAS_SETATTRLIST */ | |
941 | int setattrlist(const char*,void*,void*,size_t,unsigned int) LIBC_ALIAS(setattrlist); | |
942 | #endif /* !LIBC_ALIAS_SETATTRLIST */ | |
943 | //End-Libc | |
59e0d9fe | 944 | int exchangedata(const char*,const char*,unsigned int); |
59e0d9fe | 945 | int getdirentriesattr(int,void*,void*,size_t,unsigned int*,unsigned int*,unsigned int*,unsigned int); |
59e0d9fe | 946 | |
59e0d9fe | 947 | #else /* __LP64__ */ |
1f2f436a A |
948 | int fgetattrlist(int,void*,void*,size_t,unsigned long) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_0); |
949 | int fsetattrlist(int,void*,void*,size_t,unsigned long) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_0); | |
224c7076 A |
950 | //Begin-Libc |
951 | #ifndef LIBC_ALIAS_GETATTRLIST | |
952 | //End-Libc | |
3d9156a7 | 953 | int getattrlist(const char*,void*,void*,size_t,unsigned long) __DARWIN_ALIAS(getattrlist); |
224c7076 A |
954 | //Begin-Libc |
955 | #else /* LIBC_ALIAS_GETATTRLIST */ | |
956 | int 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 | |
3d9156a7 | 962 | int setattrlist(const char*,void*,void*,size_t,unsigned long) __DARWIN_ALIAS(setattrlist); |
224c7076 A |
963 | //Begin-Libc |
964 | #else /* LIBC_ALIAS_SETATTRLIST */ | |
965 | int setattrlist(const char*,void*,void*,size_t,unsigned long) LIBC_ALIAS(setattrlist); | |
966 | #endif /* !LIBC_ALIAS_SETATTRLIST */ | |
967 | //End-Libc | |
9385eb3d | 968 | int exchangedata(const char*,const char*,unsigned long); |
9385eb3d | 969 | int getdirentriesattr(int,void*,void*,size_t,unsigned long*,unsigned long*,unsigned long*,unsigned long); |
9385eb3d | 970 | |
59e0d9fe | 971 | #endif /* __LP64__ */ |
5b2abdfb | 972 | |
34e8f829 A |
973 | struct fssearchblock; |
974 | struct searchstate; | |
975 | ||
976 | int searchfs(const char *, struct fssearchblock *, unsigned long *, unsigned int, unsigned int, struct searchstate *); | |
977 | int fsctl(const char *,unsigned long,void*,unsigned int); | |
1f2f436a | 978 | int ffsctl(int,unsigned long,void*,unsigned int) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_0); |
34e8f829 | 979 | |
3d9156a7 A |
980 | extern int optreset; |
981 | ||
5b2abdfb | 982 | __END_DECLS |
1f2f436a | 983 | #endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */ |
5b2abdfb | 984 | |
1f2f436a | 985 | #endif /* _UNISTD_H_ */ |