]> git.saurik.com Git - apple/libc.git/blame - include/unistd.h
Libc-391.5.22.tar.gz
[apple/libc.git] / include / unistd.h
CommitLineData
5b2abdfb
A
1/*
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
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
A
71#include <_types.h>
72
5b2abdfb 73#include <sys/cdefs.h>
3d9156a7 74#include <sys/unistd.h>
59e0d9fe 75
3d9156a7
A
76#ifndef _GID_T
77#define _GID_T
78typedef __darwin_gid_t gid_t;
79#endif
5b2abdfb 80
3d9156a7
A
81#ifndef _INTPTR_T
82#define _INTPTR_T
83typedef __darwin_intptr_t intptr_t;
84#endif
5b2abdfb 85
3d9156a7
A
86#ifndef _OFF_T
87#define _OFF_T
88typedef __darwin_off_t off_t;
89#endif
59e0d9fe 90
3d9156a7
A
91#ifndef _PID_T
92#define _PID_T
93typedef __darwin_pid_t pid_t;
59e0d9fe 94#endif
3d9156a7
A
95
96#ifndef _SIZE_T
97#define _SIZE_T
98/* DO NOT REMOVE THIS COMMENT: fixincludes needs to see:
99 * _GCC_SIZE_T */
100typedef __darwin_size_t size_t;
59e0d9fe 101#endif
3d9156a7
A
102
103#ifndef _SSIZE_T
104#define _SSIZE_T
105typedef __darwin_ssize_t ssize_t;
5b2abdfb 106#endif
3d9156a7
A
107
108#ifndef _UID_T
109#define _UID_T
110typedef __darwin_uid_t uid_t; /* user id */
59e0d9fe
A
111#endif
112
3d9156a7
A
113#ifndef _USECONDS_T
114#define _USECONDS_T
115typedef __darwin_useconds_t useconds_t;
116#endif
59e0d9fe 117
3d9156a7
A
118#ifndef _POSIX_C_SOURCE
119#ifndef _UUID_T
120#define _UUID_T
121typedef __darwin_uuid_t uuid_t;
122#endif /* _UUID_T */
123#endif /* _POSIX_C_SOURCE */
124
125#define STDIN_FILENO 0 /* standard input file descriptor */
126#define STDOUT_FILENO 1 /* standard output file descriptor */
127#define STDERR_FILENO 2 /* standard error file descriptor */
128
129#ifndef NULL
130#define NULL __DARWIN_NULL
131#endif /* ! NULL */
132
133/* Version test macros */
134/* _POSIX_VERSION and _POSIX2_VERSION from sys/unistd.h */
59e0d9fe
A
135#define _XOPEN_VERSION 600 /* [XSI] */
136#define _XOPEN_XCU_VERSION 4 /* Older standard */
137
138
139/* Please keep this list in the same order as the applicable standard */
140#define _POSIX_ADVISORY_INFO (-1) /* [ADV] */
3d9156a7 141#define _POSIX_ASYNCHRONOUS_IO (-1) /* [AIO] */
59e0d9fe
A
142#define _POSIX_BARRIERS (-1) /* [BAR] */
143#define _POSIX_CHOWN_RESTRICTED 200112L
144#define _POSIX_CLOCK_SELECTION (-1) /* [CS] */
145#define _POSIX_CPUTIME (-1) /* [CPT] */
3d9156a7 146#define _POSIX_FSYNC (-1) /* [FSC] */
59e0d9fe
A
147#define _POSIX_IPV6 200112L
148#define _POSIX_JOB_CONTROL 200112L
149#define _POSIX_MAPPED_FILES 200112L /* [MF] */
3d9156a7
A
150#define _POSIX_MEMLOCK (-1) /* [ML] */
151#define _POSIX_MEMLOCK_RANGE (-1) /* [MR] */
59e0d9fe
A
152#define _POSIX_MEMORY_PROTECTION 200112L /* [MPR] */
153#define _POSIX_MESSAGE_PASSING (-1) /* [MSG] */
154#define _POSIX_MONOTONIC_CLOCK (-1) /* [MON] */
155#define _POSIX_NO_TRUNC 200112L
156#define _POSIX_PRIORITIZED_IO (-1) /* [PIO] */
157#define _POSIX_PRIORITY_SCHEDULING (-1) /* [PS] */
3d9156a7 158#define _POSIX_RAW_SOCKETS (-1) /* [RS] */
59e0d9fe
A
159#define _POSIX_READER_WRITER_LOCKS 200112L /* [THR] */
160#define _POSIX_REALTIME_SIGNALS (-1) /* [RTS] */
161#define _POSIX_REGEXP 200112L
3d9156a7
A
162#define _POSIX_SAVED_IDS 200112L /* XXX required */
163#define _POSIX_SEMAPHORES (-1) /* [SEM] */
164#define _POSIX_SHARED_MEMORY_OBJECTS (-1) /* [SHM] */
59e0d9fe
A
165#define _POSIX_SHELL 200112L
166#define _POSIX_SPAWN (-1) /* [SPN] */
167#define _POSIX_SPIN_LOCKS (-1) /* [SPI] */
168#define _POSIX_SPORADIC_SERVER (-1) /* [SS] */
3d9156a7 169#define _POSIX_SYNCHRONIZED_IO (-1) /* [SIO] */
59e0d9fe
A
170#define _POSIX_THREAD_ATTR_STACKADDR 200112L /* [TSA] */
171#define _POSIX_THREAD_ATTR_STACKSIZE 200112L /* [TSS] */
172#define _POSIX_THREAD_CPUTIME (-1) /* [TCT] */
173#define _POSIX_THREAD_PRIO_INHERIT (-1) /* [TPI] */
174#define _POSIX_THREAD_PRIO_PROTECT (-1) /* [TPP] */
175#define _POSIX_THREAD_PRIORITY_SCHEDULING (-1) /* [TPS] */
3d9156a7 176#define _POSIX_THREAD_PROCESS_SHARED (-1) /* [TSH] */
59e0d9fe
A
177#define _POSIX_THREAD_SAFE_FUNCTIONS 200112L /* [TSF] */
178#define _POSIX_THREAD_SPORADIC_SERVER (-1) /* [TSP] */
179#define _POSIX_THREADS 200112L /* [THR] */
180#define _POSIX_TIMEOUTS (-1) /* [TMO] */
181#define _POSIX_TIMERS (-1) /* [TMR] */
182#define _POSIX_TRACE (-1) /* [TRC] */
183#define _POSIX_TRACE_EVENT_FILTER (-1) /* [TEF] */
184#define _POSIX_TRACE_INHERIT (-1) /* [TRI] */
185#define _POSIX_TRACE_LOG (-1) /* [TRL] */
186#define _POSIX_TYPED_MEMORY_OBJECTS (-1) /* [TYM] */
187#ifndef _POSIX_VDISABLE
188#define _POSIX_VDISABLE 0xff /* same as sys/termios.h */
189#endif /* _POSIX_VDISABLE */
190
191#define _POSIX2_C_BIND 200112L
3d9156a7 192#define _POSIX2_C_DEV 200112L /* c99 command */
59e0d9fe
A
193#define _POSIX2_CHAR_TERM 200112L
194#define _POSIX2_FORT_DEV (-1) /* fort77 command */
195#define _POSIX2_FORT_RUN 200112L
3d9156a7 196#define _POSIX2_LOCALEDEF 200112L /* localedef command */
59e0d9fe
A
197#define _POSIX2_PBS (-1)
198#define _POSIX2_PBS_ACCOUNTING (-1)
199#define _POSIX2_PBS_CHECKPOINT (-1)
200#define _POSIX2_PBS_LOCATE (-1)
201#define _POSIX2_PBS_MESSAGE (-1)
202#define _POSIX2_PBS_TRACK (-1)
203#define _POSIX2_SW_DEV 200112L
204#define _POSIX2_UPE 200112L /* XXXX no fc, newgrp, tabs */
205
206#define _V6_ILP32_OFF32 (-1)
3d9156a7
A
207#define _V6_ILP32_OFFBIG (1)
208#define _V6_LP64_OFF64 (1)
209#define _V6_LPBIG_OFFBIG (1)
59e0d9fe
A
210
211#define _XBS5_ILP32_OFF32 _V6_ILP32_OFF32 /* legacy */
212#define _XBS5_ILP32_OFFBIG _V6_ILP32_OFFBIG /* legacy */
213#define _XBS5_LP64_OFF64 _V6_LP64_OFF64 /* legacy */
214#define _XBS5_LPBIG_OFFBIG _V6_LPBIG_OFFBIG /* legacy */
215
216#define _XOPEN_CRYPT (1)
217#define _XOPEN_ENH_I18N (1) /* XXX required */
218#define _XOPEN_LEGACY (-1) /* no ftime gcvt, wcswcs */
219#define _XOPEN_REALTIME (-1) /* no q'ed signals, mq_* */
220#define _XOPEN_REALTIME_THREADS (-1) /* no posix_spawn, et. al. */
221#define _XOPEN_SHM (1)
222#define _XOPEN_STREAMS (-1)
223#define _XOPEN_UNIX (1)
5b2abdfb 224
5b2abdfb 225
5b2abdfb
A
226#define F_ULOCK 0 /* unlock locked section */
227#define F_LOCK 1 /* lock a section for exclusive use */
228#define F_TLOCK 2 /* test and lock a section for exclusive use */
229#define F_TEST 3 /* test a section for locks by other procs */
5b2abdfb 230
9385eb3d 231/* configurable system variables */
59e0d9fe
A
232#define _SC_ARG_MAX 1
233#define _SC_CHILD_MAX 2
234#define _SC_CLK_TCK 3
235#define _SC_NGROUPS_MAX 4
236#define _SC_OPEN_MAX 5
237#define _SC_JOB_CONTROL 6
238#define _SC_SAVED_IDS 7
239#define _SC_VERSION 8
240#define _SC_BC_BASE_MAX 9
241#define _SC_BC_DIM_MAX 10
242#define _SC_BC_SCALE_MAX 11
243#define _SC_BC_STRING_MAX 12
244#define _SC_COLL_WEIGHTS_MAX 13
245#define _SC_EXPR_NEST_MAX 14
246#define _SC_LINE_MAX 15
247#define _SC_RE_DUP_MAX 16
248#define _SC_2_VERSION 17
249#define _SC_2_C_BIND 18
250#define _SC_2_C_DEV 19
251#define _SC_2_CHAR_TERM 20
252#define _SC_2_FORT_DEV 21
253#define _SC_2_FORT_RUN 22
254#define _SC_2_LOCALEDEF 23
255#define _SC_2_SW_DEV 24
256#define _SC_2_UPE 25
257#define _SC_STREAM_MAX 26
258#define _SC_TZNAME_MAX 27
259#define _SC_ASYNCHRONOUS_IO 28
260#define _SC_PAGESIZE 29
261#define _SC_MEMLOCK 30
262#define _SC_MEMLOCK_RANGE 31
263#define _SC_MEMORY_PROTECTION 32
264#define _SC_MESSAGE_PASSING 33
265#define _SC_PRIORITIZED_IO 34
266#define _SC_PRIORITY_SCHEDULING 35
267#define _SC_REALTIME_SIGNALS 36
268#define _SC_SEMAPHORES 37
269#define _SC_FSYNC 38
270#define _SC_SHARED_MEMORY_OBJECTS 39
271#define _SC_SYNCHRONIZED_IO 40
272#define _SC_TIMERS 41
273#define _SC_AIO_LISTIO_MAX 42
274#define _SC_AIO_MAX 43
275#define _SC_AIO_PRIO_DELTA_MAX 44
276#define _SC_DELAYTIMER_MAX 45
277#define _SC_MQ_OPEN_MAX 46
278#define _SC_MAPPED_FILES 47 /* swap _SC_PAGESIZE vs. BSD */
279#define _SC_RTSIG_MAX 48
280#define _SC_SEM_NSEMS_MAX 49
281#define _SC_SEM_VALUE_MAX 50
282#define _SC_SIGQUEUE_MAX 51
283#define _SC_TIMER_MAX 52
284#define _SC_2_PBS 59
285#define _SC_2_PBS_ACCOUNTING 60
286#define _SC_2_PBS_CHECKPOINT 61
287#define _SC_2_PBS_LOCATE 62
288#define _SC_2_PBS_MESSAGE 63
289#define _SC_2_PBS_TRACK 64
290#define _SC_ADVISORY_INFO 65
291#define _SC_BARRIERS 66
292#define _SC_CLOCK_SELECTION 67
293#define _SC_CPUTIME 68
294#define _SC_FILE_LOCKING 69
295#define _SC_GETGR_R_SIZE_MAX 70
296#define _SC_GETPW_R_SIZE_MAX 71
297#define _SC_HOST_NAME_MAX 72
298#define _SC_LOGIN_NAME_MAX 73
299#define _SC_MONOTONIC_CLOCK 74
300#define _SC_MQ_PRIO_MAX 75
301#define _SC_READER_WRITER_LOCKS 76
302#define _SC_REGEXP 77
303#define _SC_SHELL 78
304#define _SC_SPAWN 79
305#define _SC_SPIN_LOCKS 80
306#define _SC_SPORADIC_SERVER 81
307#define _SC_THREAD_ATTR_STACKADDR 82
308#define _SC_THREAD_ATTR_STACKSIZE 83
309#define _SC_THREAD_CPUTIME 84
310#define _SC_THREAD_DESTRUCTOR_ITERATIONS 85
311#define _SC_THREAD_KEYS_MAX 86
312#define _SC_THREAD_PRIO_INHERIT 87
313#define _SC_THREAD_PRIO_PROTECT 88
314#define _SC_THREAD_PRIORITY_SCHEDULING 89
315#define _SC_THREAD_PROCESS_SHARED 90
316#define _SC_THREAD_SAFE_FUNCTIONS 91
317#define _SC_THREAD_SPORADIC_SERVER 92
318#define _SC_THREAD_STACK_MIN 93
319#define _SC_THREAD_THREADS_MAX 94
320#define _SC_TIMEOUTS 95
321#define _SC_THREADS 96
322#define _SC_TRACE 97
323#define _SC_TRACE_EVENT_FILTER 98
324#define _SC_TRACE_INHERIT 99
325#define _SC_TRACE_LOG 100
326#define _SC_TTY_NAME_MAX 101
327#define _SC_TYPED_MEMORY_OBJECTS 102
328#define _SC_V6_ILP32_OFF32 103
329#define _SC_V6_ILP32_OFFBIG 104
330#define _SC_V6_LP64_OFF64 105
331#define _SC_V6_LPBIG_OFFBIG 106
332#define _SC_IPV6 118
333#define _SC_RAW_SOCKETS 119
334#define _SC_SYMLOOP_MAX 120
335#define _SC_ATEXIT_MAX 107
336#define _SC_IOV_MAX 56
337#define _SC_PAGE_SIZE _SC_PAGESIZE
338#define _SC_XOPEN_CRYPT 108
339#define _SC_XOPEN_ENH_I18N 109
340#define _SC_XOPEN_LEGACY 110
341#define _SC_XOPEN_REALTIME 111
342#define _SC_XOPEN_REALTIME_THREADS 112
343#define _SC_XOPEN_SHM 113
3d9156a7 344#define _SC_XOPEN_STREAMS 114
59e0d9fe
A
345#define _SC_XOPEN_UNIX 115
346#define _SC_XOPEN_VERSION 116
347#define _SC_XOPEN_XCU_VERSION 121
348#define _SC_XBS5_ILP32_OFF32 122
349#define _SC_XBS5_ILP32_OFFBIG 123
350#define _SC_XBS5_LP64_OFF64 124
351#define _SC_XBS5_LPBIG_OFFBIG 125
352
353#ifndef _CS_PATH /* XXX temporary #ifdef'ed for <sys/unistd.h> */
354#define _CS_PATH 1
355#endif
356#define _CS_POSIX_V6_ILP32_OFF32_CFLAGS 2
357#define _CS_POSIX_V6_ILP32_OFF32_LDFLAGS 3
358#define _CS_POSIX_V6_ILP32_OFF32_LIBS 4
359#define _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS 5
360#define _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS 6
361#define _CS_POSIX_V6_ILP32_OFFBIG_LIBS 7
362#define _CS_POSIX_V6_LP64_OFF64_CFLAGS 8
363#define _CS_POSIX_V6_LP64_OFF64_LDFLAGS 9
364#define _CS_POSIX_V6_LP64_OFF64_LIBS 10
365#define _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS 11
366#define _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS 12
367#define _CS_POSIX_V6_LPBIG_OFFBIG_LIBS 13
368#define _CS_POSIX_V6_WIDTH_RESTRICTED_ENVS 14
369
370/* reserved for compatibility with Issue 5 */
371#define _CS_XBS5_ILP32_OFF32_CFLAGS 20
372#define _CS_XBS5_ILP32_OFF32_LDFLAGS 21
373#define _CS_XBS5_ILP32_OFF32_LIBS 22
374#define _CS_XBS5_ILP32_OFF32_LINTFLAGS 23
375#define _CS_XBS5_ILP32_OFFBIG_CFLAGS 24
376#define _CS_XBS5_ILP32_OFFBIG_LDFLAGS 25
377#define _CS_XBS5_ILP32_OFFBIG_LIBS 26
378#define _CS_XBS5_ILP32_OFFBIG_LINTFLAGS 27
379#define _CS_XBS5_LP64_OFF64_CFLAGS 28
380#define _CS_XBS5_LP64_OFF64_LDFLAGS 29
381#define _CS_XBS5_LP64_OFF64_LIBS 30
382#define _CS_XBS5_LP64_OFF64_LINTFLAGS 31
383#define _CS_XBS5_LPBIG_OFFBIG_CFLAGS 32
384#define _CS_XBS5_LPBIG_OFFBIG_LDFLAGS 33
385#define _CS_XBS5_LPBIG_OFFBIG_LIBS 34
386#define _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS 35
387
5b2abdfb 388__BEGIN_DECLS
9385eb3d 389
9385eb3d
A
390void _exit(int) __dead2;
391int access(const char *, int);
3d9156a7
A
392unsigned int
393 alarm(unsigned int);
9385eb3d
A
394int chdir(const char *);
395int chown(const char *, uid_t, gid_t);
396int close(int);
397size_t confstr(int, char *, size_t);
3d9156a7
A
398char *crypt(const char *, const char *);
399char *ctermid(char *);
9385eb3d
A
400int dup(int);
401int dup2(int, int);
402int execl(const char *, const char *, ...);
403int execle(const char *, const char *, ...);
404int execlp(const char *, const char *, ...);
405int execv(const char *, char * const *);
406int execve(const char *, char * const *, char * const *);
407int execvp(const char *, char * const *);
3d9156a7
A
408int fchown(int, uid_t, gid_t);
409int fchdir(int);
9385eb3d
A
410pid_t fork(void);
411long fpathconf(int, int);
3d9156a7 412int ftruncate(int, off_t);
9385eb3d 413char *getcwd(char *, size_t);
9385eb3d
A
414gid_t getegid(void);
415uid_t geteuid(void);
416gid_t getgid(void);
417int getgroups(int, gid_t []);
3d9156a7
A
418long gethostid(void);
419int gethostname(char *, size_t);
9385eb3d 420char *getlogin(void);
3d9156a7
A
421int getlogin_r(char *, size_t);
422int getopt(int, char * const [], const char *);
423pid_t getpgid(pid_t);
9385eb3d
A
424pid_t getpgrp(void);
425pid_t getpid(void);
426pid_t getppid(void);
3d9156a7 427pid_t getsid(pid_t);
9385eb3d 428uid_t getuid(void);
3d9156a7 429char *getwd(char *); /* obsoleted by getcwd() */
9385eb3d 430int isatty(int);
3d9156a7 431int lchown(const char *, uid_t, gid_t) __DARWIN_ALIAS(lchown);
9385eb3d 432int link(const char *, const char *);
3d9156a7 433int lockf(int, int, off_t);
9385eb3d 434off_t lseek(int, off_t, int);
3d9156a7 435int nice(int);
9385eb3d
A
436long pathconf(const char *, int);
437int pause(void);
3d9156a7
A
438int pipe(int [2]);
439ssize_t pread(int, void *, size_t, off_t);
440ssize_t pwrite(int, const void *, size_t, off_t);
9385eb3d 441ssize_t read(int, void *, size_t);
3d9156a7 442ssize_t readlink(const char * __restrict, char * __restrict, size_t);
9385eb3d 443int rmdir(const char *);
3d9156a7
A
444int setegid(gid_t);
445int seteuid(uid_t);
9385eb3d
A
446int setgid(gid_t);
447int setpgid(pid_t, pid_t);
3d9156a7
A
448#if __DARWIN_UNIX03
449pid_t setpgrp(void) __DARWIN_ALIAS(setpgrp);
450#else /* !__DARWIN_UNIX03 */
451int setpgrp(pid_t pid, pid_t pgrp); /* obsoleted by setpgid() */
452#endif /* __DARWIN_UNIX03 */
453int setregid(gid_t, gid_t);
454int setreuid(uid_t, uid_t);
9385eb3d
A
455pid_t setsid(void);
456int setuid(uid_t);
3d9156a7
A
457unsigned int
458 sleep(unsigned int);
459void swab(const void * __restrict, void * __restrict, ssize_t);
460int symlink(const char *, const char *);
461void sync(void);
9385eb3d
A
462long sysconf(int);
463pid_t tcgetpgrp(int);
464int tcsetpgrp(int, pid_t);
3d9156a7 465int truncate(const char *, off_t);
9385eb3d 466char *ttyname(int);
3d9156a7
A
467#if __DARWIN_UNIX03
468int ttyname_r(int, char *, size_t) __DARWIN_ALIAS(ttyname_r);
469#else /* !__DARWIN_UNIX03 */
9385eb3d 470char *ttyname_r(int, char *, size_t);
3d9156a7
A
471#endif /* __DARWIN_UNIX03 */
472useconds_t
473 ualarm(useconds_t, useconds_t);
9385eb3d 474int unlink(const char *);
3d9156a7
A
475int usleep(useconds_t);
476pid_t vfork(void);
9385eb3d 477ssize_t write(int, const void *, size_t);
5b2abdfb
A
478
479extern char *optarg; /* getopt(3) external variables */
3d9156a7 480extern int optind, opterr, optopt;
5b2abdfb 481
3d9156a7
A
482#ifndef _POSIX_C_SOURCE
483#include <sys/select.h>
484
485void _Exit(int) __dead2;
486int accessx_np(const struct accessx_descriptor *, size_t, int *, uid_t);
9385eb3d 487int acct(const char *);
3d9156a7 488int add_profil(char *, size_t, unsigned long, unsigned int);
9385eb3d 489int async_daemon(void);
3d9156a7 490void *brk(const void *);
9385eb3d 491int chroot(const char *);
3d9156a7
A
492#if __DARWIN_UNIX03
493void encrypt(char *, int) __DARWIN_ALIAS(encrypt);
494#else /* !__DARWIN_UNIX03 */
495int encrypt(char *, int);
496#endif /* __DARWIN_UNIX03 */
9385eb3d 497void endusershell(void);
3d9156a7
A
498int execvP(const char *, const char *, char * const *);
499char *fflagstostr(unsigned long);
9385eb3d 500int fsync(int);
9385eb3d 501int getdtablesize(void);
3d9156a7 502int getdomainname(char *, int);
9385eb3d 503int getgrouplist(const char *, int, int *, int *);
9385eb3d
A
504mode_t getmode(const void *, mode_t);
505int getpagesize(void) __pure2;
506char *getpass(const char *);
59e0d9fe 507int getpeereid(int, uid_t *, gid_t *);
9385eb3d 508int getpgid(pid_t _pid);
3d9156a7 509int getsgroups_np(int *, uuid_t);
9385eb3d
A
510int getsid(pid_t _pid);
511char *getusershell(void);
3d9156a7 512int getwgroups_np(int *, uuid_t);
9385eb3d
A
513int initgroups(const char *, int);
514int iruserok(unsigned long, int, const char *, const char *);
515int issetugid(void);
516char *mkdtemp(char *);
517int mknod(const char *, mode_t, dev_t);
518int mkstemp(char *);
519int mkstemps(char *, int);
520char *mktemp(char *);
521int nfssvc(int, void *);
3d9156a7
A
522int profil(char *, size_t, unsigned long, unsigned int);
523int pthread_setugid_np(uid_t, gid_t);
524int pthread_getugid_np( uid_t *, gid_t *);
9385eb3d 525int rcmd(char **, int, const char *, const char *, const char *, int *);
9385eb3d
A
526int reboot(int);
527int revoke(const char *);
528int rresvport(int *);
529int rresvport_af(int *, int);
530int ruserok(const char *, int, const char *, const char *);
3d9156a7
A
531void *sbrk(int);
532int setdomainname(const char *, int);
9385eb3d
A
533int setgroups(int, const gid_t *);
534void sethostid(long);
535int sethostname(const char *, int);
3d9156a7
A
536#if __DARWIN_UNIX03
537void setkey(const char *) __DARWIN_ALIAS(setkey);
538#else /* !__DARWIN_UNIX03 */
539int setkey(const char *);
540#endif /* __DARWIN_UNIX03 */
9385eb3d
A
541int setlogin(const char *);
542void *setmode(const char *);
9385eb3d
A
543int setrgid(gid_t);
544int setruid(uid_t);
3d9156a7 545int setsgroups_np(int, const uuid_t);
9385eb3d 546void setusershell(void);
3d9156a7
A
547int setwgroups_np(int, const uuid_t);
548int strtofflags(char **, unsigned long *, unsigned long *);
9385eb3d 549int swapon(const char *);
9385eb3d 550int syscall(int, ...);
9385eb3d 551int ttyslot(void);
9385eb3d
A
552int undelete(const char *);
553int unwhiteout(const char *);
9385eb3d 554void *valloc(size_t);
5b2abdfb
A
555
556extern char *suboptarg; /* getsubopt(3) external variable */
9385eb3d 557int getsubopt(char **, char * const *, char **);
5b2abdfb
A
558
559/* HFS & HFS Plus semantics system calls go here */
59e0d9fe 560#ifdef __LP64__
3d9156a7
A
561int getattrlist(const char*,void*,void*,size_t,unsigned int) __DARWIN_ALIAS(getattrlist);
562int setattrlist(const char*,void*,void*,size_t,unsigned int) __DARWIN_ALIAS(setattrlist);
59e0d9fe
A
563int exchangedata(const char*,const char*,unsigned int);
564int checkuseraccess(const char*,uid_t,gid_t*,int,int,unsigned int);
565int getdirentriesattr(int,void*,void*,size_t,unsigned int*,unsigned int*,unsigned int*,unsigned int);
566int searchfs(const char*,void*,void*,unsigned int,unsigned int,void*);
567
568int fsctl(const char *,unsigned int,void*,unsigned int);
569#else /* __LP64__ */
3d9156a7
A
570int getattrlist(const char*,void*,void*,size_t,unsigned long) __DARWIN_ALIAS(getattrlist);
571int setattrlist(const char*,void*,void*,size_t,unsigned long) __DARWIN_ALIAS(setattrlist);
9385eb3d
A
572int exchangedata(const char*,const char*,unsigned long);
573int checkuseraccess(const char*,uid_t,gid_t*,int,int,unsigned long);
574int getdirentriesattr(int,void*,void*,size_t,unsigned long*,unsigned long*,unsigned long*,unsigned long);
575int searchfs(const char*,void*,void*,unsigned long,unsigned long,void*);
576
577int fsctl(const char *,unsigned long,void*,unsigned long);
59e0d9fe 578#endif /* __LP64__ */
5b2abdfb 579
3d9156a7
A
580extern int optreset;
581
582#endif /* !_POSIX_C_SOURCE */
5b2abdfb
A
583__END_DECLS
584
585#endif /* !_UNISTD_H_ */