1 | /* unistd.h (emx+gcc) */
|
---|
2 |
|
---|
3 | #ifndef _EMXUNISTD_H
|
---|
4 | #define _EMXUNISTD_H
|
---|
5 |
|
---|
6 | #ifndef CRTWRAP
|
---|
7 | #define CRTWRAP(a) emx_##a
|
---|
8 | #endif
|
---|
9 |
|
---|
10 | #if defined (__cplusplus)
|
---|
11 | extern "C" {
|
---|
12 | #endif
|
---|
13 |
|
---|
14 | #if defined (_POSIX_C_SOURCE) && !defined (_POSIX_SOURCE)
|
---|
15 | #define _POSIX_SOURCE
|
---|
16 | #endif
|
---|
17 |
|
---|
18 | #if !defined (_SIZE_T)
|
---|
19 | #define _SIZE_T
|
---|
20 | typedef unsigned long size_t;
|
---|
21 | #endif
|
---|
22 |
|
---|
23 | #if !defined (_SSIZE_T)
|
---|
24 | #define _SSIZE_T
|
---|
25 | typedef int ssize_t;
|
---|
26 | #endif
|
---|
27 |
|
---|
28 | #if !defined (NULL)
|
---|
29 | #if defined (__cplusplus)
|
---|
30 | #define NULL 0
|
---|
31 | #else
|
---|
32 | #define NULL ((void *)0)
|
---|
33 | #endif
|
---|
34 | #endif
|
---|
35 |
|
---|
36 | #if !defined (STDIN_FILENO)
|
---|
37 | #define STDIN_FILENO 0
|
---|
38 | #define STDOUT_FILENO 1
|
---|
39 | #define STDERR_FILENO 2
|
---|
40 | #endif
|
---|
41 |
|
---|
42 | #if !defined (F_OK)
|
---|
43 | #define F_OK 0
|
---|
44 | #define X_OK 1
|
---|
45 | #define W_OK 2
|
---|
46 | #define R_OK 4
|
---|
47 | #endif
|
---|
48 |
|
---|
49 | #if !defined (SEEK_SET)
|
---|
50 | #define SEEK_SET 0
|
---|
51 | #define SEEK_CUR 1
|
---|
52 | #define SEEK_END 2
|
---|
53 | #endif
|
---|
54 |
|
---|
55 | #if !defined (_PC_LINK_MAX)
|
---|
56 | #define _PC_LINK_MAX 1
|
---|
57 | #define _PC_MAX_CANON 2
|
---|
58 | #define _PC_MAX_INPUT 3
|
---|
59 | #define _PC_NAME_MAX 4
|
---|
60 | #define _PC_PATH_MAX 5
|
---|
61 | #define _PC_PIPE_BUF 6
|
---|
62 | #define _PC_CHOWN_RESTRICTED 7
|
---|
63 | #define _PC_NO_TRUNC 8
|
---|
64 | #define _PC_VDISABLE 9
|
---|
65 | #endif
|
---|
66 |
|
---|
67 | #if !defined (_SC_ARG_MAX)
|
---|
68 | #define _SC_ARG_MAX 1
|
---|
69 | #define _SC_CHILD_MAX 2
|
---|
70 | #define _SC_CLK_TCK 3
|
---|
71 | #define _SC_NGROUPS_MAX 4
|
---|
72 | #define _SC_OPEN_MAX 5
|
---|
73 | #define _SC_STREAM_MAX 6
|
---|
74 | #define _SC_TZNAME_MAX 7
|
---|
75 | #define _SC_JOB_CONTROL 8
|
---|
76 | #define _SC_SAVED_IDS 9
|
---|
77 | #define _SC_VERSION 10
|
---|
78 | #endif
|
---|
79 |
|
---|
80 | #if !defined (_POSIX_VERSION)
|
---|
81 | #define _POSIX_VERSION 199009L
|
---|
82 | #endif
|
---|
83 |
|
---|
84 | #define access CRTWRAP(access)
|
---|
85 | #define alarm CRTWRAP(alarm)
|
---|
86 | #define chdir CRTWRAP(chdir)
|
---|
87 | #define close CRTWRAP(close)
|
---|
88 | #define cuserid CRTWRAP(cuserid)
|
---|
89 | #define dup CRTWRAP(dup)
|
---|
90 | #define dup2 CRTWRAP(dup2)
|
---|
91 | #define execl CRTWRAP(execl)
|
---|
92 | #define execle CRTWRAP(execle)
|
---|
93 | #define execlp CRTWRAP(execlp)
|
---|
94 | #define execv CRTWRAP(execv)
|
---|
95 | #define execve CRTWRAP(execve)
|
---|
96 | #define execvp CRTWRAP(execvp)
|
---|
97 | #define exit CRTWRAP(exit)
|
---|
98 | #define fork CRTWRAP(fork)
|
---|
99 | #define fpathconf CRTWRAP(fpathconf)
|
---|
100 | #define getcwd CRTWRAP(getcwd)
|
---|
101 | #define getegid CRTWRAP(getegid)
|
---|
102 | #define geteuid CRTWRAP(geteuid)
|
---|
103 | #define getgid CRTWRAP(getgid)
|
---|
104 | #define getgroups CRTWRAP(getgroups)
|
---|
105 | #define getlogin CRTWRAP(getlogin)
|
---|
106 | #define getpgrp CRTWRAP(getpgrp)
|
---|
107 | #define getpid CRTWRAP(getpid)
|
---|
108 | #define getppid CRTWRAP(getppid)
|
---|
109 | #define getuid CRTWRAP(getuid)
|
---|
110 | #define isatty CRTWRAP(isatty)
|
---|
111 | #define lseek CRTWRAP(lseek)
|
---|
112 | #define pathconf CRTWRAP(pathconf)
|
---|
113 | #define pause CRTWRAP(pause)
|
---|
114 | #define pipe CRTWRAP(pipe)
|
---|
115 | #define read CRTWRAP(read)
|
---|
116 | #define rmdir CRTWRAP(rmdir)
|
---|
117 | #define setgid CRTWRAP(setgid)
|
---|
118 | #define setpgid CRTWRAP(setpgid)
|
---|
119 | #define setsid CRTWRAP(setsid)
|
---|
120 | #define setuid CRTWRAP(setuid)
|
---|
121 | #define sleep CRTWRAP(sleep)
|
---|
122 | #define sysconf CRTWRAP(sysconf)
|
---|
123 | #define tcgetpgrp CRTWRAP(tcgetpgrp)
|
---|
124 | #define tcsetpgrp CRTWRAP(tcsetpgrp)
|
---|
125 | #define ttyname CRTWRAP(ttyname)
|
---|
126 | #define unlink CRTWRAP(unlink)
|
---|
127 | #define write CRTWRAP(write)
|
---|
128 |
|
---|
129 | int access (__const__ char *, int);
|
---|
130 | unsigned alarm (unsigned);
|
---|
131 | int chdir (__const__ char *);
|
---|
132 | /* chown() */
|
---|
133 | int close (int);
|
---|
134 | /* ctermid() */
|
---|
135 | char *cuserid (char *);
|
---|
136 | int dup (int);
|
---|
137 | int dup2 (int, int);
|
---|
138 | int execl (__const__ char *, __const__ char *, ...);
|
---|
139 | int execle (__const__ char *, __const__ char *, ...);
|
---|
140 | int execlp (__const__ char *, __const__ char *, ...);
|
---|
141 | int execv (__const__ char *, char * __const__ *);
|
---|
142 | int execve (__const__ char *, char * __const__ *, char * __const__ *);
|
---|
143 | int execvp (__const__ char *, char * __const__ *);
|
---|
144 | void _exit (int) __attribute__ ((__noreturn__));
|
---|
145 | int fork (void);
|
---|
146 | long fpathconf (int, int);
|
---|
147 | char *getcwd (char *, size_t);
|
---|
148 | int getegid (void); /* gid_t getegid (void); */
|
---|
149 | int geteuid (void); /* uid_t geteuid (void); */
|
---|
150 | int getgid (void); /* gid_t getgid (void); */
|
---|
151 | int getgroups (int, int *); /* int getgroups (int, gid_t *); */
|
---|
152 | char *getlogin (void);
|
---|
153 | int getpgrp (void); /* pid_t getpgrp (void); */
|
---|
154 | int getpid (void); /* pid_t getpid (void); */
|
---|
155 | int getppid (void); /* pid_t getppid (void); */
|
---|
156 | int getuid (void); /* uid_t getuid (void); */
|
---|
157 | int isatty (int);
|
---|
158 | /* link() */
|
---|
159 | long lseek (int, long, int);
|
---|
160 | long pathconf (__const__ char *, int);
|
---|
161 | int pause (void);
|
---|
162 | int pipe (int *);
|
---|
163 | int read (int, void *, size_t);
|
---|
164 | int rmdir (__const__ char *);
|
---|
165 | int setgid (int); /* int setsid (gid_t); */
|
---|
166 | int setpgid (int, int); /* int setpgid (gid_t, gid_t); */
|
---|
167 | int setsid (void); /* pid_t setsid (void); */
|
---|
168 | int setuid (int); /* setuid (uid_t); */
|
---|
169 | unsigned sleep (unsigned);
|
---|
170 | long sysconf (int);
|
---|
171 | int tcgetpgrp (int); /* pid_t tcgetpgrp (int); */
|
---|
172 | int tcsetpgrp (int, int); /* int tcsetpgrp (int, pid_t) */
|
---|
173 | char *ttyname (int);
|
---|
174 | int unlink (__const__ char *);
|
---|
175 | int write (int, __const__ void *, size_t);
|
---|
176 |
|
---|
177 |
|
---|
178 | #if !defined (_POSIX_SOURCE)
|
---|
179 |
|
---|
180 | #define brk CRTWRAP(brk)
|
---|
181 | #define getpass CRTWRAP(getpass)
|
---|
182 | #define _getpass1 CRTWRAP(_getpass1)
|
---|
183 | #define _getpass2 CRTWRAP(_getpass2)
|
---|
184 | #define mkstemp CRTWRAP(mkstemp)
|
---|
185 | #define mktemp CRTWRAP(mktemp)
|
---|
186 | #define profil CRTWRAP(profil)
|
---|
187 | #define sbrk CRTWRAP(sbrk)
|
---|
188 |
|
---|
189 | void *brk (void *);
|
---|
190 | char *getpass (__const__ char *);
|
---|
191 | char *_getpass1 (__const__ char *);
|
---|
192 | char *_getpass2 (__const__ char *, int);
|
---|
193 | int mkstemp (char *);
|
---|
194 | char *mktemp (char *);
|
---|
195 | int profil (void *, unsigned, unsigned, unsigned);
|
---|
196 | void *sbrk (int);
|
---|
197 |
|
---|
198 | #endif
|
---|
199 |
|
---|
200 |
|
---|
201 | #if !defined (_POSIX_SOURCE) || _POSIX_C_SOURCE >= 2
|
---|
202 |
|
---|
203 | #define optarg CRTWRAP(optarg)
|
---|
204 | #define optind CRTWRAP(optind)
|
---|
205 | #define opterr CRTWRAP(opterr)
|
---|
206 | #define optopt CRTWRAP(optopt)
|
---|
207 |
|
---|
208 | extern char *optarg;
|
---|
209 | extern int optind;
|
---|
210 | extern int opterr;
|
---|
211 | extern int optopt;
|
---|
212 |
|
---|
213 | /* Note: The 2nd argument is not const as GETOPT_ANY reorders the
|
---|
214 | array pointed to. */
|
---|
215 |
|
---|
216 | #define getopt CRTWRAP(getopt)
|
---|
217 |
|
---|
218 | int getopt (int, char **, __const__ char *);
|
---|
219 |
|
---|
220 | #endif
|
---|
221 |
|
---|
222 |
|
---|
223 | #if !defined (_POSIX_SOURCE) || defined (_WITH_UNDERSCORE)
|
---|
224 |
|
---|
225 | #define _optarg CRTWRAP(_optarg)
|
---|
226 | #define _optind CRTWRAP(_optind)
|
---|
227 | #define _opterr CRTWRAP(_opterr)
|
---|
228 | #define _optopt CRTWRAP(_optopt)
|
---|
229 |
|
---|
230 | extern char *_optarg;
|
---|
231 | extern int _optind;
|
---|
232 | extern int _opterr;
|
---|
233 | extern int _optopt;
|
---|
234 |
|
---|
235 | #define _getopt CRTWRAP(_getopt)
|
---|
236 |
|
---|
237 | int _getopt (int, char **, __const__ char *);
|
---|
238 |
|
---|
239 | #define _access CRTWRAP(_access)
|
---|
240 | #define _alarm CRTWRAP(_alarm)
|
---|
241 | #define _chdir CRTWRAP(_chdir)
|
---|
242 | #define _close CRTWRAP(_close)
|
---|
243 | #define _cuserid CRTWRAP(_cuserid)
|
---|
244 | #define _dup CRTWRAP(_dup)
|
---|
245 | #define _dup2 CRTWRAP(_dup2)
|
---|
246 | #define _execl CRTWRAP(_execl)
|
---|
247 | #define _execle CRTWRAP(_execle)
|
---|
248 | #define _execlp CRTWRAP(_execlp)
|
---|
249 | #define _execv CRTWRAP(_execv)
|
---|
250 | #define _execve CRTWRAP(_execve)
|
---|
251 | #define _execvp CRTWRAP(_execvp)
|
---|
252 | #define _exit CRTWRAP(_exit)
|
---|
253 | #define _fork CRTWRAP(_fork)
|
---|
254 | #define _fpathconf CRTWRAP(_fpathconf)
|
---|
255 | #define _getcwd CRTWRAP(_getcwd)
|
---|
256 | #define _getegid CRTWRAP(_getegid)
|
---|
257 | #define _geteuid CRTWRAP(_geteuid)
|
---|
258 | #define _getgid CRTWRAP(_getgid)
|
---|
259 | #define _getgroups CRTWRAP(_getgroups)
|
---|
260 | #define _getlogin CRTWRAP(_getlogin)
|
---|
261 | #define _getpgrp CRTWRAP(_getpgrp)
|
---|
262 | #define _getpid CRTWRAP(_getpid)
|
---|
263 | #define _getppid CRTWRAP(_getppid)
|
---|
264 | #define _getuid CRTWRAP(_getuid)
|
---|
265 | #define _isatty CRTWRAP(_isatty)
|
---|
266 | #define _lseek CRTWRAP(_lseek)
|
---|
267 | #define _pathconf CRTWRAP(_pathconf)
|
---|
268 | #define _pause CRTWRAP(_pause)
|
---|
269 | #define _pipe CRTWRAP(_pipe)
|
---|
270 | #define _read CRTWRAP(_read)
|
---|
271 | #define _rmdir CRTWRAP(_rmdir)
|
---|
272 | #define _setgid CRTWRAP(_setgid)
|
---|
273 | #define _setpgid CRTWRAP(_setpgid)
|
---|
274 | #define _setsid CRTWRAP(_setsid)
|
---|
275 | #define _setuid CRTWRAP(_setuid)
|
---|
276 | #define _sleep CRTWRAP(_sleep)
|
---|
277 | #define _sysconf CRTWRAP(_sysconf)
|
---|
278 | #define _tcgetpgrp CRTWRAP(_tcgetpgrp)
|
---|
279 | #define _tcsetpgrp CRTWRAP(_tcsetpgrp)
|
---|
280 | #define _ttyname CRTWRAP(_ttyname)
|
---|
281 | #define _unlink CRTWRAP(_unlink)
|
---|
282 | #define _write CRTWRAP(_write)
|
---|
283 |
|
---|
284 | int _access (__const__ char *, int);
|
---|
285 | unsigned _alarm (unsigned);
|
---|
286 | int _chdir (__const__ char *);
|
---|
287 | int _close (int);
|
---|
288 | char *_cuserid (char *);
|
---|
289 | int _dup (int);
|
---|
290 | int _dup2 (int, int);
|
---|
291 | int _execl (__const__ char *, __const__ char *, ...);
|
---|
292 | int _execle (__const__ char *, __const__ char *, ...);
|
---|
293 | int _execlp (__const__ char *, __const__ char *, ...);
|
---|
294 | int _execv (__const__ char *, char * __const__ *);
|
---|
295 | int _execve (__const__ char *, char * __const__ *, char * __const__ *);
|
---|
296 | int _execvp (__const__ char *, char * __const__ *);
|
---|
297 | int _fork (void);
|
---|
298 | long _fpathconf (int, int);
|
---|
299 | char *_getcwd (char *, size_t);
|
---|
300 | int _getegid (void);
|
---|
301 | int _geteuid (void);
|
---|
302 | int _getgid (void);
|
---|
303 | int _getgroups (int, int *);
|
---|
304 | char *_getlogin (void);
|
---|
305 | int _getpgrp (void);
|
---|
306 | int _getpid (void);
|
---|
307 | int _getppid (void);
|
---|
308 | int _getuid (void);
|
---|
309 | int _isatty (int);
|
---|
310 | long _lseek (int, long, int);
|
---|
311 | long _pathconf (__const__ char *, int);
|
---|
312 | int _pause (void);
|
---|
313 | int _pipe (int *);
|
---|
314 | int _read (int, void *, size_t);
|
---|
315 | int _rmdir (__const__ char *);
|
---|
316 | int _setgid (int);
|
---|
317 | int _setpgid (int, int);
|
---|
318 | int _setsid (void);
|
---|
319 | int _setuid (int);
|
---|
320 | unsigned _sleep (unsigned);
|
---|
321 | long _sysconf (int);
|
---|
322 | int _tcgetpgrp (int);
|
---|
323 | int _tcsetpgrp (int, int);
|
---|
324 | char *_ttyname (int);
|
---|
325 | int _unlink (__const__ char *);
|
---|
326 | int _write (int, __const__ void *, size_t);
|
---|
327 |
|
---|
328 | #define _brk CRTWRAP(_brk)
|
---|
329 | #define _getpass CRTWRAP(_getpass)
|
---|
330 | #define _getpass1 CRTWRAP(_getpass1)
|
---|
331 | #define _getpass2 CRTWRAP(_getpass2)
|
---|
332 | #define _mkstemp CRTWRAP(_mkstemp)
|
---|
333 | #define _mktemp CRTWRAP(_mktemp)
|
---|
334 | #define _profil CRTWRAP(_profil)
|
---|
335 |
|
---|
336 | void *_brk (void *);
|
---|
337 | char *_getpass (__const__ char *);
|
---|
338 | char *_getpass1 (__const__ char *);
|
---|
339 | char *_getpass2 (__const__ char *, int);
|
---|
340 | int _mkstemp (char *);
|
---|
341 | char *_mktemp (char *);
|
---|
342 | int _profil (void *, unsigned, unsigned, unsigned);
|
---|
343 | void *_brk (void *);
|
---|
344 |
|
---|
345 | #endif
|
---|
346 |
|
---|
347 |
|
---|
348 | #if defined (__cplusplus)
|
---|
349 | }
|
---|
350 | #endif
|
---|
351 |
|
---|
352 | #endif /* not _UNISTD_H */
|
---|