]>
git.saurik.com Git - apple/libc.git/blob - include/unistd.h
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
20 * @APPLE_LICENSE_HEADER_END@
23 * Copyright (c) 1998-1999 Apple Computer, Inc. All Rights Reserved
24 * Copyright (c) 1991, 1993, 1994
25 * The Regents of the University of California. All rights reserved.
27 * Redistribution and use in source and binary forms, with or without
28 * modification, are permitted provided that the following conditions
30 * 1. Redistributions of source code must retain the above copyright
31 * notice, this list of conditions and the following disclaimer.
32 * 2. Redistributions in binary form must reproduce the above copyright
33 * notice, this list of conditions and the following disclaimer in the
34 * documentation and/or other materials provided with the distribution.
35 * 3. All advertising materials mentioning features or use of this software
36 * must display the following acknowledgement:
37 * This product includes software developed by the University of
38 * California, Berkeley and its contributors.
39 * 4. Neither the name of the University nor the names of its contributors
40 * may be used to endorse or promote products derived from this software
41 * without specific prior written permission.
43 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
44 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
45 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
46 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
47 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
48 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
49 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
50 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
51 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
52 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
55 * @(#)unistd.h 8.12 (Berkeley) 4/27/95
57 * Copyright (c) 1998 Apple Compter, Inc.
62 7/14/99 EKN at Apple fixed getdirentriesattr from getdirentryattr
63 3/26/98 CHW at Apple added real interface to searchfs call
64 3/5/98 CHW at Apple added hfs semantic system calls headers
70 #include <sys/cdefs.h>
71 #include <sys/types.h>
72 #include <sys/unistd.h>
74 #define STDIN_FILENO 0 /* standard input file descriptor */
75 #define STDOUT_FILENO 1 /* standard output file descriptor */
76 #define STDERR_FILENO 2 /* standard error file descriptor */
79 #define NULL 0 /* null pointer constant */
82 #define _POSIX_THREADS /* We support pthreads */
85 #define F_ULOCK 0 /* unlock locked section */
86 #define F_LOCK 1 /* lock a section for exclusive use */
87 #define F_TLOCK 2 /* test and lock a section for exclusive use */
88 #define F_TEST 3 /* test a section for locks by other procs */
94 int access
__P((const char *, int));
95 unsigned int alarm
__P((unsigned int));
96 int chdir
__P((const char *));
97 int chown
__P((const char *, uid_t
, gid_t
));
99 size_t confstr
__P((int, char *, size_t));
101 int dup2
__P((int, int));
102 int execl
__P((const char *, const char *, ...));
103 int execle
__P((const char *, const char *, ...));
104 int execlp
__P((const char *, const char *, ...));
105 int execv
__P((const char *, char * const *));
106 int execve
__P((const char *, char * const *, char * const *));
107 int execvp
__P((const char *, char * const *));
108 pid_t fork
__P((void));
109 long fpathconf
__P((int, int));
110 char *getcwd
__P((char *, size_t));
111 gid_t getegid
__P((void));
112 uid_t geteuid
__P((void));
113 gid_t getgid
__P((void));
114 int getgroups
__P((int, gid_t
[]));
115 char *getlogin
__P((void));
116 pid_t getpgrp
__P((void));
117 pid_t getpid
__P((void));
118 pid_t getppid
__P((void));
119 uid_t getuid
__P((void));
120 int isatty
__P((int));
121 int link
__P((const char *, const char *));
122 off_t lseek
__P((int, off_t
, int));
123 long pathconf
__P((const char *, int));
124 int pause
__P((void));
125 int pipe
__P((int *));
126 ssize_t read
__P((int, void *, size_t));
127 int rmdir
__P((const char *));
128 int setgid
__P((gid_t
));
129 int setpgid
__P((pid_t
, pid_t
));
130 pid_t setsid
__P((void));
131 int setuid
__P((uid_t
));
132 unsigned int sleep
__P((unsigned int));
133 long sysconf
__P((int));
134 pid_t tcgetpgrp
__P((int));
135 int tcsetpgrp
__P((int, pid_t
));
136 char *ttyname
__P((int));
137 int unlink
__P((const char *));
138 ssize_t write
__P((int, const void *, size_t));
140 extern char *optarg
; /* getopt(3) external variables */
141 extern int optind
, opterr
, optopt
, optreset
;
142 int getopt
__P((int, char * const [], const char *));
144 #ifndef _POSIX_SOURCE
146 struct timeval
; /* select(2) */
148 int acct
__P((const char *));
149 int async_daemon
__P((void));
150 char *brk
__P((const char *));
151 int chroot
__P((const char *));
152 char *crypt
__P((const char *, const char *));
153 int des_cipher
__P((const char *, char *, long, int));
154 int des_setkey
__P((const char *key
));
155 int encrypt
__P((char *, int));
156 void endusershell
__P((void));
157 int exect
__P((const char *, char * const *, char * const *));
158 int fchdir
__P((int));
159 int fchown
__P((int, int, int));
160 char *fflagstostr
__P((u_long
));
161 int fsync
__P((int));
162 int ftruncate
__P((int, off_t
));
163 int getdtablesize
__P((void));
164 int getgrouplist
__P((const char *, int, int *, int *));
165 long gethostid
__P((void));
166 int gethostname
__P((char *, int));
167 mode_t getmode
__P((const void *, mode_t
));
169 getpagesize
__P((void));
170 char *getpass
__P((const char *));
171 int getpgid
__P((pid_t _pid
));
172 int getsid
__P((pid_t _pid
));
173 char *getusershell
__P((void));
174 char *getwd
__P((char *)); /* obsoleted by getcwd() */
175 int initgroups
__P((const char *, int));
176 int iruserok
__P((unsigned long, int, const char *, const char *));
177 int issetugid
__P((void));
178 char *mkdtemp
__P((char *));
179 int mknod
__P((const char *, mode_t
, dev_t
));
180 int mkstemp
__P((char *));
181 int mkstemps
__P((char *, int));
182 char *mktemp
__P((char *));
183 int nfssvc
__P((int, void *));
185 ssize_t pread
__P((int, void *, size_t, off_t
));
187 void psignal
__P((unsigned int, const char *));
188 extern __const
char *__const sys_siglist
[];
192 int profil
__P((char *, int, int, int));
193 ssize_t pwrite
__P((int, const void *, size_t, off_t
));
194 int rcmd
__P((char **, int, const char *,
195 const char *, const char *, int *));
196 char *re_comp
__P((const char *));
197 int re_exec
__P((const char *));
198 int readlink
__P((const char *, char *, int));
199 int reboot
__P((int));
200 int revoke
__P((const char *));
201 int rresvport
__P((int *));
202 int ruserok
__P((const char *, int, const char *, const char *));
203 char *sbrk
__P((int));
204 int select
__P((int, fd_set
*, fd_set
*, fd_set
*, struct timeval
*));
205 int setegid
__P((gid_t
));
206 int seteuid
__P((uid_t
));
207 int setgroups
__P((int, const gid_t
*));
208 void sethostid
__P((long));
209 int sethostname
__P((const char *, int));
210 int setkey
__P((const char *));
211 int setlogin
__P((const char *));
212 void *setmode
__P((const char *));
213 int setpgrp
__P((pid_t pid
, pid_t pgrp
)); /* obsoleted by setpgid() */
214 int setregid
__P((gid_t
, gid_t
));
215 int setreuid
__P((uid_t
, uid_t
));
216 int setrgid
__P((gid_t
));
217 int setruid
__P((uid_t
));
218 void setusershell
__P((void));
219 int strtofflags
__P((char **, u_long
*, u_long
*));
220 int swapon
__P((const char *));
221 int symlink
__P((const char *, const char *));
222 void sync
__P((void));
223 int syscall
__P((int, ...));
224 int truncate
__P((const char *, off_t
));
225 int ttyslot
__P((void));
226 unsigned int ualarm
__P((unsigned int, unsigned int));
227 int unwhiteout
__P((const char *));
228 int usleep
__P((unsigned int));
229 void *valloc
__P((size_t));
230 pid_t vfork
__P((void));
232 extern char *suboptarg
; /* getsubopt(3) external variable */
233 int getsubopt
__P((char **, char * const *, char **));
235 /* HFS & HFS Plus semantics system calls go here */
236 int getattrlist
__P((const char*,void*,void*,size_t,unsigned long));
237 int setattrlist
__P((const char*,void*,void*,size_t,unsigned long));
238 int exchangedata
__P((const char*,const char*,unsigned long));
239 int checkuseraccess
__P((const char*,uid_t
,gid_t
*,int,int,unsigned long));
240 int getdirentriesattr
__P((int,void*,void*,size_t,unsigned long*,unsigned long*,unsigned long*,unsigned long));
241 int searchfs
__P((const char*,void*,void*,unsigned long,unsigned long,void*));
243 int fsctl
__P((const char *,unsigned long,void*,unsigned long));
246 #endif /* !_POSIX_SOURCE */
249 #endif /* !_UNISTD_H_ */