1 | /* unistd.h (emx+gcc) */
|
---|
2 |
|
---|
3 | #ifndef _UNISTD_H
|
---|
4 | #define _UNISTD_H
|
---|
5 | #define _UNISTD_H_ /* toolkit compatibility */
|
---|
6 |
|
---|
7 | #if defined (__cplusplus)
|
---|
8 | extern "C" {
|
---|
9 | #endif
|
---|
10 |
|
---|
11 | #if defined (_POSIX_C_SOURCE) && !defined (_POSIX_SOURCE)
|
---|
12 | #define _POSIX_SOURCE
|
---|
13 | #endif
|
---|
14 |
|
---|
15 | #if !defined (_SIZE_T)
|
---|
16 | #define _SIZE_T
|
---|
17 | typedef unsigned long size_t;
|
---|
18 | #endif
|
---|
19 |
|
---|
20 | #if !defined (_SSIZE_T)
|
---|
21 | #define _SSIZE_T
|
---|
22 | typedef int ssize_t;
|
---|
23 | #endif
|
---|
24 |
|
---|
25 | #if !defined (NULL)
|
---|
26 | #if defined (__cplusplus)
|
---|
27 | #define NULL 0
|
---|
28 | #else
|
---|
29 | #define NULL ((void *)0)
|
---|
30 | #endif
|
---|
31 | #endif
|
---|
32 |
|
---|
33 | #if !defined (STDIN_FILENO)
|
---|
34 | #define STDIN_FILENO 0
|
---|
35 | #define STDOUT_FILENO 1
|
---|
36 | #define STDERR_FILENO 2
|
---|
37 | #endif
|
---|
38 |
|
---|
39 | #if !defined (F_OK)
|
---|
40 | #define F_OK 0
|
---|
41 | #define X_OK 1
|
---|
42 | #define W_OK 2
|
---|
43 | #define R_OK 4
|
---|
44 | #endif
|
---|
45 |
|
---|
46 | #if !defined (SEEK_SET)
|
---|
47 | #define SEEK_SET 0
|
---|
48 | #define SEEK_CUR 1
|
---|
49 | #define SEEK_END 2
|
---|
50 | #endif
|
---|
51 |
|
---|
52 | #if !defined (_PC_LINK_MAX)
|
---|
53 | #define _PC_LINK_MAX 1
|
---|
54 | #define _PC_MAX_CANON 2
|
---|
55 | #define _PC_MAX_INPUT 3
|
---|
56 | #define _PC_NAME_MAX 4
|
---|
57 | #define _PC_PATH_MAX 5
|
---|
58 | #define _PC_PIPE_BUF 6
|
---|
59 | #define _PC_CHOWN_RESTRICTED 7
|
---|
60 | #define _PC_NO_TRUNC 8
|
---|
61 | #define _PC_VDISABLE 9
|
---|
62 | #endif
|
---|
63 |
|
---|
64 | #if !defined (_SC_ARG_MAX)
|
---|
65 | #define _SC_ARG_MAX 1
|
---|
66 | #define _SC_CHILD_MAX 2
|
---|
67 | #define _SC_CLK_TCK 3
|
---|
68 | #define _SC_NGROUPS_MAX 4
|
---|
69 | #define _SC_OPEN_MAX 5
|
---|
70 | #define _SC_STREAM_MAX 6
|
---|
71 | #define _SC_TZNAME_MAX 7
|
---|
72 | #define _SC_JOB_CONTROL 8
|
---|
73 | #define _SC_SAVED_IDS 9
|
---|
74 | #define _SC_VERSION 10
|
---|
75 | #endif
|
---|
76 |
|
---|
77 | #if !defined (_POSIX_VERSION)
|
---|
78 | #define _POSIX_VERSION 199009L
|
---|
79 | #endif
|
---|
80 |
|
---|
81 |
|
---|
82 | int access (__const__ char *, int);
|
---|
83 | unsigned alarm (unsigned);
|
---|
84 | int chdir (__const__ char *);
|
---|
85 | /* chown() */
|
---|
86 | int close (int);
|
---|
87 | /* ctermid() */
|
---|
88 | char *cuserid (char *);
|
---|
89 | int dup (int);
|
---|
90 | int dup2 (int, int);
|
---|
91 | int execl (__const__ char *, __const__ char *, ...);
|
---|
92 | int execle (__const__ char *, __const__ char *, ...);
|
---|
93 | int execlp (__const__ char *, __const__ char *, ...);
|
---|
94 | int execv (__const__ char *, char * __const__ *);
|
---|
95 | int execve (__const__ char *, char * __const__ *, char * __const__ *);
|
---|
96 | int execvp (__const__ char *, char * __const__ *);
|
---|
97 | void _exit (int) __attribute__ ((__noreturn__));
|
---|
98 | int fork (void);
|
---|
99 | long fpathconf (int, int);
|
---|
100 | char *getcwd (char *, size_t);
|
---|
101 | int getegid (void); /* gid_t getegid (void); */
|
---|
102 | int geteuid (void); /* uid_t geteuid (void); */
|
---|
103 | int getgid (void); /* gid_t getgid (void); */
|
---|
104 | int getgroups (int, int *); /* int getgroups (int, gid_t *); */
|
---|
105 | char *getlogin (void);
|
---|
106 | int getpgrp (void); /* pid_t getpgrp (void); */
|
---|
107 | int getpid (void); /* pid_t getpid (void); */
|
---|
108 | int getppid (void); /* pid_t getppid (void); */
|
---|
109 | int getuid (void); /* uid_t getuid (void); */
|
---|
110 | int isatty (int);
|
---|
111 | /* link() */
|
---|
112 | long lseek (int, long, int);
|
---|
113 | long pathconf (__const__ char *, int);
|
---|
114 | int pause (void);
|
---|
115 | int pipe (int *);
|
---|
116 | int read (int, void *, size_t);
|
---|
117 | int rmdir (__const__ char *);
|
---|
118 | int setgid (int); /* int setsid (gid_t); */
|
---|
119 | int setpgid (int, int); /* int setpgid (gid_t, gid_t); */
|
---|
120 | int setsid (void); /* pid_t setsid (void); */
|
---|
121 | int setuid (int); /* setuid (uid_t); */
|
---|
122 | unsigned sleep (unsigned);
|
---|
123 | long sysconf (int);
|
---|
124 | int tcgetpgrp (int); /* pid_t tcgetpgrp (int); */
|
---|
125 | int tcsetpgrp (int, int); /* int tcsetpgrp (int, pid_t) */
|
---|
126 | char *ttyname (int);
|
---|
127 | int unlink (__const__ char *);
|
---|
128 | int write (int, __const__ void *, size_t);
|
---|
129 |
|
---|
130 |
|
---|
131 | #if !defined (_POSIX_SOURCE)
|
---|
132 |
|
---|
133 | void *brk (void *);
|
---|
134 | char *getpass (__const__ char *);
|
---|
135 | char *_getpass1 (__const__ char *);
|
---|
136 | char *_getpass2 (__const__ char *, int);
|
---|
137 | int mkstemp (char *);
|
---|
138 | char *mktemp (char *);
|
---|
139 | int profil (void *, unsigned, unsigned, unsigned);
|
---|
140 | void *sbrk (int);
|
---|
141 |
|
---|
142 | #endif
|
---|
143 |
|
---|
144 |
|
---|
145 | #if !defined (_POSIX_SOURCE) || _POSIX_C_SOURCE >= 2
|
---|
146 |
|
---|
147 | extern char *optarg;
|
---|
148 | extern int optind;
|
---|
149 | extern int opterr;
|
---|
150 | extern int optopt;
|
---|
151 |
|
---|
152 | /* Note: The 2nd argument is not const as GETOPT_ANY reorders the
|
---|
153 | array pointed to. */
|
---|
154 |
|
---|
155 | int getopt (int, char **, __const__ char *);
|
---|
156 |
|
---|
157 | #endif
|
---|
158 |
|
---|
159 |
|
---|
160 | #if !defined (_POSIX_SOURCE) || defined (_WITH_UNDERSCORE)
|
---|
161 |
|
---|
162 | extern char *_optarg;
|
---|
163 | extern int _optind;
|
---|
164 | extern int _opterr;
|
---|
165 | extern int _optopt;
|
---|
166 |
|
---|
167 | int _getopt (int, char **, __const__ char *);
|
---|
168 |
|
---|
169 | int _access (__const__ char *, int);
|
---|
170 | unsigned _alarm (unsigned);
|
---|
171 | int _chdir (__const__ char *);
|
---|
172 | int _close (int);
|
---|
173 | char *_cuserid (char *);
|
---|
174 | int _dup (int);
|
---|
175 | int _dup2 (int, int);
|
---|
176 | int _execl (__const__ char *, __const__ char *, ...);
|
---|
177 | int _execle (__const__ char *, __const__ char *, ...);
|
---|
178 | int _execlp (__const__ char *, __const__ char *, ...);
|
---|
179 | int _execv (__const__ char *, char * __const__ *);
|
---|
180 | int _execve (__const__ char *, char * __const__ *, char * __const__ *);
|
---|
181 | int _execvp (__const__ char *, char * __const__ *);
|
---|
182 | int _fork (void);
|
---|
183 | long _fpathconf (int, int);
|
---|
184 | char *_getcwd (char *, size_t);
|
---|
185 | int _getegid (void);
|
---|
186 | int _geteuid (void);
|
---|
187 | int _getgid (void);
|
---|
188 | int _getgroups (int, int *);
|
---|
189 | char *_getlogin (void);
|
---|
190 | int _getpgrp (void);
|
---|
191 | int _getpid (void);
|
---|
192 | int _getppid (void);
|
---|
193 | int _getuid (void);
|
---|
194 | int _isatty (int);
|
---|
195 | long _lseek (int, long, int);
|
---|
196 | long _pathconf (__const__ char *, int);
|
---|
197 | int _pause (void);
|
---|
198 | int _pipe (int *);
|
---|
199 | int _read (int, void *, size_t);
|
---|
200 | int _rmdir (__const__ char *);
|
---|
201 | int _setgid (int);
|
---|
202 | int _setpgid (int, int);
|
---|
203 | int _setsid (void);
|
---|
204 | int _setuid (int);
|
---|
205 | unsigned _sleep (unsigned);
|
---|
206 | long _sysconf (int);
|
---|
207 | int _tcgetpgrp (int);
|
---|
208 | int _tcsetpgrp (int, int);
|
---|
209 | char *_ttyname (int);
|
---|
210 | int _unlink (__const__ char *);
|
---|
211 | int _write (int, __const__ void *, size_t);
|
---|
212 |
|
---|
213 | void *_brk (void *);
|
---|
214 | char *_getpass (__const__ char *);
|
---|
215 | char *_getpass1 (__const__ char *);
|
---|
216 | char *_getpass2 (__const__ char *, int);
|
---|
217 | int _mkstemp (char *);
|
---|
218 | char *_mktemp (char *);
|
---|
219 | int _profil (void *, unsigned, unsigned, unsigned);
|
---|
220 | void *_brk (void *);
|
---|
221 |
|
---|
222 | #endif
|
---|
223 |
|
---|
224 | /* Toolkit compatibility */
|
---|
225 | #include <sys/cdefs.h>
|
---|
226 | #include <sys/types.h>
|
---|
227 | /** @name tcpip40 function mappings.
|
---|
228 | * @{ */
|
---|
229 | #define soclose tcpip40_soclose
|
---|
230 | #define gethostid tcpip40_gethostid
|
---|
231 | #define gethostname tcpip40_gethostname
|
---|
232 | #define iruserok tcpip40_iruserok
|
---|
233 | #define rcmd tcpip40_rcmd
|
---|
234 | #define rresvport tcpip40_rresvport
|
---|
235 | #define ruserok tcpip40_ruserok
|
---|
236 | /* @} */
|
---|
237 | int _System soclose (int);
|
---|
238 | #ifndef _POSIX_SOURCE
|
---|
239 | int _System gethostid (void);
|
---|
240 | int _System gethostname (char *, int);
|
---|
241 | int _System iruserok (unsigned long, int, const char *, const char *);
|
---|
242 | int _System rcmd (char **, int, const char *, const char *, const char *, int *);
|
---|
243 | int _System rresvport (int *);
|
---|
244 | int _System ruserok (const char *, int, const char *, const char *);
|
---|
245 | #include <sys/select.h>
|
---|
246 | #endif /* !_POSIX_SOURCE */
|
---|
247 |
|
---|
248 |
|
---|
249 | #if defined (__cplusplus)
|
---|
250 | }
|
---|
251 | #endif
|
---|
252 |
|
---|
253 | #endif /* not _UNISTD_H */
|
---|