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