5 print #if __mips == 2 && !defined(_NO_LARGEFILE64_SOURCE)
6 print #define _NO_LARGEFILE64_SOURCE 1
8 print #if !defined(_NO_LARGEFILE64_SOURCE) && _typ_off64_t && _lib_lseek64 && _lib_stat64
9 print #if !defined(_LARGEFILE64_SOURCE)
10 print #define _LARGEFILE64_SOURCE 1
12 print #if !defined(_LARGEFILE_SOURCE)
13 print #define _LARGEFILE_SOURCE 1
16 print #undef _LARGEFILE64_SOURCE
17 print #undef _LARGEFILE_SOURCE
18 print #undef _typ_off64_t
19 print #undef _typ_struct_dirent64
20 print #undef _lib_creat64
21 print #undef _lib_fstat64
22 print #undef _lib_fstatvfs64
23 print #undef _lib_ftruncate64
24 print #undef _lib_lseek64
25 print #undef _lib_lstat64
26 print #undef _lib_mmap64
27 print #undef _lib_open64
28 print #undef _lib_readdir64
29 print #undef _lib_stat64
30 print #undef _lib_statvfs64
31 print #undef _lib_truncate64
34 print #if defined(__STDC__) && !defined(__USE_FIXED_PROTOTYPES__)
35 print #define __USE_FIXED_PROTOTYPES__ 1 /* kick gcc out of the past */
49 typ dev_t,nlink_t fail{
52 echo "typedef short $v;"
55 typ gid_t,mode_t,uid_t fail{
58 echo "typedef unsigned short $v;"
61 typ wchar_t stdio.h wchar.h fail{
64 echo "typedef unsigned short $v;"
67 typ pid_t,ssize_t fail{
70 echo "typedef int $v;"
73 typ wint_t stdio.h wchar.h fail{
76 echo "typedef int $v;"
79 typ socklen_t sys/socket.h fail{
82 echo "typedef int $v;"
88 echo "typedef unsigned int $v;"
91 typ clock_t,ino_t,off_t,ptrdiff_t fail{
94 echo "typedef long $v;"
100 echo "typedef unsigned long $v;"
106 echo "typedef struct { int quot; int rem; } $v;"
112 echo "typedef struct { long quot; long rem; } $v;"
115 tst typ_signed_size_t output{
116 #include <sys/types.h>
120 unsigned long u = ~0;
124 printf("#if !defined(__cplusplus) && !defined(c_plusplus) && !defined(_typ_signed_size_t)\n/* what dipsticks made size_t signed? sun. */\ntypedef unsigned %s _ast_size_t;\n#undef\tsize_t\n#define size_t\t_ast_size_t\n#endif\n", u == (unsigned long)s ? "long" : "int");
129 define offsetof (type,member) ((size_t)&(((type*)0)->member))
130 define EXIT_FAILURE 1
131 define EXIT_SUCCESS 0
133 define RAND_MAX 32767
135 define STDIN_FILENO 0
136 define STDOUT_FILENO 1
137 define STDERR_FILENO 2
150 print #if _BLD_ast && defined(__EXPORT__)
151 print #define extern __EXPORT__
154 extern _exit void (int)
155 extern abort void (void)
157 extern access int (const char*, int)
158 extern alarm unsigned (unsigned)
159 extern atexit int (void(*)(void))
160 extern atof double (const char*)
161 extern atoi int (const char*)
162 extern atol long (const char*)
163 extern bsearch void* (const void*, const void*, size_t, size_t, int(*)(const void*, const void*))
164 extern calloc void* (size_t, size_t)
165 extern cfree void (void*)
166 extern chdir int (const char*)
167 extern chown int (const char*, uid_t, gid_t)
168 extern close int (int)
169 extern confstr size_t (int, char*, size_t)
170 extern div div_t (int, int)
172 extern dup2 int (int, int)
173 extern eaccess int (const char*, int)
174 extern execl int (const char*, const char*, ...)
175 extern execle int (const char*, const char*, ...)
176 extern execlp int (const char*, const char*, ...)
177 extern execv int (const char*, char* const[])
178 extern execve int (const char*, char* const[], char* const[])
179 extern execve int (const char*, char* const[], char* const[])
180 extern execvp int (const char*, char* const[])
181 extern execvpe int (const char*, char* const[], char* const[])
182 extern exit void (int)
183 extern fork pid_t (void)
184 extern fpathconf long (int, int)
185 extern free void (void*)
186 extern fsync int (int)
187 extern ftruncate int (int, off_t)
188 extern getcwd char* (char*, size_t)
189 extern getegid gid_t (void)
190 extern getenv char* (const char*)
191 extern geteuid uid_t (void)
192 extern getgid gid_t (void)
193 extern getgroups int (int, gid_t[])
194 extern getlogin char* (void)
195 extern getpgrp pid_t (void)
196 extern getpid pid_t (void)
197 extern getppid pid_t (void)
198 extern gettxt char* (const char*, const char*)
199 extern getuid uid_t (void)
200 extern isatty int (int)
201 extern labs long (long)
202 extern ldiv ldiv_t (long, long)
203 extern link int (const char*, const char*)
204 extern lseek off_t (int, off_t, int)
205 extern malloc void* (size_t)
206 extern mblen int (const char*, size_t)
207 extern mbstowcs size_t (wchar_t*, const char*, size_t)
208 extern mbtowc int (wchar_t*, const char*, size_t)
209 extern memalign void* (size_t, size_t)
210 extern memccpy void* (void*, const void*, int, size_t)
211 extern memchr void* (const void*, int, size_t)
212 extern memcmp int (const void*, const void*, size_t)
213 extern memcpy void* (void*, const void*, size_t)
214 extern memmove void* (void*, const void*, size_t)
215 extern memset void* (void*, int, size_t)
216 extern pathconf long (const char*, int)
217 extern pause int (void)
218 extern pipe int (int[])
219 extern pvalloc void* (size_t)
220 extern qsort void (void*, size_t, size_t, int(*)(const void*, const void*))
221 extern rand int (void)
222 extern read ssize_t (int, void*, size_t)
223 extern realloc void* (void*, size_t)
224 extern realpath char* (const char*, char*)
225 extern resolvepath char* (const char*, char*, size_t)
226 extern rmdir int (const char*)
227 extern setgid int (gid_t)
228 extern setpgid int (pid_t, pid_t)
229 extern setsid pid_t (void)
230 extern setuid int (uid_t)
231 extern sleep unsigned (unsigned int)
232 extern spawnveg pid_t (const char*, char* const[], char* const[], pid_t)
233 extern srand void (unsigned int)
234 extern strcasecmp int (const char*, const char*)
235 extern strcat char* (char*, const char*)
236 extern strchr char* (const char*, int)
237 extern strcmp int (const char*, const char*)
238 extern strcoll int (const char*, const char*)
239 extern strcpy char* (char*, const char*)
240 extern strcspn size_t (const char*, const char*)
241 extern strdup char* (const char*)
242 extern strlcat size_t (char*, const char*, size_t)
243 extern strlcpy size_t (char*, const char*, size_t)
244 extern strlen size_t (const char*)
245 extern strncasecmp int (const char*, const char*, size_t)
246 extern strncat char* (char*, const char*, size_t)
247 extern strncmp int (const char*, const char*, size_t)
248 extern strncpy char* (char*, const char*, size_t)
249 extern strpbrk char* (const char*, const char*)
250 extern strrchr char* (const char*, int)
251 extern strspn size_t (const char*, const char*)
252 extern strstr char* (const char*, const char*)
253 extern strtok char* (char*, const char*)
254 extern strxfrm size_t (char*, const char*, size_t)
255 extern swab void (const void*, void*, ssize_t)
256 extern sysconf long (int)
257 extern system int (const char*)
258 extern tcgetpgrp pid_t (int)
259 extern tcsetpgrp int (int, pid_t)
260 extern truncate int (const char*, off_t)
261 extern ttyname char* (int)
262 extern unlink int (const char*)
263 extern valloc void* (size_t)
264 extern wcstombs size_t (char*, const wchar_t*, size_t)
265 extern wctomb int (char*, wchar_t)
266 extern write ssize_t (int, const void*, size_t)
270 # <stdarg.h> is handled by proto so this must be after the last test
272 print #include <stdarg.h>