add a missing section header table index conversion
[tangerine.git] / compiler / clib / include / unistd.h
blob9f2aa5074c84de3e8247c694bb8ec97811ca25f4
1 #ifndef _UNISTD_H_
2 #define _UNISTD_H_
4 /*
5 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
6 $Id$
8 Desc: POSIX header file unistd.h
9 Lang: english
11 #include <sys/_types.h>
12 #include <sys/types.h>
15 * What version of POSIX things do we implement. We must define this before
16 * including <sys/cdefs.h>
18 #define _POSIX_VERSION 200112L
19 #define _POSIX2_VERSION 200112L
20 #define _XOPEN_VERSION 600
22 #include <sys/cdefs.h>
25 POSIX options and option groups:
26 These inform the program what POSIX options this system implements. In
27 general we don't implement any of them, when we do, the value can be
28 changed.
30 Valid values are:
31 -1 unimplemented
32 0 implemented, but must check at run time
33 >0 implemented always
36 #define _POSIX_ADVISORY_INFO -1
37 #define _POSIX_ASYNCHRONOUS_IO -1
38 #define _POSIX_BARRIERS -1
39 #define _POSIX_CHOWN_RESTRICTED 0
40 #define _POSIX_CLOCK_SELECTION -1
41 #define _POSIX_CPUTIME -1
42 #define _POSIX_FSYNC -1
43 #define _POSIX_IPV6 -1
44 #define _POSIX_JOB_CONTROL 0
45 #define _POSIX_MAPPED_FILES -1
46 #define _POSIX_MEMLOCK -1
47 #define _POSIX_MEMLOCK_RANGE -1
48 #define _POSIX_MEMORY_PROTECTION -1
49 #define _POSIX_MESSAGE_PASSING -1
50 #define _POSIX_MONOTONIC_CLOCK -1
51 #define _POSIX_NO_TRUNC 1
52 #define _POSIX_PRIORITIZED_IO -1
53 #define _POSIX_PRIORITY_SCHEDULING -1
54 #define _POSIX_RAW_SOCKETS -1
55 #define _POSIX_READER_WRITER_LOCKS -1
56 #define _POSIX_REALTIME_SIGNALS -1
57 #define _POSIX_REGEXP 0
58 #define _POSIX_SAVED_IDS 1 /* XXX: MUST IMPLEMENT */
59 #define _POSIX_SEMAPHORES -1
60 #define _POSIX_SHARED_MEMORY_OBJECTS -1
61 #define _POSIX_SHELL 1 /* XXX: MUST IMPLEMENT */
62 #define _POSIX_SPAWN -1
63 #define _POSIX_SPIN_LOCKS -1
64 #define _POSIX_SPORADIC_SERVER -1
65 #define _POSIX_SYNCHRONIZED_IO -1
66 #define _POSIX_THREAD_ATTR_STACKADDR -1
67 #define _POSIX_THREAD_ATTR_STACKSIZE -1
68 #define _POSIX_THREAD_CPUTIME -1
69 #define _POSIX_THREAD_PRIO_INHERIT -1
70 #define _POSIX_THREAD_PRIO_PROTECT -1
71 #define _POSIX_THREAD_PRIORITY_SCHEDULING -1
72 #define _POSIX_THREAD_PROCESS_SHARED -1
73 #define _POSIX_THREAD_SAFE_FUNCTIONS -1
74 #define _POSIX_THREAD_SPORADIC_SERVER -1
75 #define _POSIX_THREADS -1
76 #define _POSIX_TIMEOUTS -1
77 #define _POSIX_TIMERS -1
78 #define _POSIX_TRACE -1
79 #define _POSIX_TRACE_EVENT_FILTER -1
80 #define _POSIX_TRACE_INHERIT -1
81 #define _POSIX_TRACE_LOG -1
82 #define _POSIX_TYPED_MEMORY_OBJECTS -1
83 #define _POSIX_VDISABLE 0xff
84 #define _POSIX2_C_BIND 200112L
85 #define _POSIX2_C_DEV -1 /* need c99 utility */
86 #define _POSIX2_CHAR_TERM -1
87 #define _POSIX2_FORT_DEV -1
88 #define _POSIX2_FORT_RUN -1
89 #define _POSIX2_LOCALEDEF -1
90 #define _POSIX2_PBS -1
91 #define _POSIX2_PBS_ACCOUNTING -1
92 #define _POSIX2_PBS_CHECKPOINT -1
93 #define _POSIX2_PBS_LOCATE -1
94 #define _POSIX2_PBS_MESSAGE -1
95 #define _POSIX2_PBS_TRACK -1
96 #define _POSIX2_SW_DEV -1 /* XXX */
97 #define _POSIX2_UPE 200112L
99 #define _V6_ILP32_OFF32 0
100 #define _V6_ILP32_OFFBIG -1
101 #define _V6_LP64_OFF64 -1
102 #define _V6_LPBIG_OFFBIG -1
104 #if __XSI_VISIBLE
105 #define _XOPEN_CRYPT -1
106 #define _XOPEN_ENH_I18N -1
107 #define _XOPEN_LEGACY -1
108 #define _XOPEN_REALTIME -1
109 #define _XOPEN_REALTIME_THREADS -1
110 #define _XOPEN_SHM -1
111 #define _XOPEN_STREAMS -1
112 #define _XOPEN_UNIX -1
113 #endif
115 #define __need_NULL
116 #define __need_size_t
117 #include <stddef.h>
119 #ifndef __AROS_GID_T_DECLARED
120 #define __AROS_GID_T_DECLARED
121 typedef __gid_t gid_t;
122 #endif
124 #ifndef __AROS_INTPTR_T_DECLARED
125 #define __AROS_INTPTR_T_DECLARED
126 typedef __intptr_t intptr_t;
127 #endif
129 #ifndef __AROS_OFF_T_DECLARED
130 #define __AROS_OFF_T_DECLARED
131 typedef __off_t off_t;
132 #endif
134 #ifndef __AROS_PID_T_DECLARED
135 #define __AROS_PID_T_DECLARED
136 typedef __pid_t pid_t;
137 #endif
139 #ifndef __AROS_SSIZE_T_DECLARED
140 #define __AROS_SSIZE_T_DECLARED
141 typedef __ssize_t ssize_t;
142 #endif
144 #ifndef __AROS_UID_T_DECLARED
145 #define __AROS_UID_T_DECLARED
146 typedef __uid_t uid_t;
147 #endif
149 #ifndef __AROS_USECONDS_T_DECLARED
150 #define __AROS_USECONDS_T_DECLARED
151 typedef __useconds_t useconds_t;
152 #endif
155 Values for the second argument to access.
156 These may be OR'd together.
158 #define R_OK 4 /* Test for read permission. */
159 #define W_OK 2 /* Test for write permission. */
160 #define X_OK 1 /* Test for execute permission. */
161 #define F_OK 0 /* Test for existence. */
164 XXX Arguments for confstr()
167 #define SEEK_SET 0 /* standard input file descriptor */
168 #define SEEK_CUR 1 /* standard output file descriptor */
169 #define SEEK_END 2 /* standard error file descriptor */
171 #if __XSI_VISIBLE || __POSIX_VISIBLE >= 200112
172 #define F_LOCK 0
173 #define F_TEST 1
174 #define F_TLOCK 2
175 #define F_ULOCK 3
176 #endif
179 XXX Arguments for pathconf()
180 XXX Arguments for sysconf()
183 #define STDIN_FILENO 0
184 #define STDOUT_FILENO 1
185 #define STDERR_FILENO 2
187 __BEGIN_DECLS
189 /* Prototypes */
190 int access(const char *path, int mode);
191 /* NOTIMPL unsigned alarm(unsigned); */
192 int chdir(const char *path);
193 int chown(const char *path, uid_t owner, gid_t group);
194 int close(int fd);
195 int dup(int oldfd);
196 int dup2(int oldfd, int newfd);
197 int execl(const char *path, const char *arg, ...);
198 /* NOTIMPL int execle(const char *path, const char *arg, ...); */
199 /* NOTIMPL int execlp(const char *path, const char *arg, ...); */
200 /* NOTIMPL int execv(const char *path, char *const argv[]); */
201 /* NOTIMPL int execve(const char *path, char *const argv[]); */
202 int execvp(const char *path, char *const argv[]);
203 void _exit(int) __noreturn;
204 /* NOTIMPL long fpathconf(int fd, int name); */
205 char *getcwd(char *buf, size_t size);
206 gid_t getegid(void);
207 uid_t geteuid(void);
208 gid_t getgid(void);
209 int getgroups(int gidsetlen, gid_t *gidset);
210 /* NOTIMPL char *getlogin(void); */
211 pid_t getpgrp(void);
212 pid_t getpid(void);
213 pid_t getppid(void);
214 uid_t getuid(void);
215 int isatty(int fd);
216 int link(const char *name1, const char *name2);
217 off_t lseek(int filedes, off_t offset, int whence);
218 /* NOTIMPL long pathconf(const char *path, int name); */
219 /* NOTIMPL int pause(void); */
220 int pipe(int filedes[2]);
221 ssize_t read(int d, void *buf, size_t nbytes);
222 int rmdir(const char *path);
223 int setgid(gid_t gid);
224 /* NOTIMPL int setpgid(pid_t pid, pid_t pgrp); */
225 /* NOTIMPL pid_t setsid(void); */
226 int setuid(uid_t uid);
227 unsigned sleep(unsigned);
228 /* NOTIMPL long sysconf(int name); */
229 /* NOTIMPL pid_t tcgetpgrp(int fd); */
230 /* NOTIMPL int tcsetpgrp(int fd, pid_t pgrp_id); */
231 /* NOTIMPL char *ttyname(int fd); */
232 /* NOTIMPL int ttyname_r(int fd, char *buf, size_t len); */
233 int unlink(const char *path);
234 ssize_t write(int fd, const void *buf, size_t nbytes);
236 #if __POSIX_VISIBLE >= 199209 || __XSI_VISIBLE
237 /* NOTIMPL size_t confstr(int name, char *buf, size_t len); */
238 int getopt(int argc, char * const argv[], const char *optstring);
240 extern char *optarg;
241 extern int optind, opterr, optopt;
242 #endif
244 #if __POSIX_VISIBLE >= 199506 || __XSI_VISIBLE
245 int fsync(int fd);
246 int ftruncate(int fd, off_t length);
247 #endif
249 #if __POSIX_VISIBLE >= 199506
250 /* NOTIMPL int getlogin_r(char *name, int len); */
251 #endif
253 #if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE
254 int fchown(int fd, uid_t owner, gid_t group);
255 ssize_t readlink(const char * restrict path, char * restrict buf, int bufsize);
256 #endif
258 #if __POSIX_VISIBLE >= 200112
259 /* NOTIMPL int gethostname(char *name, size_t namelen); */
260 /* NOTIMPL int setegid(gid_t egid); */
261 /* NOTIMPL int seteuid(uid_t euid); */
262 #endif
264 #if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE >= 402 || __BSD_VISIBLE
265 int symlink(const char *name1, const char *name2);
266 #endif
268 #if __XSI_VISIBLE
269 /* NOTIMPL char *crypt(const char *key, const char *salt); */
270 /* NOTIMPL char *ctermid(char *buf); */
271 /* NOTIMPL void encrypt(char block[64], int flag); */
272 /* NOTIMPL int fchdir(int fd); */
273 /* NOTIMPL long gethostid(void); */
274 /* NOTIMPL pid_t getpgid(pid_t); */
275 /* NOTIMPL pid_t getsid(pid_t pid); */
276 /* NOTIMPL int lchown(const char *path, uid_t owner, gid_t group); */
277 /* NOTIMPL int lockf(int filedes, int function, off_t size); */
278 /* NOTIMPL int nice(int incr); */
279 /* NOTIMPL ssize_t pread(int d, void *buf, size_t nbytes, off_t offset); */
280 /* NOTIMPL ssize_t pwrite(int d, const void *buf, size_t nbytes, off_t offset); */
281 /* NOTIMPL int setpgrp(pid_t pid, pid_t pgrp); */
282 /* NOTIMPL int setregid(gid_t rgid, gid_t egid); */
283 /* NOTIMPL int setreuid(uid_t ruid, uid_t euid); */
284 void swab(const void * restrict src, void * restrict dst, size_t len);
285 /* NOTIMPL void sync(void); */
286 int truncate(const char *path, off_t length);
287 /* NOTIMPL useconds_t ualarm(useconds_t microseconds, useconds_t interval); */
288 /* NOTIMPL int usleep(useconds_t microseconds); */
289 /* NOTIMPL pid_t vfork(void); */
290 #endif
292 #if __POSIX_VERSION >= 200112
293 /* NOTIMPL int fdatasync(int fd); */
294 #endif
296 __END_DECLS
298 #endif /* _UNISTD_H_ */