]> git.saurik.com Git - apple/libc.git/blame - include/unistd.h
Libc-320.1.3.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
71#include <sys/cdefs.h>
72#include <sys/types.h>
73#include <sys/unistd.h>
74
75#define STDIN_FILENO 0 /* standard input file descriptor */
76#define STDOUT_FILENO 1 /* standard output file descriptor */
77#define STDERR_FILENO 2 /* standard error file descriptor */
78
79#ifndef NULL
80#define NULL 0 /* null pointer constant */
81#endif
82
83#define _POSIX_THREADS /* We support pthreads */
84
85#ifndef _POSIX_SOURCE
86#define F_ULOCK 0 /* unlock locked section */
87#define F_LOCK 1 /* lock a section for exclusive use */
88#define F_TLOCK 2 /* test and lock a section for exclusive use */
89#define F_TEST 3 /* test a section for locks by other procs */
90#endif
91
9385eb3d
A
92/* configurable system variables */
93#define _SC_ARG_MAX 1
94#define _SC_CHILD_MAX 2
95#define _SC_CLK_TCK 3
96#define _SC_NGROUPS_MAX 4
97#define _SC_OPEN_MAX 5
98#define _SC_JOB_CONTROL 6
99#define _SC_SAVED_IDS 7
100#define _SC_VERSION 8
101#define _SC_BC_BASE_MAX 9
102#define _SC_BC_DIM_MAX 10
103#define _SC_BC_SCALE_MAX 11
104#define _SC_BC_STRING_MAX 12
105#define _SC_COLL_WEIGHTS_MAX 13
106#define _SC_EXPR_NEST_MAX 14
107#define _SC_LINE_MAX 15
108#define _SC_RE_DUP_MAX 16
109#define _SC_2_VERSION 17
110#define _SC_2_C_BIND 18
111#define _SC_2_C_DEV 19
112#define _SC_2_CHAR_TERM 20
113#define _SC_2_FORT_DEV 21
114#define _SC_2_FORT_RUN 22
115#define _SC_2_LOCALEDEF 23
116#define _SC_2_SW_DEV 24
117#define _SC_2_UPE 25
118#define _SC_STREAM_MAX 26
119#define _SC_TZNAME_MAX 27
120/* POSIX.1B sysconf options for async IO*/
121#define _SC_ASYNCHRONOUS_IO 28
122#define _SC_PAGESIZE 29
123#define _SC_AIO_LISTIO_MAX 42
124#define _SC_AIO_MAX 43
125#define _SC_AIO_PRIO_DELTA_MAX 44
126
5b2abdfb 127__BEGIN_DECLS
9385eb3d
A
128
129void _Exit(int) __dead2;
130void _exit(int) __dead2;
131int access(const char *, int);
132unsigned int alarm(unsigned int);
133int chdir(const char *);
134int chown(const char *, uid_t, gid_t);
135int close(int);
136size_t confstr(int, char *, size_t);
137int dup(int);
138int dup2(int, int);
139int execl(const char *, const char *, ...);
140int execle(const char *, const char *, ...);
141int execlp(const char *, const char *, ...);
142int execv(const char *, char * const *);
143int execve(const char *, char * const *, char * const *);
144int execvp(const char *, char * const *);
145pid_t fork(void);
146long fpathconf(int, int);
147char *getcwd(char *, size_t);
148int getdomainname(char *, int);
149gid_t getegid(void);
150uid_t geteuid(void);
151gid_t getgid(void);
152int getgroups(int, gid_t []);
153char *getlogin(void);
154int getlogin_r(char *, int);
155pid_t getpgrp(void);
156pid_t getpid(void);
157pid_t getppid(void);
158uid_t getuid(void);
159int isatty(int);
160int link(const char *, const char *);
161off_t lseek(int, off_t, int);
162long pathconf(const char *, int);
163int pause(void);
164int pipe(int *);
165ssize_t read(int, void *, size_t);
166int rmdir(const char *);
167int setdomainname(const char *, int);
168int setgid(gid_t);
169int setpgid(pid_t, pid_t);
170pid_t setsid(void);
171int setuid(uid_t);
172unsigned int sleep(unsigned int);
173long sysconf(int);
174pid_t tcgetpgrp(int);
175int tcsetpgrp(int, pid_t);
176char *ttyname(int);
177char *ttyname_r(int, char *, size_t);
178int unlink(const char *);
179ssize_t write(int, const void *, size_t);
5b2abdfb
A
180
181extern char *optarg; /* getopt(3) external variables */
182extern int optind, opterr, optopt, optreset;
9385eb3d 183int getopt(int, char * const [], const char *);
5b2abdfb
A
184
185#ifndef _POSIX_SOURCE
186#ifdef __STDC__
9385eb3d 187struct timespec; /* pselect(3) */
5b2abdfb
A
188struct timeval; /* select(2) */
189#endif
9385eb3d
A
190int acct(const char *);
191int async_daemon(void);
192char *brk(const char *);
193int chroot(const char *);
194char *crypt(const char *, const char *);
195int des_cipher(const char *, char *, long, int);
196int des_setkey(const char *key);
197int encrypt(char *, int);
198void endusershell(void);
199int fchdir(int);
200int fchown(int, int, int);
201char *fflagstostr(u_long);
202int fsync(int);
203int ftruncate(int, off_t);
204int getdtablesize(void);
205int getgrouplist(const char *, int, int *, int *);
206long gethostid(void);
207int gethostname(char *, int);
208mode_t getmode(const void *, mode_t);
209int getpagesize(void) __pure2;
210char *getpass(const char *);
211int getpgid(pid_t _pid);
212int getsid(pid_t _pid);
213char *getusershell(void);
214char *getwd(char *); /* obsoleted by getcwd() */
215int lockf(int, int, off_t);
216int initgroups(const char *, int);
217int iruserok(unsigned long, int, const char *, const char *);
218int issetugid(void);
219char *mkdtemp(char *);
220int mknod(const char *, mode_t, dev_t);
221int mkstemp(char *);
222int mkstemps(char *, int);
223char *mktemp(char *);
224int nfssvc(int, void *);
225int nice(int);
226ssize_t pread(int, void *, size_t, off_t);
5b2abdfb 227#if 0
9385eb3d 228void psignal(unsigned int, const char *);
5b2abdfb
A
229extern __const char *__const sys_siglist[];
230#else
231#include <signal.h>
232#endif
9385eb3d
A
233int profil(char *, int, int, int);
234#ifndef __MWERKS__
235int pselect(int, fd_set *, fd_set *, fd_set *,
236 const struct timespec *, const sigset_t *);
237#endif /* ! __MWERKS__ */
238ssize_t pwrite(int, const void *, size_t, off_t);
239int rcmd(char **, int, const char *, const char *, const char *, int *);
240int readlink(const char *, char *, int);
241int reboot(int);
242int revoke(const char *);
243int rresvport(int *);
244int rresvport_af(int *, int);
245int ruserok(const char *, int, const char *, const char *);
246char *sbrk(int);
247int select(int, fd_set *, fd_set *, fd_set *, struct timeval *);
248int setegid(gid_t);
249int seteuid(uid_t);
250int setgroups(int, const gid_t *);
251void sethostid(long);
252int sethostname(const char *, int);
253int setkey(const char *);
254int setlogin(const char *);
255void *setmode(const char *);
256int setpgrp(pid_t pid, pid_t pgrp); /* obsoleted by setpgid() */
257int setregid(gid_t, gid_t);
258int setreuid(uid_t, uid_t);
259int setrgid(gid_t);
260int setruid(uid_t);
261void setusershell(void);
262int strtofflags(char **, u_long *, u_long *);
263int swapon(const char *);
264int symlink(const char *, const char *);
265void sync(void);
266int syscall(int, ...);
267int truncate(const char *, off_t);
268int ttyslot(void);
269unsigned int ualarm(unsigned int, unsigned int);
270int undelete(const char *);
271int unwhiteout(const char *);
272int usleep(unsigned int);
273void *valloc(size_t);
274pid_t vfork(void);
5b2abdfb
A
275
276extern char *suboptarg; /* getsubopt(3) external variable */
9385eb3d 277int getsubopt(char **, char * const *, char **);
5b2abdfb
A
278
279/* HFS & HFS Plus semantics system calls go here */
9385eb3d
A
280int getattrlist(const char*,void*,void*,size_t,unsigned long);
281int setattrlist(const char*,void*,void*,size_t,unsigned long);
282int exchangedata(const char*,const char*,unsigned long);
283int checkuseraccess(const char*,uid_t,gid_t*,int,int,unsigned long);
284int getdirentriesattr(int,void*,void*,size_t,unsigned long*,unsigned long*,unsigned long*,unsigned long);
285int searchfs(const char*,void*,void*,unsigned long,unsigned long,void*);
286
287int fsctl(const char *,unsigned long,void*,unsigned long);
5b2abdfb
A
288
289
290#endif /* !_POSIX_SOURCE */
291__END_DECLS
292
293#endif /* !_UNISTD_H_ */