]> git.saurik.com Git - apple/libc.git/blob - include/unistd.h
Libc-391.5.22.tar.gz
[apple/libc.git] / include / unistd.h
1 /*
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
12 *
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23 /*-
24 * Copyright (c) 1998-1999 Apple Computer, Inc. All Rights Reserved
25 * Copyright (c) 1991, 1993, 1994
26 * The Regents of the University of California. All rights reserved.
27 *
28 * Redistribution and use in source and binary forms, with or without
29 * modification, are permitted provided that the following conditions
30 * are met:
31 * 1. Redistributions of source code must retain the above copyright
32 * notice, this list of conditions and the following disclaimer.
33 * 2. Redistributions in binary form must reproduce the above copyright
34 * notice, this list of conditions and the following disclaimer in the
35 * documentation and/or other materials provided with the distribution.
36 * 3. All advertising materials mentioning features or use of this software
37 * must display the following acknowledgement:
38 * This product includes software developed by the University of
39 * California, Berkeley and its contributors.
40 * 4. Neither the name of the University nor the names of its contributors
41 * may be used to endorse or promote products derived from this software
42 * without specific prior written permission.
43 *
44 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
45 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
46 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
47 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
48 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
49 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
50 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
51 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
52 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
53 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
54 * SUCH DAMAGE.
55 *
56 * @(#)unistd.h 8.12 (Berkeley) 4/27/95
57 *
58 * Copyright (c) 1998 Apple Compter, Inc.
59 * All Rights Reserved
60 */
61
62 /* History:
63 7/14/99 EKN at Apple fixed getdirentriesattr from getdirentryattr
64 3/26/98 CHW at Apple added real interface to searchfs call
65 3/5/98 CHW at Apple added hfs semantic system calls headers
66 */
67
68 #ifndef _UNISTD_H_
69 #define _UNISTD_H_
70
71 #include <_types.h>
72
73 #include <sys/cdefs.h>
74 #include <sys/unistd.h>
75
76 #ifndef _GID_T
77 #define _GID_T
78 typedef __darwin_gid_t gid_t;
79 #endif
80
81 #ifndef _INTPTR_T
82 #define _INTPTR_T
83 typedef __darwin_intptr_t intptr_t;
84 #endif
85
86 #ifndef _OFF_T
87 #define _OFF_T
88 typedef __darwin_off_t off_t;
89 #endif
90
91 #ifndef _PID_T
92 #define _PID_T
93 typedef __darwin_pid_t pid_t;
94 #endif
95
96 #ifndef _SIZE_T
97 #define _SIZE_T
98 /* DO NOT REMOVE THIS COMMENT: fixincludes needs to see:
99 * _GCC_SIZE_T */
100 typedef __darwin_size_t size_t;
101 #endif
102
103 #ifndef _SSIZE_T
104 #define _SSIZE_T
105 typedef __darwin_ssize_t ssize_t;
106 #endif
107
108 #ifndef _UID_T
109 #define _UID_T
110 typedef __darwin_uid_t uid_t; /* user id */
111 #endif
112
113 #ifndef _USECONDS_T
114 #define _USECONDS_T
115 typedef __darwin_useconds_t useconds_t;
116 #endif
117
118 #ifndef _POSIX_C_SOURCE
119 #ifndef _UUID_T
120 #define _UUID_T
121 typedef __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 */
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] */
141 #define _POSIX_ASYNCHRONOUS_IO (-1) /* [AIO] */
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] */
146 #define _POSIX_FSYNC (-1) /* [FSC] */
147 #define _POSIX_IPV6 200112L
148 #define _POSIX_JOB_CONTROL 200112L
149 #define _POSIX_MAPPED_FILES 200112L /* [MF] */
150 #define _POSIX_MEMLOCK (-1) /* [ML] */
151 #define _POSIX_MEMLOCK_RANGE (-1) /* [MR] */
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] */
158 #define _POSIX_RAW_SOCKETS (-1) /* [RS] */
159 #define _POSIX_READER_WRITER_LOCKS 200112L /* [THR] */
160 #define _POSIX_REALTIME_SIGNALS (-1) /* [RTS] */
161 #define _POSIX_REGEXP 200112L
162 #define _POSIX_SAVED_IDS 200112L /* XXX required */
163 #define _POSIX_SEMAPHORES (-1) /* [SEM] */
164 #define _POSIX_SHARED_MEMORY_OBJECTS (-1) /* [SHM] */
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] */
169 #define _POSIX_SYNCHRONIZED_IO (-1) /* [SIO] */
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] */
176 #define _POSIX_THREAD_PROCESS_SHARED (-1) /* [TSH] */
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
192 #define _POSIX2_C_DEV 200112L /* c99 command */
193 #define _POSIX2_CHAR_TERM 200112L
194 #define _POSIX2_FORT_DEV (-1) /* fort77 command */
195 #define _POSIX2_FORT_RUN 200112L
196 #define _POSIX2_LOCALEDEF 200112L /* localedef command */
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)
207 #define _V6_ILP32_OFFBIG (1)
208 #define _V6_LP64_OFF64 (1)
209 #define _V6_LPBIG_OFFBIG (1)
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)
224
225
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 */
230
231 /* configurable system variables */
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
344 #define _SC_XOPEN_STREAMS 114
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
388 __BEGIN_DECLS
389
390 void _exit(int) __dead2;
391 int access(const char *, int);
392 unsigned int
393 alarm(unsigned int);
394 int chdir(const char *);
395 int chown(const char *, uid_t, gid_t);
396 int close(int);
397 size_t confstr(int, char *, size_t);
398 char *crypt(const char *, const char *);
399 char *ctermid(char *);
400 int dup(int);
401 int dup2(int, int);
402 int execl(const char *, const char *, ...);
403 int execle(const char *, const char *, ...);
404 int execlp(const char *, const char *, ...);
405 int execv(const char *, char * const *);
406 int execve(const char *, char * const *, char * const *);
407 int execvp(const char *, char * const *);
408 int fchown(int, uid_t, gid_t);
409 int fchdir(int);
410 pid_t fork(void);
411 long fpathconf(int, int);
412 int ftruncate(int, off_t);
413 char *getcwd(char *, size_t);
414 gid_t getegid(void);
415 uid_t geteuid(void);
416 gid_t getgid(void);
417 int getgroups(int, gid_t []);
418 long gethostid(void);
419 int gethostname(char *, size_t);
420 char *getlogin(void);
421 int getlogin_r(char *, size_t);
422 int getopt(int, char * const [], const char *);
423 pid_t getpgid(pid_t);
424 pid_t getpgrp(void);
425 pid_t getpid(void);
426 pid_t getppid(void);
427 pid_t getsid(pid_t);
428 uid_t getuid(void);
429 char *getwd(char *); /* obsoleted by getcwd() */
430 int isatty(int);
431 int lchown(const char *, uid_t, gid_t) __DARWIN_ALIAS(lchown);
432 int link(const char *, const char *);
433 int lockf(int, int, off_t);
434 off_t lseek(int, off_t, int);
435 int nice(int);
436 long pathconf(const char *, int);
437 int pause(void);
438 int pipe(int [2]);
439 ssize_t pread(int, void *, size_t, off_t);
440 ssize_t pwrite(int, const void *, size_t, off_t);
441 ssize_t read(int, void *, size_t);
442 ssize_t readlink(const char * __restrict, char * __restrict, size_t);
443 int rmdir(const char *);
444 int setegid(gid_t);
445 int seteuid(uid_t);
446 int setgid(gid_t);
447 int setpgid(pid_t, pid_t);
448 #if __DARWIN_UNIX03
449 pid_t setpgrp(void) __DARWIN_ALIAS(setpgrp);
450 #else /* !__DARWIN_UNIX03 */
451 int setpgrp(pid_t pid, pid_t pgrp); /* obsoleted by setpgid() */
452 #endif /* __DARWIN_UNIX03 */
453 int setregid(gid_t, gid_t);
454 int setreuid(uid_t, uid_t);
455 pid_t setsid(void);
456 int setuid(uid_t);
457 unsigned int
458 sleep(unsigned int);
459 void swab(const void * __restrict, void * __restrict, ssize_t);
460 int symlink(const char *, const char *);
461 void sync(void);
462 long sysconf(int);
463 pid_t tcgetpgrp(int);
464 int tcsetpgrp(int, pid_t);
465 int truncate(const char *, off_t);
466 char *ttyname(int);
467 #if __DARWIN_UNIX03
468 int ttyname_r(int, char *, size_t) __DARWIN_ALIAS(ttyname_r);
469 #else /* !__DARWIN_UNIX03 */
470 char *ttyname_r(int, char *, size_t);
471 #endif /* __DARWIN_UNIX03 */
472 useconds_t
473 ualarm(useconds_t, useconds_t);
474 int unlink(const char *);
475 int usleep(useconds_t);
476 pid_t vfork(void);
477 ssize_t write(int, const void *, size_t);
478
479 extern char *optarg; /* getopt(3) external variables */
480 extern int optind, opterr, optopt;
481
482 #ifndef _POSIX_C_SOURCE
483 #include <sys/select.h>
484
485 void _Exit(int) __dead2;
486 int accessx_np(const struct accessx_descriptor *, size_t, int *, uid_t);
487 int acct(const char *);
488 int add_profil(char *, size_t, unsigned long, unsigned int);
489 int async_daemon(void);
490 void *brk(const void *);
491 int chroot(const char *);
492 #if __DARWIN_UNIX03
493 void encrypt(char *, int) __DARWIN_ALIAS(encrypt);
494 #else /* !__DARWIN_UNIX03 */
495 int encrypt(char *, int);
496 #endif /* __DARWIN_UNIX03 */
497 void endusershell(void);
498 int execvP(const char *, const char *, char * const *);
499 char *fflagstostr(unsigned long);
500 int fsync(int);
501 int getdtablesize(void);
502 int getdomainname(char *, int);
503 int getgrouplist(const char *, int, int *, int *);
504 mode_t getmode(const void *, mode_t);
505 int getpagesize(void) __pure2;
506 char *getpass(const char *);
507 int getpeereid(int, uid_t *, gid_t *);
508 int getpgid(pid_t _pid);
509 int getsgroups_np(int *, uuid_t);
510 int getsid(pid_t _pid);
511 char *getusershell(void);
512 int getwgroups_np(int *, uuid_t);
513 int initgroups(const char *, int);
514 int iruserok(unsigned long, int, const char *, const char *);
515 int issetugid(void);
516 char *mkdtemp(char *);
517 int mknod(const char *, mode_t, dev_t);
518 int mkstemp(char *);
519 int mkstemps(char *, int);
520 char *mktemp(char *);
521 int nfssvc(int, void *);
522 int profil(char *, size_t, unsigned long, unsigned int);
523 int pthread_setugid_np(uid_t, gid_t);
524 int pthread_getugid_np( uid_t *, gid_t *);
525 int rcmd(char **, int, const char *, const char *, const char *, int *);
526 int reboot(int);
527 int revoke(const char *);
528 int rresvport(int *);
529 int rresvport_af(int *, int);
530 int ruserok(const char *, int, const char *, const char *);
531 void *sbrk(int);
532 int setdomainname(const char *, int);
533 int setgroups(int, const gid_t *);
534 void sethostid(long);
535 int sethostname(const char *, int);
536 #if __DARWIN_UNIX03
537 void setkey(const char *) __DARWIN_ALIAS(setkey);
538 #else /* !__DARWIN_UNIX03 */
539 int setkey(const char *);
540 #endif /* __DARWIN_UNIX03 */
541 int setlogin(const char *);
542 void *setmode(const char *);
543 int setrgid(gid_t);
544 int setruid(uid_t);
545 int setsgroups_np(int, const uuid_t);
546 void setusershell(void);
547 int setwgroups_np(int, const uuid_t);
548 int strtofflags(char **, unsigned long *, unsigned long *);
549 int swapon(const char *);
550 int syscall(int, ...);
551 int ttyslot(void);
552 int undelete(const char *);
553 int unwhiteout(const char *);
554 void *valloc(size_t);
555
556 extern char *suboptarg; /* getsubopt(3) external variable */
557 int getsubopt(char **, char * const *, char **);
558
559 /* HFS & HFS Plus semantics system calls go here */
560 #ifdef __LP64__
561 int getattrlist(const char*,void*,void*,size_t,unsigned int) __DARWIN_ALIAS(getattrlist);
562 int setattrlist(const char*,void*,void*,size_t,unsigned int) __DARWIN_ALIAS(setattrlist);
563 int exchangedata(const char*,const char*,unsigned int);
564 int checkuseraccess(const char*,uid_t,gid_t*,int,int,unsigned int);
565 int getdirentriesattr(int,void*,void*,size_t,unsigned int*,unsigned int*,unsigned int*,unsigned int);
566 int searchfs(const char*,void*,void*,unsigned int,unsigned int,void*);
567
568 int fsctl(const char *,unsigned int,void*,unsigned int);
569 #else /* __LP64__ */
570 int getattrlist(const char*,void*,void*,size_t,unsigned long) __DARWIN_ALIAS(getattrlist);
571 int setattrlist(const char*,void*,void*,size_t,unsigned long) __DARWIN_ALIAS(setattrlist);
572 int exchangedata(const char*,const char*,unsigned long);
573 int checkuseraccess(const char*,uid_t,gid_t*,int,int,unsigned long);
574 int getdirentriesattr(int,void*,void*,size_t,unsigned long*,unsigned long*,unsigned long*,unsigned long);
575 int searchfs(const char*,void*,void*,unsigned long,unsigned long,void*);
576
577 int fsctl(const char *,unsigned long,void*,unsigned long);
578 #endif /* __LP64__ */
579
580 extern int optreset;
581
582 #endif /* !_POSIX_C_SOURCE */
583 __END_DECLS
584
585 #endif /* !_UNISTD_H_ */