]>
Commit | Line | Data |
---|---|---|
1 | # 1 "unix.c" | |
2 | # 1 "<built-in>" | |
3 | #define __STDC__ 1 | |
4 | # 1 "<built-in>" | |
5 | #define __STDC_HOSTED__ 1 | |
6 | # 1 "<built-in>" | |
7 | #define __GNUC__ 4 | |
8 | # 1 "<built-in>" | |
9 | #define __GNUC_MINOR__ 1 | |
10 | # 1 "<built-in>" | |
11 | #define __GNUC_PATCHLEVEL__ 2 | |
12 | # 1 "<built-in>" | |
13 | #define __SIZE_TYPE__ unsigned int | |
14 | # 1 "<built-in>" | |
15 | #define __PTRDIFF_TYPE__ int | |
16 | # 1 "<built-in>" | |
17 | #define __WCHAR_TYPE__ long int | |
18 | # 1 "<built-in>" | |
19 | #define __WINT_TYPE__ unsigned int | |
20 | # 1 "<built-in>" | |
21 | #define __INTMAX_TYPE__ long long int | |
22 | # 1 "<built-in>" | |
23 | #define __UINTMAX_TYPE__ long long unsigned int | |
24 | # 1 "<built-in>" | |
25 | #define __GXX_ABI_VERSION 1002 | |
26 | # 1 "<built-in>" | |
27 | #define __SCHAR_MAX__ 127 | |
28 | # 1 "<built-in>" | |
29 | #define __SHRT_MAX__ 32767 | |
30 | # 1 "<built-in>" | |
31 | #define __INT_MAX__ 2147483647 | |
32 | # 1 "<built-in>" | |
33 | #define __LONG_MAX__ 2147483647L | |
34 | # 1 "<built-in>" | |
35 | #define __LONG_LONG_MAX__ 9223372036854775807LL | |
36 | # 1 "<built-in>" | |
37 | #define __WCHAR_MAX__ 2147483647 | |
38 | # 1 "<built-in>" | |
39 | #define __CHAR_BIT__ 8 | |
40 | # 1 "<built-in>" | |
41 | #define __INTMAX_MAX__ 9223372036854775807LL | |
42 | # 1 "<built-in>" | |
43 | #define __FLT_EVAL_METHOD__ 2 | |
44 | # 1 "<built-in>" | |
45 | #define __FLT_RADIX__ 2 | |
46 | # 1 "<built-in>" | |
47 | #define __FLT_MANT_DIG__ 24 | |
48 | # 1 "<built-in>" | |
49 | #define __FLT_DIG__ 6 | |
50 | # 1 "<built-in>" | |
51 | #define __FLT_MIN_EXP__ (-125) | |
52 | # 1 "<built-in>" | |
53 | #define __FLT_MIN_10_EXP__ (-37) | |
54 | # 1 "<built-in>" | |
55 | #define __FLT_MAX_EXP__ 128 | |
56 | # 1 "<built-in>" | |
57 | #define __FLT_MAX_10_EXP__ 38 | |
58 | # 1 "<built-in>" | |
59 | #define __FLT_MAX__ 3.40282347e+38F | |
60 | # 1 "<built-in>" | |
61 | #define __FLT_MIN__ 1.17549435e-38F | |
62 | # 1 "<built-in>" | |
63 | #define __FLT_EPSILON__ 1.19209290e-7F | |
64 | # 1 "<built-in>" | |
65 | #define __FLT_DENORM_MIN__ 1.40129846e-45F | |
66 | # 1 "<built-in>" | |
67 | #define __FLT_HAS_INFINITY__ 1 | |
68 | # 1 "<built-in>" | |
69 | #define __FLT_HAS_QUIET_NAN__ 1 | |
70 | # 1 "<built-in>" | |
71 | #define __DBL_MANT_DIG__ 53 | |
72 | # 1 "<built-in>" | |
73 | #define __DBL_DIG__ 15 | |
74 | # 1 "<built-in>" | |
75 | #define __DBL_MIN_EXP__ (-1021) | |
76 | # 1 "<built-in>" | |
77 | #define __DBL_MIN_10_EXP__ (-307) | |
78 | # 1 "<built-in>" | |
79 | #define __DBL_MAX_EXP__ 1024 | |
80 | # 1 "<built-in>" | |
81 | #define __DBL_MAX_10_EXP__ 308 | |
82 | # 1 "<built-in>" | |
83 | #define __DBL_MAX__ 1.7976931348623157e+308 | |
84 | # 1 "<built-in>" | |
85 | #define __DBL_MIN__ 2.2250738585072014e-308 | |
86 | # 1 "<built-in>" | |
87 | #define __DBL_EPSILON__ 2.2204460492503131e-16 | |
88 | # 1 "<built-in>" | |
89 | #define __DBL_DENORM_MIN__ 4.9406564584124654e-324 | |
90 | # 1 "<built-in>" | |
91 | #define __DBL_HAS_INFINITY__ 1 | |
92 | # 1 "<built-in>" | |
93 | #define __DBL_HAS_QUIET_NAN__ 1 | |
94 | # 1 "<built-in>" | |
95 | #define __LDBL_MANT_DIG__ 64 | |
96 | # 1 "<built-in>" | |
97 | #define __LDBL_DIG__ 18 | |
98 | # 1 "<built-in>" | |
99 | #define __LDBL_MIN_EXP__ (-16381) | |
100 | # 1 "<built-in>" | |
101 | #define __LDBL_MIN_10_EXP__ (-4931) | |
102 | # 1 "<built-in>" | |
103 | #define __LDBL_MAX_EXP__ 16384 | |
104 | # 1 "<built-in>" | |
105 | #define __LDBL_MAX_10_EXP__ 4932 | |
106 | # 1 "<built-in>" | |
107 | #define __DECIMAL_DIG__ 21 | |
108 | # 1 "<built-in>" | |
109 | #define __LDBL_MAX__ 1.18973149535723176502e+4932L | |
110 | # 1 "<built-in>" | |
111 | #define __LDBL_MIN__ 3.36210314311209350626e-4932L | |
112 | # 1 "<built-in>" | |
113 | #define __LDBL_EPSILON__ 1.08420217248550443401e-19L | |
114 | # 1 "<built-in>" | |
115 | #define __LDBL_DENORM_MIN__ 3.64519953188247460253e-4951L | |
116 | # 1 "<built-in>" | |
117 | #define __LDBL_HAS_INFINITY__ 1 | |
118 | # 1 "<built-in>" | |
119 | #define __LDBL_HAS_QUIET_NAN__ 1 | |
120 | # 1 "<built-in>" | |
121 | #define __REGISTER_PREFIX__ | |
122 | # 1 "<built-in>" | |
123 | #define __USER_LABEL_PREFIX__ | |
124 | # 1 "<built-in>" | |
125 | #define __VERSION__ "4.1.2 (Gentoo 4.1.2 p1.0.2)" | |
126 | # 1 "<built-in>" | |
127 | #define __OPTIMIZE__ 1 | |
128 | # 1 "<built-in>" | |
129 | #define __FINITE_MATH_ONLY__ 0 | |
130 | # 1 "<built-in>" | |
131 | #define __i386 1 | |
132 | # 1 "<built-in>" | |
133 | #define __i386__ 1 | |
134 | # 1 "<built-in>" | |
135 | #define i386 1 | |
136 | # 1 "<built-in>" | |
137 | #define __tune_athlon__ 1 | |
138 | # 1 "<built-in>" | |
139 | #define __tune_athlon_sse__ 1 | |
140 | # 1 "<built-in>" | |
141 | #define __MMX__ 1 | |
142 | # 1 "<built-in>" | |
143 | #define __3dNOW__ 1 | |
144 | # 1 "<built-in>" | |
145 | #define __3dNOW_A__ 1 | |
146 | # 1 "<built-in>" | |
147 | #define __SSE__ 1 | |
148 | # 1 "<built-in>" | |
149 | #define __athlon 1 | |
150 | # 1 "<built-in>" | |
151 | #define __athlon__ 1 | |
152 | # 1 "<built-in>" | |
153 | #define __athlon_sse__ 1 | |
154 | # 1 "<built-in>" | |
155 | #define __gnu_linux__ 1 | |
156 | # 1 "<built-in>" | |
157 | #define __linux 1 | |
158 | # 1 "<built-in>" | |
159 | #define __linux__ 1 | |
160 | # 1 "<built-in>" | |
161 | #define linux 1 | |
162 | # 1 "<built-in>" | |
163 | #define __unix 1 | |
164 | # 1 "<built-in>" | |
165 | #define __unix__ 1 | |
166 | # 1 "<built-in>" | |
167 | #define unix 1 | |
168 | # 1 "<built-in>" | |
169 | #define __ELF__ 1 | |
170 | # 1 "<command line>" | |
171 | #define LOCALEDIR "/usr/share/locale" | |
172 | # 1 "<command line>" | |
173 | #define ROOT_SYSCONFDIR "/etc" | |
174 | # 1 "<command line>" | |
175 | #define PACKAGE_NAME "" | |
176 | # 1 "<command line>" | |
177 | #define PACKAGE_TARNAME "" | |
178 | # 1 "<command line>" | |
179 | #define PACKAGE_VERSION "" | |
180 | # 1 "<command line>" | |
181 | #define PACKAGE_STRING "" | |
182 | # 1 "<command line>" | |
183 | #define PACKAGE_BUGREPORT "" | |
184 | # 1 "<command line>" | |
185 | #define STDC_HEADERS 1 | |
186 | # 1 "<command line>" | |
187 | #define HAVE_SYS_TYPES_H 1 | |
188 | # 1 "<command line>" | |
189 | #define HAVE_SYS_STAT_H 1 | |
190 | # 1 "<command line>" | |
191 | #define HAVE_STDLIB_H 1 | |
192 | # 1 "<command line>" | |
193 | #define HAVE_STRING_H 1 | |
194 | # 1 "<command line>" | |
195 | #define HAVE_MEMORY_H 1 | |
196 | # 1 "<command line>" | |
197 | #define HAVE_STRINGS_H 1 | |
198 | # 1 "<command line>" | |
199 | #define HAVE_INTTYPES_H 1 | |
200 | # 1 "<command line>" | |
201 | #define HAVE_STDINT_H 1 | |
202 | # 1 "<command line>" | |
203 | #define HAVE_UNISTD_H 1 | |
204 | # 1 "<command line>" | |
205 | #define ENABLE_HTREE 1 | |
206 | # 1 "<command line>" | |
207 | #define ENABLE_SWAPFS 1 | |
208 | # 1 "<command line>" | |
209 | #define TLS __thread | |
210 | # 1 "<command line>" | |
211 | #define USE_UUIDD 1 | |
212 | # 1 "<command line>" | |
213 | #define PACKAGE "e2fsprogs" | |
214 | # 1 "<command line>" | |
215 | #define VERSION "0.14.1" | |
216 | # 1 "<command line>" | |
217 | #define HAVE_LONG_LONG 1 | |
218 | # 1 "<command line>" | |
219 | #define HAVE_LONG_DOUBLE 1 | |
220 | # 1 "<command line>" | |
221 | #define HAVE_WCHAR_T 1 | |
222 | # 1 "<command line>" | |
223 | #define HAVE_WINT_T 1 | |
224 | # 1 "<command line>" | |
225 | #define HAVE_INTTYPES_H_WITH_UINTMAX 1 | |
226 | # 1 "<command line>" | |
227 | #define HAVE_STDINT_H_WITH_UINTMAX 1 | |
228 | # 1 "<command line>" | |
229 | #define HAVE_INTMAX_T 1 | |
230 | # 1 "<command line>" | |
231 | #define HAVE_POSIX_PRINTF 1 | |
232 | # 1 "<command line>" | |
233 | #define HAVE_ALLOCA_H 1 | |
234 | # 1 "<command line>" | |
235 | #define HAVE_ALLOCA 1 | |
236 | # 1 "<command line>" | |
237 | #define HAVE_STDLIB_H 1 | |
238 | # 1 "<command line>" | |
239 | #define HAVE_UNISTD_H 1 | |
240 | # 1 "<command line>" | |
241 | #define HAVE_GETPAGESIZE 1 | |
242 | # 1 "<command line>" | |
243 | #define HAVE_MMAP 1 | |
244 | # 1 "<command line>" | |
245 | #define INTDIV0_RAISES_SIGFPE 1 | |
246 | # 1 "<command line>" | |
247 | #define HAVE_UNSIGNED_LONG_LONG 1 | |
248 | # 1 "<command line>" | |
249 | #define HAVE_UINTMAX_T 1 | |
250 | # 1 "<command line>" | |
251 | #define HAVE_INTTYPES_H 1 | |
252 | # 1 "<command line>" | |
253 | #define HAVE_STDINT_H 1 | |
254 | # 1 "<command line>" | |
255 | #define HAVE_STDINT_H 1 | |
256 | # 1 "<command line>" | |
257 | #define HAVE_ARGZ_H 1 | |
258 | # 1 "<command line>" | |
259 | #define HAVE_LIMITS_H 1 | |
260 | # 1 "<command line>" | |
261 | #define HAVE_LOCALE_H 1 | |
262 | # 1 "<command line>" | |
263 | #define HAVE_NL_TYPES_H 1 | |
264 | # 1 "<command line>" | |
265 | #define HAVE_MALLOC_H 1 | |
266 | # 1 "<command line>" | |
267 | #define HAVE_STDDEF_H 1 | |
268 | # 1 "<command line>" | |
269 | #define HAVE_STDLIB_H 1 | |
270 | # 1 "<command line>" | |
271 | #define HAVE_STRING_H 1 | |
272 | # 1 "<command line>" | |
273 | #define HAVE_UNISTD_H 1 | |
274 | # 1 "<command line>" | |
275 | #define HAVE_SYS_PARAM_H 1 | |
276 | # 1 "<command line>" | |
277 | #define HAVE_ASPRINTF 1 | |
278 | # 1 "<command line>" | |
279 | #define HAVE_FWPRINTF 1 | |
280 | # 1 "<command line>" | |
281 | #define HAVE_GETCWD 1 | |
282 | # 1 "<command line>" | |
283 | #define HAVE_GETEGID 1 | |
284 | # 1 "<command line>" | |
285 | #define HAVE_GETEUID 1 | |
286 | # 1 "<command line>" | |
287 | #define HAVE_GETGID 1 | |
288 | # 1 "<command line>" | |
289 | #define HAVE_GETUID 1 | |
290 | # 1 "<command line>" | |
291 | #define HAVE_MEMPCPY 1 | |
292 | # 1 "<command line>" | |
293 | #define HAVE_MUNMAP 1 | |
294 | # 1 "<command line>" | |
295 | #define HAVE_PUTENV 1 | |
296 | # 1 "<command line>" | |
297 | #define HAVE_SETENV 1 | |
298 | # 1 "<command line>" | |
299 | #define HAVE_SETLOCALE 1 | |
300 | # 1 "<command line>" | |
301 | #define HAVE_SNPRINTF 1 | |
302 | # 1 "<command line>" | |
303 | #define HAVE_STPCPY 1 | |
304 | # 1 "<command line>" | |
305 | #define HAVE_STRCASECMP 1 | |
306 | # 1 "<command line>" | |
307 | #define HAVE_STRDUP 1 | |
308 | # 1 "<command line>" | |
309 | #define HAVE_STRTOUL 1 | |
310 | # 1 "<command line>" | |
311 | #define HAVE_TSEARCH 1 | |
312 | # 1 "<command line>" | |
313 | #define HAVE_WCSLEN 1 | |
314 | # 1 "<command line>" | |
315 | #define HAVE___ARGZ_COUNT 1 | |
316 | # 1 "<command line>" | |
317 | #define HAVE___ARGZ_STRINGIFY 1 | |
318 | # 1 "<command line>" | |
319 | #define HAVE___ARGZ_NEXT 1 | |
320 | # 1 "<command line>" | |
321 | #define HAVE___FSETLOCKING 1 | |
322 | # 1 "<command line>" | |
323 | #define HAVE_DECL__SNPRINTF 0 | |
324 | # 1 "<command line>" | |
325 | #define HAVE_DECL__SNWPRINTF 0 | |
326 | # 1 "<command line>" | |
327 | #define HAVE_DECL_FEOF_UNLOCKED 1 | |
328 | # 1 "<command line>" | |
329 | #define HAVE_DECL_FGETS_UNLOCKED 0 | |
330 | # 1 "<command line>" | |
331 | #define HAVE_DECL_GETC_UNLOCKED 1 | |
332 | # 1 "<command line>" | |
333 | #define HAVE_ICONV 1 | |
334 | # 1 "<command line>" | |
335 | #define ICONV_CONST | |
336 | # 1 "<command line>" | |
337 | #define HAVE_LANGINFO_CODESET 1 | |
338 | # 1 "<command line>" | |
339 | #define HAVE_LC_MESSAGES 1 | |
340 | # 1 "<command line>" | |
341 | #define ENABLE_NLS 1 | |
342 | # 1 "<command line>" | |
343 | #define HAVE_GETTEXT 1 | |
344 | # 1 "<command line>" | |
345 | #define HAVE_DCGETTEXT 1 | |
346 | # 1 "<command line>" | |
347 | #define HAVE_STDLIB_H 1 | |
348 | # 1 "<command line>" | |
349 | #define HAVE_UNISTD_H 1 | |
350 | # 1 "<command line>" | |
351 | #define HAVE_STDARG_H 1 | |
352 | # 1 "<command line>" | |
353 | #define HAVE_STDINT_H 1 | |
354 | # 1 "<command line>" | |
355 | #define HAVE_ERRNO_H 1 | |
356 | # 1 "<command line>" | |
357 | #define HAVE_MALLOC_H 1 | |
358 | # 1 "<command line>" | |
359 | #define HAVE_MNTENT_H 1 | |
360 | # 1 "<command line>" | |
361 | #define HAVE_PATHS_H 1 | |
362 | # 1 "<command line>" | |
363 | #define HAVE_DIRENT_H 1 | |
364 | # 1 "<command line>" | |
365 | #define HAVE_GETOPT_H 1 | |
366 | # 1 "<command line>" | |
367 | #define HAVE_SETJMP_H 1 | |
368 | # 1 "<command line>" | |
369 | #define HAVE_SIGNAL_H 1 | |
370 | # 1 "<command line>" | |
371 | #define HAVE_TERMIOS_H 1 | |
372 | # 1 "<command line>" | |
373 | #define HAVE_LINUX_FD_H 1 | |
374 | # 1 "<command line>" | |
375 | #define HAVE_LINUX_MAJOR_H 1 | |
376 | # 1 "<command line>" | |
377 | #define HAVE_SYS_IOCTL_H 1 | |
378 | # 1 "<command line>" | |
379 | #define HAVE_SYS_MMAN_H 1 | |
380 | # 1 "<command line>" | |
381 | #define HAVE_SYS_PRCTL_H 1 | |
382 | # 1 "<command line>" | |
383 | #define HAVE_SYS_QUEUE_H 1 | |
384 | # 1 "<command line>" | |
385 | #define HAVE_SYS_SOCKET_H 1 | |
386 | # 1 "<command line>" | |
387 | #define HAVE_SYS_SYSMACROS_H 1 | |
388 | # 1 "<command line>" | |
389 | #define HAVE_SYS_TIME_H 1 | |
390 | # 1 "<command line>" | |
391 | #define HAVE_SYS_STAT_H 1 | |
392 | # 1 "<command line>" | |
393 | #define HAVE_SYS_TYPES_H 1 | |
394 | # 1 "<command line>" | |
395 | #define HAVE_SYS_WAIT_H 1 | |
396 | # 1 "<command line>" | |
397 | #define HAVE_SYS_RESOURCE_H 1 | |
398 | # 1 "<command line>" | |
399 | #define HAVE_SYS_SYSCALL_H 1 | |
400 | # 1 "<command line>" | |
401 | #define HAVE_NETINET_IN_H 1 | |
402 | # 1 "<command line>" | |
403 | #define HAVE_UTIME_H 1 | |
404 | # 1 "<command line>" | |
405 | #define HAVE_SYS_MOUNT_H 1 | |
406 | # 1 "<command line>" | |
407 | #define HAVE_NET_IF_H 1 | |
408 | # 1 "<command line>" | |
409 | #define HAVE_VPRINTF 1 | |
410 | # 1 "<command line>" | |
411 | #define HAVE_RECLEN_DIRENT 1 | |
412 | # 1 "<command line>" | |
413 | #define HAVE_TYPE_SSIZE_T 1 | |
414 | # 1 "<command line>" | |
415 | #define HAVE_LSEEK64_PROTOTYPE 1 | |
416 | # 1 "<command line>" | |
417 | #define SIZEOF_SHORT 2 | |
418 | # 1 "<command line>" | |
419 | #define SIZEOF_INT 4 | |
420 | # 1 "<command line>" | |
421 | #define SIZEOF_LONG 4 | |
422 | # 1 "<command line>" | |
423 | #define SIZEOF_LONG_LONG 8 | |
424 | # 1 "<command line>" | |
425 | #define HAVE_INTTYPES_H 1 | |
426 | # 1 "<command line>" | |
427 | #define HAVE_INTPTR_T 1 | |
428 | # 1 "<command line>" | |
429 | #define HAVE_GETRUSAGE 1 | |
430 | # 1 "<command line>" | |
431 | #define HAVE_LLSEEK 1 | |
432 | # 1 "<command line>" | |
433 | #define HAVE_LSEEK64 1 | |
434 | # 1 "<command line>" | |
435 | #define HAVE_OPEN64 1 | |
436 | # 1 "<command line>" | |
437 | #define HAVE_FSTAT64 1 | |
438 | # 1 "<command line>" | |
439 | #define HAVE_STRTOULL 1 | |
440 | # 1 "<command line>" | |
441 | #define HAVE_STRCASECMP 1 | |
442 | # 1 "<command line>" | |
443 | #define HAVE_SRANDOM 1 | |
444 | # 1 "<command line>" | |
445 | #define HAVE_JRAND48 1 | |
446 | # 1 "<command line>" | |
447 | #define HAVE_FCHOWN 1 | |
448 | # 1 "<command line>" | |
449 | #define HAVE_MALLINFO 1 | |
450 | # 1 "<command line>" | |
451 | #define HAVE_FDATASYNC 1 | |
452 | # 1 "<command line>" | |
453 | #define HAVE_STRNLEN 1 | |
454 | # 1 "<command line>" | |
455 | #define HAVE_STRPTIME 1 | |
456 | # 1 "<command line>" | |
457 | #define HAVE_STRDUP 1 | |
458 | # 1 "<command line>" | |
459 | #define HAVE_SYSCONF 1 | |
460 | # 1 "<command line>" | |
461 | #define HAVE_PATHCONF 1 | |
462 | # 1 "<command line>" | |
463 | #define HAVE_POSIX_MEMALIGN 1 | |
464 | # 1 "<command line>" | |
465 | #define HAVE_MEMALIGN 1 | |
466 | # 1 "<command line>" | |
467 | #define HAVE_VALLOC 1 | |
468 | # 1 "<command line>" | |
469 | #define HAVE___SECURE_GETENV 1 | |
470 | # 1 "<command line>" | |
471 | #define HAVE_PRCTL 1 | |
472 | # 1 "<command line>" | |
473 | #define HAVE_MMAP 1 | |
474 | # 1 "<command line>" | |
475 | #define HAVE_UTIME 1 | |
476 | # 1 "<command line>" | |
477 | #define HAVE_SETRESUID 1 | |
478 | # 1 "<command line>" | |
479 | #define HAVE_SETRESGID 1 | |
480 | # 1 "<command line>" | |
481 | #define HAVE_DLOPEN 1 | |
482 | # 1 "<command line>" | |
483 | #define HAVE_EXT2_IOCTLS 1 | |
484 | # 1 "<command line>" | |
485 | #define RESOURCE_TRACK 1 | |
486 | # 1 "unix.c" | |
487 | # 12 "unix.c" | |
488 | # 1 "/usr/include/stdio.h" 1 3 4 | |
489 | # 27 "/usr/include/stdio.h" 3 4 | |
490 | #define _STDIO_H 1 | |
491 | # 1 "/usr/include/features.h" 1 3 4 | |
492 | # 20 "/usr/include/features.h" 3 4 | |
493 | #define _FEATURES_H 1 | |
494 | # 92 "/usr/include/features.h" 3 4 | |
495 | #undef __USE_ISOC99 | |
496 | #undef __USE_POSIX | |
497 | #undef __USE_POSIX2 | |
498 | #undef __USE_POSIX199309 | |
499 | #undef __USE_POSIX199506 | |
500 | #undef __USE_XOPEN | |
501 | #undef __USE_XOPEN_EXTENDED | |
502 | #undef __USE_UNIX98 | |
503 | #undef __USE_XOPEN2K | |
504 | #undef __USE_LARGEFILE | |
505 | #undef __USE_LARGEFILE64 | |
506 | #undef __USE_FILE_OFFSET64 | |
507 | #undef __USE_BSD | |
508 | #undef __USE_SVID | |
509 | #undef __USE_MISC | |
510 | #undef __USE_ATFILE | |
511 | #undef __USE_GNU | |
512 | #undef __USE_REENTRANT | |
513 | #undef __USE_FORTIFY_LEVEL | |
514 | #undef __FAVOR_BSD | |
515 | #undef __KERNEL_STRICT_NAMES | |
516 | ||
517 | ||
518 | ||
519 | ||
520 | #define __KERNEL_STRICT_NAMES | |
521 | ||
522 | ||
523 | ||
524 | #define __USE_ANSI 1 | |
525 | # 131 "/usr/include/features.h" 3 4 | |
526 | #define __GNUC_PREREQ(maj,min) ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min)) | |
527 | # 174 "/usr/include/features.h" 3 4 | |
528 | #define _BSD_SOURCE 1 | |
529 | #define _SVID_SOURCE 1 | |
530 | # 191 "/usr/include/features.h" 3 4 | |
531 | #define _POSIX_SOURCE 1 | |
532 | ||
533 | ||
534 | ||
535 | ||
536 | ||
537 | #define _POSIX_C_SOURCE 200112L | |
538 | ||
539 | ||
540 | ||
541 | ||
542 | #define __USE_POSIX 1 | |
543 | ||
544 | ||
545 | ||
546 | #define __USE_POSIX2 1 | |
547 | ||
548 | ||
549 | ||
550 | #define __USE_POSIX199309 1 | |
551 | ||
552 | ||
553 | ||
554 | #define __USE_POSIX199506 1 | |
555 | ||
556 | ||
557 | ||
558 | #define __USE_XOPEN2K 1 | |
559 | # 253 "/usr/include/features.h" 3 4 | |
560 | #define __USE_MISC 1 | |
561 | ||
562 | ||
563 | ||
564 | #define __USE_BSD 1 | |
565 | ||
566 | ||
567 | ||
568 | #define __USE_SVID 1 | |
569 | # 284 "/usr/include/features.h" 3 4 | |
570 | #define __USE_FORTIFY_LEVEL 0 | |
571 | ||
572 | ||
573 | ||
574 | #define __STDC_IEC_559__ 1 | |
575 | #define __STDC_IEC_559_COMPLEX__ 1 | |
576 | ||
577 | ||
578 | #define __STDC_ISO_10646__ 200009L | |
579 | ||
580 | ||
581 | ||
582 | ||
583 | ||
584 | ||
585 | ||
586 | #undef __GNU_LIBRARY__ | |
587 | #define __GNU_LIBRARY__ 6 | |
588 | ||
589 | ||
590 | ||
591 | #define __GLIBC__ 2 | |
592 | #define __GLIBC_MINOR__ 6 | |
593 | ||
594 | #define __GLIBC_PREREQ(maj,min) ((__GLIBC__ << 16) + __GLIBC_MINOR__ >= ((maj) << 16) + (min)) | |
595 | ||
596 | ||
597 | ||
598 | ||
599 | ||
600 | ||
601 | ||
602 | #define __GLIBC_HAVE_LONG_LONG 1 | |
603 | ||
604 | ||
605 | ||
606 | ||
607 | ||
608 | # 1 "/usr/include/sys/cdefs.h" 1 3 4 | |
609 | # 21 "/usr/include/sys/cdefs.h" 3 4 | |
610 | #define _SYS_CDEFS_H 1 | |
611 | # 36 "/usr/include/sys/cdefs.h" 3 4 | |
612 | #undef __P | |
613 | #undef __PMT | |
614 | # 47 "/usr/include/sys/cdefs.h" 3 4 | |
615 | #define __THROW __attribute__ ((__nothrow__)) | |
616 | #define __NTH(fct) __attribute__ ((__nothrow__)) fct | |
617 | # 74 "/usr/include/sys/cdefs.h" 3 4 | |
618 | #define __P(args) args | |
619 | #define __PMT(args) args | |
620 | ||
621 | ||
622 | ||
623 | ||
624 | #define __CONCAT(x,y) x ## y | |
625 | #define __STRING(x) #x | |
626 | ||
627 | ||
628 | #define __ptr_t void * | |
629 | #define __long_double_t long double | |
630 | ||
631 | ||
632 | ||
633 | ||
634 | ||
635 | ||
636 | ||
637 | #define __BEGIN_DECLS | |
638 | #define __END_DECLS | |
639 | # 114 "/usr/include/sys/cdefs.h" 3 4 | |
640 | #define __BEGIN_NAMESPACE_STD | |
641 | #define __END_NAMESPACE_STD | |
642 | #define __USING_NAMESPACE_STD(name) | |
643 | #define __BEGIN_NAMESPACE_C99 | |
644 | #define __END_NAMESPACE_C99 | |
645 | #define __USING_NAMESPACE_C99(name) | |
646 | ||
647 | ||
648 | ||
649 | ||
650 | ||
651 | #define __bounded | |
652 | #define __unbounded | |
653 | #define __ptrvalue | |
654 | ||
655 | ||
656 | ||
657 | ||
658 | #define __bos(ptr) __builtin_object_size (ptr, __USE_FORTIFY_LEVEL > 1) | |
659 | #define __bos0(ptr) __builtin_object_size (ptr, 0) | |
660 | #define __warndecl(name,msg) extern void name (void) | |
661 | ||
662 | ||
663 | ||
664 | ||
665 | ||
666 | #define __flexarr [] | |
667 | # 167 "/usr/include/sys/cdefs.h" 3 4 | |
668 | #define __REDIRECT(name,proto,alias) name proto __asm__ (__ASMNAME (#alias)) | |
669 | ||
670 | ||
671 | ||
672 | ||
673 | #define __REDIRECT_NTH(name,proto,alias) name proto __asm__ (__ASMNAME (#alias)) __THROW | |
674 | ||
675 | ||
676 | #define __ASMNAME(cname) __ASMNAME2 (__USER_LABEL_PREFIX__, cname) | |
677 | #define __ASMNAME2(prefix,cname) __STRING (prefix) cname | |
678 | # 197 "/usr/include/sys/cdefs.h" 3 4 | |
679 | #define __attribute_malloc__ __attribute__ ((__malloc__)) | |
680 | # 206 "/usr/include/sys/cdefs.h" 3 4 | |
681 | #define __attribute_pure__ __attribute__ ((__pure__)) | |
682 | # 215 "/usr/include/sys/cdefs.h" 3 4 | |
683 | #define __attribute_used__ __attribute__ ((__used__)) | |
684 | #define __attribute_noinline__ __attribute__ ((__noinline__)) | |
685 | ||
686 | ||
687 | ||
688 | ||
689 | ||
690 | ||
691 | ||
692 | #define __attribute_deprecated__ __attribute__ ((__deprecated__)) | |
693 | # 236 "/usr/include/sys/cdefs.h" 3 4 | |
694 | #define __attribute_format_arg__(x) __attribute__ ((__format_arg__ (x))) | |
695 | # 246 "/usr/include/sys/cdefs.h" 3 4 | |
696 | #define __attribute_format_strfmon__(a,b) __attribute__ ((__format__ (__strfmon__, a, b))) | |
697 | # 255 "/usr/include/sys/cdefs.h" 3 4 | |
698 | #define __nonnull(params) __attribute__ ((__nonnull__ params)) | |
699 | ||
700 | ||
701 | ||
702 | ||
703 | ||
704 | ||
705 | ||
706 | #define __attribute_warn_unused_result__ __attribute__ ((__warn_unused_result__)) | |
707 | # 272 "/usr/include/sys/cdefs.h" 3 4 | |
708 | #define __wur | |
709 | ||
710 | ||
711 | ||
712 | ||
713 | #define __always_inline __inline __attribute__ ((__always_inline__)) | |
714 | # 289 "/usr/include/sys/cdefs.h" 3 4 | |
715 | #define __extern_inline extern __inline | |
716 | #define __extern_always_inline extern __always_inline | |
717 | # 310 "/usr/include/sys/cdefs.h" 3 4 | |
718 | #define __restrict_arr __restrict | |
719 | # 324 "/usr/include/sys/cdefs.h" 3 4 | |
720 | # 1 "/usr/include/bits/wordsize.h" 1 3 4 | |
721 | # 19 "/usr/include/bits/wordsize.h" 3 4 | |
722 | #define __WORDSIZE 32 | |
723 | # 325 "/usr/include/sys/cdefs.h" 2 3 4 | |
724 | # 342 "/usr/include/sys/cdefs.h" 3 4 | |
725 | #define __LDBL_REDIR1(name,proto,alias) name proto | |
726 | #define __LDBL_REDIR(name,proto) name proto | |
727 | #define __LDBL_REDIR1_NTH(name,proto,alias) name proto __THROW | |
728 | #define __LDBL_REDIR_NTH(name,proto) name proto __THROW | |
729 | #define __LDBL_REDIR_DECL(name) | |
730 | # 323 "/usr/include/features.h" 2 3 4 | |
731 | # 337 "/usr/include/features.h" 3 4 | |
732 | #define __USE_EXTERN_INLINES 1 | |
733 | ||
734 | ||
735 | ||
736 | ||
737 | ||
738 | ||
739 | ||
740 | # 1 "/usr/include/gnu/stubs.h" 1 3 4 | |
741 | ||
742 | ||
743 | ||
744 | # 1 "/usr/include/bits/wordsize.h" 1 3 4 | |
745 | # 19 "/usr/include/bits/wordsize.h" 3 4 | |
746 | #define __WORDSIZE 32 | |
747 | # 5 "/usr/include/gnu/stubs.h" 2 3 4 | |
748 | ||
749 | ||
750 | # 1 "/usr/include/gnu/stubs-32.h" 1 3 4 | |
751 | # 10 "/usr/include/gnu/stubs-32.h" 3 4 | |
752 | #define __stub___kernel_cosl | |
753 | #define __stub___kernel_sinl | |
754 | #define __stub___kernel_tanl | |
755 | #define __stub_chflags | |
756 | #define __stub_fattach | |
757 | #define __stub_fchflags | |
758 | #define __stub_fdetach | |
759 | #define __stub_gtty | |
760 | #define __stub_lchmod | |
761 | #define __stub_revoke | |
762 | #define __stub_setlogin | |
763 | #define __stub_sigreturn | |
764 | #define __stub_sstk | |
765 | #define __stub_stty | |
766 | # 8 "/usr/include/gnu/stubs.h" 2 3 4 | |
767 | # 346 "/usr/include/features.h" 2 3 4 | |
768 | # 29 "/usr/include/stdio.h" 2 3 4 | |
769 | ||
770 | ||
771 | ||
772 | #define __need_size_t | |
773 | #define __need_NULL | |
774 | # 1 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/stddef.h" 1 3 4 | |
775 | # 189 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/stddef.h" 3 4 | |
776 | #define __size_t__ | |
777 | #define __SIZE_T__ | |
778 | #define _SIZE_T | |
779 | #define _SYS_SIZE_T_H | |
780 | #define _T_SIZE_ | |
781 | #define _T_SIZE | |
782 | #define __SIZE_T | |
783 | #define _SIZE_T_ | |
784 | #define _BSD_SIZE_T_ | |
785 | #define _SIZE_T_DEFINED_ | |
786 | #define _SIZE_T_DEFINED | |
787 | #define _BSD_SIZE_T_DEFINED_ | |
788 | #define _SIZE_T_DECLARED | |
789 | #define ___int_size_t_h | |
790 | #define _GCC_SIZE_T | |
791 | #define _SIZET_ | |
792 | ||
793 | ||
794 | ||
795 | #define __size_t | |
796 | ||
797 | ||
798 | ||
799 | ||
800 | ||
801 | typedef unsigned int size_t; | |
802 | # 236 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/stddef.h" 3 4 | |
803 | #undef __need_size_t | |
804 | # 398 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/stddef.h" 3 4 | |
805 | #undef NULL | |
806 | ||
807 | ||
808 | ||
809 | ||
810 | #define NULL ((void *)0) | |
811 | ||
812 | ||
813 | ||
814 | ||
815 | ||
816 | #undef __need_NULL | |
817 | # 35 "/usr/include/stdio.h" 2 3 4 | |
818 | ||
819 | # 1 "/usr/include/bits/types.h" 1 3 4 | |
820 | # 25 "/usr/include/bits/types.h" 3 4 | |
821 | #define _BITS_TYPES_H 1 | |
822 | ||
823 | ||
824 | # 1 "/usr/include/bits/wordsize.h" 1 3 4 | |
825 | # 19 "/usr/include/bits/wordsize.h" 3 4 | |
826 | #define __WORDSIZE 32 | |
827 | # 29 "/usr/include/bits/types.h" 2 3 4 | |
828 | ||
829 | #define __need_size_t | |
830 | # 1 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/stddef.h" 1 3 4 | |
831 | # 236 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/stddef.h" 3 4 | |
832 | #undef __need_size_t | |
833 | # 409 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/stddef.h" 3 4 | |
834 | #undef __need_NULL | |
835 | # 32 "/usr/include/bits/types.h" 2 3 4 | |
836 | ||
837 | ||
838 | typedef unsigned char __u_char; | |
839 | typedef unsigned short int __u_short; | |
840 | typedef unsigned int __u_int; | |
841 | typedef unsigned long int __u_long; | |
842 | ||
843 | ||
844 | typedef signed char __int8_t; | |
845 | typedef unsigned char __uint8_t; | |
846 | typedef signed short int __int16_t; | |
847 | typedef unsigned short int __uint16_t; | |
848 | typedef signed int __int32_t; | |
849 | typedef unsigned int __uint32_t; | |
850 | ||
851 | ||
852 | ||
853 | ||
854 | __extension__ typedef signed long long int __int64_t; | |
855 | __extension__ typedef unsigned long long int __uint64_t; | |
856 | ||
857 | ||
858 | ||
859 | ||
860 | ||
861 | ||
862 | ||
863 | __extension__ typedef long long int __quad_t; | |
864 | __extension__ typedef unsigned long long int __u_quad_t; | |
865 | # 102 "/usr/include/bits/types.h" 3 4 | |
866 | #define __S16_TYPE short int | |
867 | #define __U16_TYPE unsigned short int | |
868 | #define __S32_TYPE int | |
869 | #define __U32_TYPE unsigned int | |
870 | #define __SLONGWORD_TYPE long int | |
871 | #define __ULONGWORD_TYPE unsigned long int | |
872 | ||
873 | #define __SQUAD_TYPE __quad_t | |
874 | #define __UQUAD_TYPE __u_quad_t | |
875 | #define __SWORD_TYPE int | |
876 | #define __UWORD_TYPE unsigned int | |
877 | #define __SLONG32_TYPE long int | |
878 | #define __ULONG32_TYPE unsigned long int | |
879 | #define __S64_TYPE __quad_t | |
880 | #define __U64_TYPE __u_quad_t | |
881 | ||
882 | ||
883 | #define __STD_TYPE __extension__ typedef | |
884 | # 134 "/usr/include/bits/types.h" 3 4 | |
885 | # 1 "/usr/include/bits/typesizes.h" 1 3 4 | |
886 | # 25 "/usr/include/bits/typesizes.h" 3 4 | |
887 | #define _BITS_TYPESIZES_H 1 | |
888 | ||
889 | ||
890 | ||
891 | ||
892 | #define __DEV_T_TYPE __UQUAD_TYPE | |
893 | #define __UID_T_TYPE __U32_TYPE | |
894 | #define __GID_T_TYPE __U32_TYPE | |
895 | #define __INO_T_TYPE __ULONGWORD_TYPE | |
896 | #define __INO64_T_TYPE __UQUAD_TYPE | |
897 | #define __MODE_T_TYPE __U32_TYPE | |
898 | #define __NLINK_T_TYPE __UWORD_TYPE | |
899 | #define __OFF_T_TYPE __SLONGWORD_TYPE | |
900 | #define __OFF64_T_TYPE __SQUAD_TYPE | |
901 | #define __PID_T_TYPE __S32_TYPE | |
902 | #define __RLIM_T_TYPE __ULONGWORD_TYPE | |
903 | #define __RLIM64_T_TYPE __UQUAD_TYPE | |
904 | #define __BLKCNT_T_TYPE __SLONGWORD_TYPE | |
905 | #define __BLKCNT64_T_TYPE __SQUAD_TYPE | |
906 | #define __FSBLKCNT_T_TYPE __ULONGWORD_TYPE | |
907 | #define __FSBLKCNT64_T_TYPE __UQUAD_TYPE | |
908 | #define __FSFILCNT_T_TYPE __ULONGWORD_TYPE | |
909 | #define __FSFILCNT64_T_TYPE __UQUAD_TYPE | |
910 | #define __ID_T_TYPE __U32_TYPE | |
911 | #define __CLOCK_T_TYPE __SLONGWORD_TYPE | |
912 | #define __TIME_T_TYPE __SLONGWORD_TYPE | |
913 | #define __USECONDS_T_TYPE __U32_TYPE | |
914 | #define __SUSECONDS_T_TYPE __SLONGWORD_TYPE | |
915 | #define __DADDR_T_TYPE __S32_TYPE | |
916 | #define __SWBLK_T_TYPE __SLONGWORD_TYPE | |
917 | #define __KEY_T_TYPE __S32_TYPE | |
918 | #define __CLOCKID_T_TYPE __S32_TYPE | |
919 | #define __TIMER_T_TYPE void * | |
920 | #define __BLKSIZE_T_TYPE __SLONGWORD_TYPE | |
921 | #define __FSID_T_TYPE struct { int __val[2]; } | |
922 | #define __SSIZE_T_TYPE __SWORD_TYPE | |
923 | ||
924 | ||
925 | #define __FD_SETSIZE 1024 | |
926 | # 135 "/usr/include/bits/types.h" 2 3 4 | |
927 | ||
928 | ||
929 | __extension__ typedef __u_quad_t __dev_t; | |
930 | __extension__ typedef unsigned int __uid_t; | |
931 | __extension__ typedef unsigned int __gid_t; | |
932 | __extension__ typedef unsigned long int __ino_t; | |
933 | __extension__ typedef __u_quad_t __ino64_t; | |
934 | __extension__ typedef unsigned int __mode_t; | |
935 | __extension__ typedef unsigned int __nlink_t; | |
936 | __extension__ typedef long int __off_t; | |
937 | __extension__ typedef __quad_t __off64_t; | |
938 | __extension__ typedef int __pid_t; | |
939 | __extension__ typedef struct { int __val[2]; } __fsid_t; | |
940 | __extension__ typedef long int __clock_t; | |
941 | __extension__ typedef unsigned long int __rlim_t; | |
942 | __extension__ typedef __u_quad_t __rlim64_t; | |
943 | __extension__ typedef unsigned int __id_t; | |
944 | __extension__ typedef long int __time_t; | |
945 | __extension__ typedef unsigned int __useconds_t; | |
946 | __extension__ typedef long int __suseconds_t; | |
947 | ||
948 | __extension__ typedef int __daddr_t; | |
949 | __extension__ typedef long int __swblk_t; | |
950 | __extension__ typedef int __key_t; | |
951 | ||
952 | ||
953 | __extension__ typedef int __clockid_t; | |
954 | ||
955 | ||
956 | __extension__ typedef void * __timer_t; | |
957 | ||
958 | ||
959 | __extension__ typedef long int __blksize_t; | |
960 | ||
961 | ||
962 | ||
963 | ||
964 | __extension__ typedef long int __blkcnt_t; | |
965 | __extension__ typedef __quad_t __blkcnt64_t; | |
966 | ||
967 | ||
968 | __extension__ typedef unsigned long int __fsblkcnt_t; | |
969 | __extension__ typedef __u_quad_t __fsblkcnt64_t; | |
970 | ||
971 | ||
972 | __extension__ typedef unsigned long int __fsfilcnt_t; | |
973 | __extension__ typedef __u_quad_t __fsfilcnt64_t; | |
974 | ||
975 | __extension__ typedef int __ssize_t; | |
976 | ||
977 | ||
978 | ||
979 | typedef __off64_t __loff_t; | |
980 | typedef __quad_t *__qaddr_t; | |
981 | typedef char *__caddr_t; | |
982 | ||
983 | ||
984 | __extension__ typedef int __intptr_t; | |
985 | ||
986 | ||
987 | __extension__ typedef unsigned int __socklen_t; | |
988 | ||
989 | ||
990 | #undef __STD_TYPE | |
991 | # 37 "/usr/include/stdio.h" 2 3 4 | |
992 | #define __need_FILE | |
993 | #define __need___FILE | |
994 | ||
995 | ||
996 | ||
997 | ||
998 | ||
999 | ||
1000 | struct _IO_FILE; | |
1001 | ||
1002 | ||
1003 | ||
1004 | typedef struct _IO_FILE FILE; | |
1005 | ||
1006 | ||
1007 | ||
1008 | ||
1009 | ||
1010 | ||
1011 | ||
1012 | #define __FILE_defined 1 | |
1013 | ||
1014 | #undef __need_FILE | |
1015 | ||
1016 | ||
1017 | ||
1018 | ||
1019 | ||
1020 | typedef struct _IO_FILE __FILE; | |
1021 | ||
1022 | #define ____FILE_defined 1 | |
1023 | ||
1024 | #undef __need___FILE | |
1025 | ||
1026 | ||
1027 | ||
1028 | #define _STDIO_USES_IOSTREAM | |
1029 | ||
1030 | # 1 "/usr/include/libio.h" 1 3 4 | |
1031 | # 30 "/usr/include/libio.h" 3 4 | |
1032 | #define _IO_STDIO_H | |
1033 | ||
1034 | # 1 "/usr/include/_G_config.h" 1 3 4 | |
1035 | ||
1036 | ||
1037 | ||
1038 | ||
1039 | #define _G_config_h 1 | |
1040 | ||
1041 | ||
1042 | ||
1043 | ||
1044 | #define __need_size_t | |
1045 | #define __need_wchar_t | |
1046 | #define __need_wint_t | |
1047 | #define __need_NULL | |
1048 | # 1 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/stddef.h" 1 3 4 | |
1049 | # 236 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/stddef.h" 3 4 | |
1050 | #undef __need_size_t | |
1051 | # 265 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/stddef.h" 3 4 | |
1052 | #define __wchar_t__ | |
1053 | #define __WCHAR_T__ | |
1054 | #define _WCHAR_T | |
1055 | #define _T_WCHAR_ | |
1056 | #define _T_WCHAR | |
1057 | #define __WCHAR_T | |
1058 | #define _WCHAR_T_ | |
1059 | #define _BSD_WCHAR_T_ | |
1060 | #define _WCHAR_T_DEFINED_ | |
1061 | #define _WCHAR_T_DEFINED | |
1062 | #define _WCHAR_T_H | |
1063 | #define ___int_wchar_t_h | |
1064 | #define __INT_WCHAR_T_H | |
1065 | #define _GCC_WCHAR_T | |
1066 | #define _WCHAR_T_DECLARED | |
1067 | # 292 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/stddef.h" 3 4 | |
1068 | #undef _BSD_WCHAR_T_ | |
1069 | # 326 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/stddef.h" 3 4 | |
1070 | typedef long int wchar_t; | |
1071 | # 345 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/stddef.h" 3 4 | |
1072 | #undef __need_wchar_t | |
1073 | ||
1074 | ||
1075 | ||
1076 | ||
1077 | #define _WINT_T | |
1078 | ||
1079 | ||
1080 | ||
1081 | ||
1082 | typedef unsigned int wint_t; | |
1083 | ||
1084 | #undef __need_wint_t | |
1085 | # 398 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/stddef.h" 3 4 | |
1086 | #undef NULL | |
1087 | ||
1088 | ||
1089 | ||
1090 | ||
1091 | #define NULL ((void *)0) | |
1092 | ||
1093 | ||
1094 | ||
1095 | ||
1096 | ||
1097 | #undef __need_NULL | |
1098 | # 15 "/usr/include/_G_config.h" 2 3 4 | |
1099 | # 23 "/usr/include/_G_config.h" 3 4 | |
1100 | #define __need_mbstate_t | |
1101 | # 1 "/usr/include/wchar.h" 1 3 4 | |
1102 | # 47 "/usr/include/wchar.h" 3 4 | |
1103 | #define __need_wint_t | |
1104 | # 1 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/stddef.h" 1 3 4 | |
1105 | # 357 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/stddef.h" 3 4 | |
1106 | #undef __need_wint_t | |
1107 | # 409 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/stddef.h" 3 4 | |
1108 | #undef __need_NULL | |
1109 | # 49 "/usr/include/wchar.h" 2 3 4 | |
1110 | ||
1111 | # 1 "/usr/include/bits/wchar.h" 1 3 4 | |
1112 | # 21 "/usr/include/bits/wchar.h" 3 4 | |
1113 | #define _BITS_WCHAR_H 1 | |
1114 | ||
1115 | #define __WCHAR_MIN (-2147483647l - 1l) | |
1116 | #define __WCHAR_MAX (2147483647l) | |
1117 | # 51 "/usr/include/wchar.h" 2 3 4 | |
1118 | # 74 "/usr/include/wchar.h" 3 4 | |
1119 | #define __mbstate_t_defined 1 | |
1120 | ||
1121 | typedef struct | |
1122 | { | |
1123 | int __count; | |
1124 | union | |
1125 | { | |
1126 | wint_t __wch; | |
1127 | char __wchb[4]; | |
1128 | } __value; | |
1129 | } __mbstate_t; | |
1130 | ||
1131 | #undef __need_mbstate_t | |
1132 | # 25 "/usr/include/_G_config.h" 2 3 4 | |
1133 | #define _G_size_t size_t | |
1134 | typedef struct | |
1135 | { | |
1136 | __off_t __pos; | |
1137 | __mbstate_t __state; | |
1138 | } _G_fpos_t; | |
1139 | typedef struct | |
1140 | { | |
1141 | __off64_t __pos; | |
1142 | __mbstate_t __state; | |
1143 | } _G_fpos64_t; | |
1144 | #define _G_ssize_t __ssize_t | |
1145 | #define _G_off_t __off_t | |
1146 | #define _G_off64_t __off64_t | |
1147 | #define _G_pid_t __pid_t | |
1148 | #define _G_uid_t __uid_t | |
1149 | #define _G_wchar_t wchar_t | |
1150 | #define _G_wint_t wint_t | |
1151 | #define _G_stat64 stat64 | |
1152 | # 1 "/usr/include/gconv.h" 1 3 4 | |
1153 | # 24 "/usr/include/gconv.h" 3 4 | |
1154 | #define _GCONV_H 1 | |
1155 | ||
1156 | ||
1157 | #define __need_mbstate_t | |
1158 | # 1 "/usr/include/wchar.h" 1 3 4 | |
1159 | # 47 "/usr/include/wchar.h" 3 4 | |
1160 | #define __need_wint_t | |
1161 | # 1 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/stddef.h" 1 3 4 | |
1162 | # 357 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/stddef.h" 3 4 | |
1163 | #undef __need_wint_t | |
1164 | # 409 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/stddef.h" 3 4 | |
1165 | #undef __need_NULL | |
1166 | # 49 "/usr/include/wchar.h" 2 3 4 | |
1167 | # 86 "/usr/include/wchar.h" 3 4 | |
1168 | #undef __need_mbstate_t | |
1169 | # 29 "/usr/include/gconv.h" 2 3 4 | |
1170 | #define __need_size_t | |
1171 | #define __need_wchar_t | |
1172 | # 1 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/stddef.h" 1 3 4 | |
1173 | # 236 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/stddef.h" 3 4 | |
1174 | #undef __need_size_t | |
1175 | # 345 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/stddef.h" 3 4 | |
1176 | #undef __need_wchar_t | |
1177 | # 409 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/stddef.h" 3 4 | |
1178 | #undef __need_NULL | |
1179 | # 32 "/usr/include/gconv.h" 2 3 4 | |
1180 | ||
1181 | ||
1182 | #define __UNKNOWN_10646_CHAR ((wchar_t) 0xfffd) | |
1183 | ||
1184 | ||
1185 | enum | |
1186 | { | |
1187 | __GCONV_OK = 0, | |
1188 | __GCONV_NOCONV, | |
1189 | __GCONV_NODB, | |
1190 | __GCONV_NOMEM, | |
1191 | ||
1192 | __GCONV_EMPTY_INPUT, | |
1193 | __GCONV_FULL_OUTPUT, | |
1194 | __GCONV_ILLEGAL_INPUT, | |
1195 | __GCONV_INCOMPLETE_INPUT, | |
1196 | ||
1197 | __GCONV_ILLEGAL_DESCRIPTOR, | |
1198 | __GCONV_INTERNAL_ERROR | |
1199 | }; | |
1200 | ||
1201 | ||
1202 | ||
1203 | enum | |
1204 | { | |
1205 | __GCONV_IS_LAST = 0x0001, | |
1206 | __GCONV_IGNORE_ERRORS = 0x0002 | |
1207 | }; | |
1208 | ||
1209 | ||
1210 | ||
1211 | struct __gconv_step; | |
1212 | struct __gconv_step_data; | |
1213 | struct __gconv_loaded_object; | |
1214 | struct __gconv_trans_data; | |
1215 | ||
1216 | ||
1217 | ||
1218 | typedef int (*__gconv_fct) (struct __gconv_step *, struct __gconv_step_data *, | |
1219 | __const unsigned char **, __const unsigned char *, | |
1220 | unsigned char **, size_t *, int, int); | |
1221 | ||
1222 | ||
1223 | typedef wint_t (*__gconv_btowc_fct) (struct __gconv_step *, unsigned char); | |
1224 | ||
1225 | ||
1226 | typedef int (*__gconv_init_fct) (struct __gconv_step *); | |
1227 | typedef void (*__gconv_end_fct) (struct __gconv_step *); | |
1228 | ||
1229 | ||
1230 | ||
1231 | typedef int (*__gconv_trans_fct) (struct __gconv_step *, | |
1232 | struct __gconv_step_data *, void *, | |
1233 | __const unsigned char *, | |
1234 | __const unsigned char **, | |
1235 | __const unsigned char *, unsigned char **, | |
1236 | size_t *); | |
1237 | ||
1238 | ||
1239 | typedef int (*__gconv_trans_context_fct) (void *, __const unsigned char *, | |
1240 | __const unsigned char *, | |
1241 | unsigned char *, unsigned char *); | |
1242 | ||
1243 | ||
1244 | typedef int (*__gconv_trans_query_fct) (__const char *, __const char ***, | |
1245 | size_t *); | |
1246 | ||
1247 | ||
1248 | typedef int (*__gconv_trans_init_fct) (void **, const char *); | |
1249 | typedef void (*__gconv_trans_end_fct) (void *); | |
1250 | ||
1251 | struct __gconv_trans_data | |
1252 | { | |
1253 | ||
1254 | __gconv_trans_fct __trans_fct; | |
1255 | __gconv_trans_context_fct __trans_context_fct; | |
1256 | __gconv_trans_end_fct __trans_end_fct; | |
1257 | void *__data; | |
1258 | struct __gconv_trans_data *__next; | |
1259 | }; | |
1260 | ||
1261 | ||
1262 | ||
1263 | struct __gconv_step | |
1264 | { | |
1265 | struct __gconv_loaded_object *__shlib_handle; | |
1266 | __const char *__modname; | |
1267 | ||
1268 | int __counter; | |
1269 | ||
1270 | char *__from_name; | |
1271 | char *__to_name; | |
1272 | ||
1273 | __gconv_fct __fct; | |
1274 | __gconv_btowc_fct __btowc_fct; | |
1275 | __gconv_init_fct __init_fct; | |
1276 | __gconv_end_fct __end_fct; | |
1277 | ||
1278 | ||
1279 | ||
1280 | int __min_needed_from; | |
1281 | int __max_needed_from; | |
1282 | int __min_needed_to; | |
1283 | int __max_needed_to; | |
1284 | ||
1285 | ||
1286 | int __stateful; | |
1287 | ||
1288 | void *__data; | |
1289 | }; | |
1290 | ||
1291 | ||
1292 | ||
1293 | struct __gconv_step_data | |
1294 | { | |
1295 | unsigned char *__outbuf; | |
1296 | unsigned char *__outbufend; | |
1297 | ||
1298 | ||
1299 | ||
1300 | int __flags; | |
1301 | ||
1302 | ||
1303 | ||
1304 | int __invocation_counter; | |
1305 | ||
1306 | ||
1307 | ||
1308 | int __internal_use; | |
1309 | ||
1310 | __mbstate_t *__statep; | |
1311 | __mbstate_t __state; | |
1312 | ||
1313 | ||
1314 | ||
1315 | struct __gconv_trans_data *__trans; | |
1316 | }; | |
1317 | ||
1318 | ||
1319 | ||
1320 | typedef struct __gconv_info | |
1321 | { | |
1322 | size_t __nsteps; | |
1323 | struct __gconv_step *__steps; | |
1324 | __extension__ struct __gconv_step_data __data []; | |
1325 | } *__gconv_t; | |
1326 | # 45 "/usr/include/_G_config.h" 2 3 4 | |
1327 | typedef union | |
1328 | { | |
1329 | struct __gconv_info __cd; | |
1330 | struct | |
1331 | { | |
1332 | struct __gconv_info __cd; | |
1333 | struct __gconv_step_data __data; | |
1334 | } __combined; | |
1335 | } _G_iconv_t; | |
1336 | ||
1337 | typedef int _G_int16_t __attribute__ ((__mode__ (__HI__))); | |
1338 | typedef int _G_int32_t __attribute__ ((__mode__ (__SI__))); | |
1339 | typedef unsigned int _G_uint16_t __attribute__ ((__mode__ (__HI__))); | |
1340 | typedef unsigned int _G_uint32_t __attribute__ ((__mode__ (__SI__))); | |
1341 | ||
1342 | #define _G_HAVE_BOOL 1 | |
1343 | ||
1344 | ||
1345 | ||
1346 | #define _G_HAVE_ATEXIT 1 | |
1347 | #define _G_HAVE_SYS_CDEFS 1 | |
1348 | #define _G_HAVE_SYS_WAIT 1 | |
1349 | #define _G_NEED_STDARG_H 1 | |
1350 | #define _G_va_list __gnuc_va_list | |
1351 | ||
1352 | #define _G_HAVE_PRINTF_FP 1 | |
1353 | #define _G_HAVE_MMAP 1 | |
1354 | #define _G_HAVE_MREMAP 1 | |
1355 | #define _G_HAVE_LONG_DOUBLE_IO 1 | |
1356 | #define _G_HAVE_IO_FILE_OPEN 1 | |
1357 | #define _G_HAVE_IO_GETLINE_INFO 1 | |
1358 | ||
1359 | #define _G_IO_IO_FILE_VERSION 0x20001 | |
1360 | ||
1361 | #define _G_OPEN64 __open64 | |
1362 | #define _G_LSEEK64 __lseek64 | |
1363 | #define _G_MMAP64 __mmap64 | |
1364 | #define _G_FSTAT64(fd,buf) __fxstat64 (_STAT_VER, fd, buf) | |
1365 | ||
1366 | ||
1367 | #define _G_HAVE_ST_BLKSIZE defined (_STATBUF_ST_BLKSIZE) | |
1368 | ||
1369 | #define _G_BUFSIZ 8192 | |
1370 | ||
1371 | ||
1372 | #define _G_NAMES_HAVE_UNDERSCORE 0 | |
1373 | #define _G_VTABLE_LABEL_HAS_LENGTH 1 | |
1374 | #define _G_USING_THUNKS 1 | |
1375 | #define _G_VTABLE_LABEL_PREFIX "__vt_" | |
1376 | #define _G_VTABLE_LABEL_PREFIX_ID __vt_ | |
1377 | ||
1378 | ||
1379 | ||
1380 | #define _G_ARGS(ARGLIST) ARGLIST | |
1381 | # 33 "/usr/include/libio.h" 2 3 4 | |
1382 | ||
1383 | #define _IO_pos_t _G_fpos_t | |
1384 | #define _IO_fpos_t _G_fpos_t | |
1385 | #define _IO_fpos64_t _G_fpos64_t | |
1386 | #define _IO_size_t _G_size_t | |
1387 | #define _IO_ssize_t _G_ssize_t | |
1388 | #define _IO_off_t _G_off_t | |
1389 | #define _IO_off64_t _G_off64_t | |
1390 | #define _IO_pid_t _G_pid_t | |
1391 | #define _IO_uid_t _G_uid_t | |
1392 | #define _IO_iconv_t _G_iconv_t | |
1393 | #define _IO_HAVE_SYS_WAIT _G_HAVE_SYS_WAIT | |
1394 | #define _IO_HAVE_ST_BLKSIZE _G_HAVE_ST_BLKSIZE | |
1395 | #define _IO_BUFSIZ _G_BUFSIZ | |
1396 | #define _IO_va_list _G_va_list | |
1397 | #define _IO_wint_t _G_wint_t | |
1398 | ||
1399 | ||
1400 | ||
1401 | #define __need___va_list | |
1402 | # 1 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/stdarg.h" 1 3 4 | |
1403 | # 37 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/stdarg.h" 3 4 | |
1404 | #undef __need___va_list | |
1405 | ||
1406 | ||
1407 | ||
1408 | ||
1409 | #define __GNUC_VA_LIST | |
1410 | typedef __builtin_va_list __gnuc_va_list; | |
1411 | # 54 "/usr/include/libio.h" 2 3 4 | |
1412 | ||
1413 | #undef _IO_va_list | |
1414 | #define _IO_va_list __gnuc_va_list | |
1415 | # 76 "/usr/include/libio.h" 3 4 | |
1416 | #define _PARAMS(protos) __P(protos) | |
1417 | ||
1418 | ||
1419 | ||
1420 | ||
1421 | ||
1422 | ||
1423 | ||
1424 | #define _IO_UNIFIED_JUMPTABLES 1 | |
1425 | ||
1426 | ||
1427 | ||
1428 | ||
1429 | ||
1430 | #define EOF (-1) | |
1431 | # 105 "/usr/include/libio.h" 3 4 | |
1432 | #define _IOS_INPUT 1 | |
1433 | #define _IOS_OUTPUT 2 | |
1434 | #define _IOS_ATEND 4 | |
1435 | #define _IOS_APPEND 8 | |
1436 | #define _IOS_TRUNC 16 | |
1437 | #define _IOS_NOCREATE 32 | |
1438 | #define _IOS_NOREPLACE 64 | |
1439 | #define _IOS_BIN 128 | |
1440 | ||
1441 | ||
1442 | ||
1443 | ||
1444 | ||
1445 | ||
1446 | ||
1447 | #define _IO_MAGIC 0xFBAD0000 | |
1448 | #define _OLD_STDIO_MAGIC 0xFABC0000 | |
1449 | #define _IO_MAGIC_MASK 0xFFFF0000 | |
1450 | #define _IO_USER_BUF 1 | |
1451 | #define _IO_UNBUFFERED 2 | |
1452 | #define _IO_NO_READS 4 | |
1453 | #define _IO_NO_WRITES 8 | |
1454 | #define _IO_EOF_SEEN 0x10 | |
1455 | #define _IO_ERR_SEEN 0x20 | |
1456 | #define _IO_DELETE_DONT_CLOSE 0x40 | |
1457 | #define _IO_LINKED 0x80 | |
1458 | #define _IO_IN_BACKUP 0x100 | |
1459 | #define _IO_LINE_BUF 0x200 | |
1460 | #define _IO_TIED_PUT_GET 0x400 | |
1461 | #define _IO_CURRENTLY_PUTTING 0x800 | |
1462 | #define _IO_IS_APPENDING 0x1000 | |
1463 | #define _IO_IS_FILEBUF 0x2000 | |
1464 | #define _IO_BAD_SEEN 0x4000 | |
1465 | #define _IO_USER_LOCK 0x8000 | |
1466 | ||
1467 | #define _IO_FLAGS2_MMAP 1 | |
1468 | #define _IO_FLAGS2_NOTCANCEL 2 | |
1469 | ||
1470 | ||
1471 | ||
1472 | #define _IO_FLAGS2_USER_WBUF 8 | |
1473 | ||
1474 | ||
1475 | #define _IO_SKIPWS 01 | |
1476 | #define _IO_LEFT 02 | |
1477 | #define _IO_RIGHT 04 | |
1478 | #define _IO_INTERNAL 010 | |
1479 | #define _IO_DEC 020 | |
1480 | #define _IO_OCT 040 | |
1481 | #define _IO_HEX 0100 | |
1482 | #define _IO_SHOWBASE 0200 | |
1483 | #define _IO_SHOWPOINT 0400 | |
1484 | #define _IO_UPPERCASE 01000 | |
1485 | #define _IO_SHOWPOS 02000 | |
1486 | #define _IO_SCIENTIFIC 04000 | |
1487 | #define _IO_FIXED 010000 | |
1488 | #define _IO_UNITBUF 020000 | |
1489 | #define _IO_STDIO 040000 | |
1490 | #define _IO_DONT_CLOSE 0100000 | |
1491 | #define _IO_BOOLALPHA 0200000 | |
1492 | ||
1493 | ||
1494 | struct _IO_jump_t; struct _IO_FILE; | |
1495 | # 177 "/usr/include/libio.h" 3 4 | |
1496 | typedef void _IO_lock_t; | |
1497 | ||
1498 | ||
1499 | ||
1500 | ||
1501 | ||
1502 | struct _IO_marker { | |
1503 | struct _IO_marker *_next; | |
1504 | struct _IO_FILE *_sbuf; | |
1505 | ||
1506 | ||
1507 | ||
1508 | int _pos; | |
1509 | # 200 "/usr/include/libio.h" 3 4 | |
1510 | }; | |
1511 | ||
1512 | ||
1513 | enum __codecvt_result | |
1514 | { | |
1515 | __codecvt_ok, | |
1516 | __codecvt_partial, | |
1517 | __codecvt_error, | |
1518 | __codecvt_noconv | |
1519 | }; | |
1520 | # 268 "/usr/include/libio.h" 3 4 | |
1521 | struct _IO_FILE { | |
1522 | int _flags; | |
1523 | #define _IO_file_flags _flags | |
1524 | ||
1525 | ||
1526 | ||
1527 | char* _IO_read_ptr; | |
1528 | char* _IO_read_end; | |
1529 | char* _IO_read_base; | |
1530 | char* _IO_write_base; | |
1531 | char* _IO_write_ptr; | |
1532 | char* _IO_write_end; | |
1533 | char* _IO_buf_base; | |
1534 | char* _IO_buf_end; | |
1535 | ||
1536 | char *_IO_save_base; | |
1537 | char *_IO_backup_base; | |
1538 | char *_IO_save_end; | |
1539 | ||
1540 | struct _IO_marker *_markers; | |
1541 | ||
1542 | struct _IO_FILE *_chain; | |
1543 | ||
1544 | int _fileno; | |
1545 | ||
1546 | ||
1547 | ||
1548 | int _flags2; | |
1549 | ||
1550 | __off_t _old_offset; | |
1551 | ||
1552 | #define __HAVE_COLUMN | |
1553 | ||
1554 | unsigned short _cur_column; | |
1555 | signed char _vtable_offset; | |
1556 | char _shortbuf[1]; | |
1557 | ||
1558 | ||
1559 | ||
1560 | _IO_lock_t *_lock; | |
1561 | # 316 "/usr/include/libio.h" 3 4 | |
1562 | __off64_t _offset; | |
1563 | # 325 "/usr/include/libio.h" 3 4 | |
1564 | void *__pad1; | |
1565 | void *__pad2; | |
1566 | void *__pad3; | |
1567 | void *__pad4; | |
1568 | size_t __pad5; | |
1569 | ||
1570 | int _mode; | |
1571 | ||
1572 | char _unused2[15 * sizeof (int) - 4 * sizeof (void *) - sizeof (size_t)]; | |
1573 | ||
1574 | }; | |
1575 | ||
1576 | ||
1577 | typedef struct _IO_FILE _IO_FILE; | |
1578 | ||
1579 | ||
1580 | struct _IO_FILE_plus; | |
1581 | ||
1582 | extern struct _IO_FILE_plus _IO_2_1_stdin_; | |
1583 | extern struct _IO_FILE_plus _IO_2_1_stdout_; | |
1584 | extern struct _IO_FILE_plus _IO_2_1_stderr_; | |
1585 | ||
1586 | #define _IO_stdin ((_IO_FILE*)(&_IO_2_1_stdin_)) | |
1587 | #define _IO_stdout ((_IO_FILE*)(&_IO_2_1_stdout_)) | |
1588 | #define _IO_stderr ((_IO_FILE*)(&_IO_2_1_stderr_)) | |
1589 | # 361 "/usr/include/libio.h" 3 4 | |
1590 | typedef __ssize_t __io_read_fn (void *__cookie, char *__buf, size_t __nbytes); | |
1591 | ||
1592 | ||
1593 | ||
1594 | ||
1595 | ||
1596 | ||
1597 | ||
1598 | typedef __ssize_t __io_write_fn (void *__cookie, __const char *__buf, | |
1599 | size_t __n); | |
1600 | ||
1601 | ||
1602 | ||
1603 | ||
1604 | ||
1605 | ||
1606 | ||
1607 | typedef int __io_seek_fn (void *__cookie, __off64_t *__pos, int __w); | |
1608 | ||
1609 | ||
1610 | typedef int __io_close_fn (void *__cookie); | |
1611 | # 413 "/usr/include/libio.h" 3 4 | |
1612 | extern int __underflow (_IO_FILE *); | |
1613 | extern int __uflow (_IO_FILE *); | |
1614 | extern int __overflow (_IO_FILE *, int); | |
1615 | extern wint_t __wunderflow (_IO_FILE *); | |
1616 | extern wint_t __wuflow (_IO_FILE *); | |
1617 | extern wint_t __woverflow (_IO_FILE *, wint_t); | |
1618 | ||
1619 | ||
1620 | #define _IO_BE(expr,res) __builtin_expect ((expr), res) | |
1621 | ||
1622 | ||
1623 | ||
1624 | ||
1625 | #define _IO_getc_unlocked(_fp) (_IO_BE ((_fp)->_IO_read_ptr >= (_fp)->_IO_read_end, 0) ? __uflow (_fp) : *(unsigned char *) (_fp)->_IO_read_ptr++) | |
1626 | ||
1627 | ||
1628 | #define _IO_peekc_unlocked(_fp) (_IO_BE ((_fp)->_IO_read_ptr >= (_fp)->_IO_read_end, 0) && __underflow (_fp) == EOF ? EOF : *(unsigned char *) (_fp)->_IO_read_ptr) | |
1629 | ||
1630 | ||
1631 | ||
1632 | #define _IO_putc_unlocked(_ch,_fp) (_IO_BE ((_fp)->_IO_write_ptr >= (_fp)->_IO_write_end, 0) ? __overflow (_fp, (unsigned char) (_ch)) : (unsigned char) (*(_fp)->_IO_write_ptr++ = (_ch))) | |
1633 | ||
1634 | ||
1635 | ||
1636 | ||
1637 | #define _IO_getwc_unlocked(_fp) (_IO_BE ((_fp)->_wide_data->_IO_read_ptr >= (_fp)->_wide_data->_IO_read_end, 0) ? __wuflow (_fp) : (_IO_wint_t) *(_fp)->_wide_data->_IO_read_ptr++) | |
1638 | ||
1639 | ||
1640 | ||
1641 | #define _IO_putwc_unlocked(_wch,_fp) (_IO_BE ((_fp)->_wide_data->_IO_write_ptr >= (_fp)->_wide_data->_IO_write_end, 0) ? __woverflow (_fp, _wch) : (_IO_wint_t) (*(_fp)->_wide_data->_IO_write_ptr++ = (_wch))) | |
1642 | ||
1643 | ||
1644 | ||
1645 | ||
1646 | ||
1647 | #define _IO_feof_unlocked(__fp) (((__fp)->_flags & _IO_EOF_SEEN) != 0) | |
1648 | #define _IO_ferror_unlocked(__fp) (((__fp)->_flags & _IO_ERR_SEEN) != 0) | |
1649 | ||
1650 | extern int _IO_getc (_IO_FILE *__fp); | |
1651 | extern int _IO_putc (int __c, _IO_FILE *__fp); | |
1652 | extern int _IO_feof (_IO_FILE *__fp) __attribute__ ((__nothrow__)); | |
1653 | extern int _IO_ferror (_IO_FILE *__fp) __attribute__ ((__nothrow__)); | |
1654 | ||
1655 | extern int _IO_peekc_locked (_IO_FILE *__fp); | |
1656 | ||
1657 | ||
1658 | #define _IO_PENDING_OUTPUT_COUNT(_fp) ((_fp)->_IO_write_ptr - (_fp)->_IO_write_base) | |
1659 | ||
1660 | ||
1661 | extern void _IO_flockfile (_IO_FILE *) __attribute__ ((__nothrow__)); | |
1662 | extern void _IO_funlockfile (_IO_FILE *) __attribute__ ((__nothrow__)); | |
1663 | extern int _IO_ftrylockfile (_IO_FILE *) __attribute__ ((__nothrow__)); | |
1664 | # 473 "/usr/include/libio.h" 3 4 | |
1665 | #define _IO_peekc(_fp) _IO_peekc_unlocked (_fp) | |
1666 | #define _IO_flockfile(_fp) | |
1667 | #define _IO_funlockfile(_fp) | |
1668 | #define _IO_ftrylockfile(_fp) | |
1669 | #define _IO_cleanup_region_start(_fct,_fp) | |
1670 | #define _IO_cleanup_region_end(_Doit) | |
1671 | ||
1672 | ||
1673 | extern int _IO_vfscanf (_IO_FILE * __restrict, const char * __restrict, | |
1674 | __gnuc_va_list, int *__restrict); | |
1675 | extern int _IO_vfprintf (_IO_FILE *__restrict, const char *__restrict, | |
1676 | __gnuc_va_list); | |
1677 | extern __ssize_t _IO_padn (_IO_FILE *, int, __ssize_t); | |
1678 | extern size_t _IO_sgetn (_IO_FILE *, void *, size_t); | |
1679 | ||
1680 | extern __off64_t _IO_seekoff (_IO_FILE *, __off64_t, int, int); | |
1681 | extern __off64_t _IO_seekpos (_IO_FILE *, __off64_t, int); | |
1682 | ||
1683 | extern void _IO_free_backup_area (_IO_FILE *) __attribute__ ((__nothrow__)); | |
1684 | # 76 "/usr/include/stdio.h" 2 3 4 | |
1685 | # 89 "/usr/include/stdio.h" 3 4 | |
1686 | ||
1687 | ||
1688 | typedef _G_fpos_t fpos_t; | |
1689 | ||
1690 | ||
1691 | ||
1692 | ||
1693 | ||
1694 | ||
1695 | ||
1696 | ||
1697 | ||
1698 | #define _IOFBF 0 | |
1699 | #define _IOLBF 1 | |
1700 | #define _IONBF 2 | |
1701 | ||
1702 | ||
1703 | ||
1704 | ||
1705 | #define BUFSIZ _IO_BUFSIZ | |
1706 | # 121 "/usr/include/stdio.h" 3 4 | |
1707 | #define SEEK_SET 0 | |
1708 | #define SEEK_CUR 1 | |
1709 | #define SEEK_END 2 | |
1710 | ||
1711 | ||
1712 | ||
1713 | ||
1714 | #define P_tmpdir "/tmp" | |
1715 | # 141 "/usr/include/stdio.h" 3 4 | |
1716 | # 1 "/usr/include/bits/stdio_lim.h" 1 3 4 | |
1717 | # 24 "/usr/include/bits/stdio_lim.h" 3 4 | |
1718 | #define L_tmpnam 20 | |
1719 | #define TMP_MAX 238328 | |
1720 | #define FILENAME_MAX 4096 | |
1721 | ||
1722 | ||
1723 | #define L_ctermid 9 | |
1724 | #define L_cuserid 9 | |
1725 | ||
1726 | ||
1727 | ||
1728 | ||
1729 | #undef FOPEN_MAX | |
1730 | #define FOPEN_MAX 16 | |
1731 | # 142 "/usr/include/stdio.h" 2 3 4 | |
1732 | ||
1733 | ||
1734 | ||
1735 | extern struct _IO_FILE *stdin; | |
1736 | extern struct _IO_FILE *stdout; | |
1737 | extern struct _IO_FILE *stderr; | |
1738 | ||
1739 | #define stdin stdin | |
1740 | #define stdout stdout | |
1741 | #define stderr stderr | |
1742 | ||
1743 | ||
1744 | ||
1745 | extern int remove (__const char *__filename) __attribute__ ((__nothrow__)); | |
1746 | ||
1747 | extern int rename (__const char *__old, __const char *__new) __attribute__ ((__nothrow__)); | |
1748 | ||
1749 | ||
1750 | ||
1751 | ||
1752 | ||
1753 | ||
1754 | ||
1755 | ||
1756 | ||
1757 | ||
1758 | ||
1759 | ||
1760 | ||
1761 | ||
1762 | extern FILE *tmpfile (void) ; | |
1763 | # 186 "/usr/include/stdio.h" 3 4 | |
1764 | extern char *tmpnam (char *__s) __attribute__ ((__nothrow__)) ; | |
1765 | ||
1766 | ||
1767 | ||
1768 | ||
1769 | ||
1770 | extern char *tmpnam_r (char *__s) __attribute__ ((__nothrow__)) ; | |
1771 | # 204 "/usr/include/stdio.h" 3 4 | |
1772 | extern char *tempnam (__const char *__dir, __const char *__pfx) | |
1773 | __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) ; | |
1774 | ||
1775 | ||
1776 | ||
1777 | ||
1778 | ||
1779 | ||
1780 | ||
1781 | ||
1782 | extern int fclose (FILE *__stream); | |
1783 | ||
1784 | ||
1785 | ||
1786 | ||
1787 | extern int fflush (FILE *__stream); | |
1788 | ||
1789 | # 229 "/usr/include/stdio.h" 3 4 | |
1790 | extern int fflush_unlocked (FILE *__stream); | |
1791 | # 243 "/usr/include/stdio.h" 3 4 | |
1792 | ||
1793 | ||
1794 | ||
1795 | ||
1796 | ||
1797 | ||
1798 | extern FILE *fopen (__const char *__restrict __filename, | |
1799 | __const char *__restrict __modes) ; | |
1800 | ||
1801 | ||
1802 | ||
1803 | ||
1804 | extern FILE *freopen (__const char *__restrict __filename, | |
1805 | __const char *__restrict __modes, | |
1806 | FILE *__restrict __stream) ; | |
1807 | # 272 "/usr/include/stdio.h" 3 4 | |
1808 | ||
1809 | # 283 "/usr/include/stdio.h" 3 4 | |
1810 | extern FILE *fdopen (int __fd, __const char *__modes) __attribute__ ((__nothrow__)) ; | |
1811 | # 304 "/usr/include/stdio.h" 3 4 | |
1812 | ||
1813 | ||
1814 | ||
1815 | extern void setbuf (FILE *__restrict __stream, char *__restrict __buf) __attribute__ ((__nothrow__)); | |
1816 | ||
1817 | ||
1818 | ||
1819 | extern int setvbuf (FILE *__restrict __stream, char *__restrict __buf, | |
1820 | int __modes, size_t __n) __attribute__ ((__nothrow__)); | |
1821 | ||
1822 | ||
1823 | ||
1824 | ||
1825 | ||
1826 | extern void setbuffer (FILE *__restrict __stream, char *__restrict __buf, | |
1827 | size_t __size) __attribute__ ((__nothrow__)); | |
1828 | ||
1829 | ||
1830 | extern void setlinebuf (FILE *__stream) __attribute__ ((__nothrow__)); | |
1831 | ||
1832 | ||
1833 | ||
1834 | ||
1835 | ||
1836 | ||
1837 | ||
1838 | ||
1839 | extern int fprintf (FILE *__restrict __stream, | |
1840 | __const char *__restrict __format, ...); | |
1841 | ||
1842 | ||
1843 | ||
1844 | ||
1845 | extern int printf (__const char *__restrict __format, ...); | |
1846 | ||
1847 | extern int sprintf (char *__restrict __s, | |
1848 | __const char *__restrict __format, ...) __attribute__ ((__nothrow__)); | |
1849 | ||
1850 | ||
1851 | ||
1852 | ||
1853 | ||
1854 | extern int vfprintf (FILE *__restrict __s, __const char *__restrict __format, | |
1855 | __gnuc_va_list __arg); | |
1856 | ||
1857 | ||
1858 | ||
1859 | ||
1860 | extern int vprintf (__const char *__restrict __format, __gnuc_va_list __arg); | |
1861 | ||
1862 | extern int vsprintf (char *__restrict __s, __const char *__restrict __format, | |
1863 | __gnuc_va_list __arg) __attribute__ ((__nothrow__)); | |
1864 | ||
1865 | ||
1866 | ||
1867 | ||
1868 | ||
1869 | extern int snprintf (char *__restrict __s, size_t __maxlen, | |
1870 | __const char *__restrict __format, ...) | |
1871 | __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 3, 4))); | |
1872 | ||
1873 | extern int vsnprintf (char *__restrict __s, size_t __maxlen, | |
1874 | __const char *__restrict __format, __gnuc_va_list __arg) | |
1875 | __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 3, 0))); | |
1876 | ||
1877 | # 398 "/usr/include/stdio.h" 3 4 | |
1878 | ||
1879 | ||
1880 | ||
1881 | ||
1882 | ||
1883 | extern int fscanf (FILE *__restrict __stream, | |
1884 | __const char *__restrict __format, ...) ; | |
1885 | ||
1886 | ||
1887 | ||
1888 | ||
1889 | extern int scanf (__const char *__restrict __format, ...) ; | |
1890 | ||
1891 | extern int sscanf (__const char *__restrict __s, | |
1892 | __const char *__restrict __format, ...) __attribute__ ((__nothrow__)); | |
1893 | ||
1894 | # 440 "/usr/include/stdio.h" 3 4 | |
1895 | ||
1896 | ||
1897 | ||
1898 | ||
1899 | ||
1900 | extern int fgetc (FILE *__stream); | |
1901 | extern int getc (FILE *__stream); | |
1902 | ||
1903 | ||
1904 | ||
1905 | ||
1906 | ||
1907 | extern int getchar (void); | |
1908 | ||
1909 | ||
1910 | ||
1911 | ||
1912 | #define getc(_fp) _IO_getc (_fp) | |
1913 | ||
1914 | ||
1915 | ||
1916 | ||
1917 | ||
1918 | ||
1919 | extern int getc_unlocked (FILE *__stream); | |
1920 | extern int getchar_unlocked (void); | |
1921 | # 475 "/usr/include/stdio.h" 3 4 | |
1922 | extern int fgetc_unlocked (FILE *__stream); | |
1923 | ||
1924 | ||
1925 | ||
1926 | ||
1927 | ||
1928 | ||
1929 | ||
1930 | ||
1931 | ||
1932 | ||
1933 | ||
1934 | extern int fputc (int __c, FILE *__stream); | |
1935 | extern int putc (int __c, FILE *__stream); | |
1936 | ||
1937 | ||
1938 | ||
1939 | ||
1940 | ||
1941 | extern int putchar (int __c); | |
1942 | ||
1943 | ||
1944 | ||
1945 | ||
1946 | #define putc(_ch,_fp) _IO_putc (_ch, _fp) | |
1947 | # 508 "/usr/include/stdio.h" 3 4 | |
1948 | extern int fputc_unlocked (int __c, FILE *__stream); | |
1949 | ||
1950 | ||
1951 | ||
1952 | ||
1953 | ||
1954 | ||
1955 | ||
1956 | extern int putc_unlocked (int __c, FILE *__stream); | |
1957 | extern int putchar_unlocked (int __c); | |
1958 | ||
1959 | ||
1960 | ||
1961 | ||
1962 | ||
1963 | ||
1964 | extern int getw (FILE *__stream); | |
1965 | ||
1966 | ||
1967 | extern int putw (int __w, FILE *__stream); | |
1968 | ||
1969 | ||
1970 | ||
1971 | ||
1972 | ||
1973 | ||
1974 | ||
1975 | ||
1976 | extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream) | |
1977 | ; | |
1978 | ||
1979 | ||
1980 | ||
1981 | ||
1982 | ||
1983 | ||
1984 | extern char *gets (char *__s) ; | |
1985 | ||
1986 | # 589 "/usr/include/stdio.h" 3 4 | |
1987 | ||
1988 | ||
1989 | ||
1990 | ||
1991 | ||
1992 | extern int fputs (__const char *__restrict __s, FILE *__restrict __stream); | |
1993 | ||
1994 | ||
1995 | ||
1996 | ||
1997 | ||
1998 | extern int puts (__const char *__s); | |
1999 | ||
2000 | ||
2001 | ||
2002 | ||
2003 | ||
2004 | ||
2005 | extern int ungetc (int __c, FILE *__stream); | |
2006 | ||
2007 | ||
2008 | ||
2009 | ||
2010 | ||
2011 | ||
2012 | extern size_t fread (void *__restrict __ptr, size_t __size, | |
2013 | size_t __n, FILE *__restrict __stream) ; | |
2014 | ||
2015 | ||
2016 | ||
2017 | ||
2018 | extern size_t fwrite (__const void *__restrict __ptr, size_t __size, | |
2019 | size_t __n, FILE *__restrict __s) ; | |
2020 | ||
2021 | # 642 "/usr/include/stdio.h" 3 4 | |
2022 | extern size_t fread_unlocked (void *__restrict __ptr, size_t __size, | |
2023 | size_t __n, FILE *__restrict __stream) ; | |
2024 | extern size_t fwrite_unlocked (__const void *__restrict __ptr, size_t __size, | |
2025 | size_t __n, FILE *__restrict __stream) ; | |
2026 | ||
2027 | ||
2028 | ||
2029 | ||
2030 | ||
2031 | ||
2032 | ||
2033 | ||
2034 | extern int fseek (FILE *__stream, long int __off, int __whence); | |
2035 | ||
2036 | ||
2037 | ||
2038 | ||
2039 | extern long int ftell (FILE *__stream) ; | |
2040 | ||
2041 | ||
2042 | ||
2043 | ||
2044 | extern void rewind (FILE *__stream); | |
2045 | ||
2046 | # 678 "/usr/include/stdio.h" 3 4 | |
2047 | extern int fseeko (FILE *__stream, __off_t __off, int __whence); | |
2048 | ||
2049 | ||
2050 | ||
2051 | ||
2052 | extern __off_t ftello (FILE *__stream) ; | |
2053 | # 697 "/usr/include/stdio.h" 3 4 | |
2054 | ||
2055 | ||
2056 | ||
2057 | ||
2058 | ||
2059 | ||
2060 | extern int fgetpos (FILE *__restrict __stream, fpos_t *__restrict __pos); | |
2061 | ||
2062 | ||
2063 | ||
2064 | ||
2065 | extern int fsetpos (FILE *__stream, __const fpos_t *__pos); | |
2066 | # 720 "/usr/include/stdio.h" 3 4 | |
2067 | ||
2068 | # 729 "/usr/include/stdio.h" 3 4 | |
2069 | ||
2070 | ||
2071 | extern void clearerr (FILE *__stream) __attribute__ ((__nothrow__)); | |
2072 | ||
2073 | extern int feof (FILE *__stream) __attribute__ ((__nothrow__)) ; | |
2074 | ||
2075 | extern int ferror (FILE *__stream) __attribute__ ((__nothrow__)) ; | |
2076 | ||
2077 | ||
2078 | ||
2079 | ||
2080 | extern void clearerr_unlocked (FILE *__stream) __attribute__ ((__nothrow__)); | |
2081 | extern int feof_unlocked (FILE *__stream) __attribute__ ((__nothrow__)) ; | |
2082 | extern int ferror_unlocked (FILE *__stream) __attribute__ ((__nothrow__)) ; | |
2083 | ||
2084 | ||
2085 | ||
2086 | ||
2087 | ||
2088 | ||
2089 | ||
2090 | ||
2091 | extern void perror (__const char *__s); | |
2092 | ||
2093 | ||
2094 | ||
2095 | ||
2096 | ||
2097 | ||
2098 | # 1 "/usr/include/bits/sys_errlist.h" 1 3 4 | |
2099 | # 27 "/usr/include/bits/sys_errlist.h" 3 4 | |
2100 | extern int sys_nerr; | |
2101 | extern __const char *__const sys_errlist[]; | |
2102 | # 759 "/usr/include/stdio.h" 2 3 4 | |
2103 | ||
2104 | ||
2105 | ||
2106 | ||
2107 | extern int fileno (FILE *__stream) __attribute__ ((__nothrow__)) ; | |
2108 | ||
2109 | ||
2110 | ||
2111 | ||
2112 | extern int fileno_unlocked (FILE *__stream) __attribute__ ((__nothrow__)) ; | |
2113 | # 778 "/usr/include/stdio.h" 3 4 | |
2114 | extern FILE *popen (__const char *__command, __const char *__modes) ; | |
2115 | ||
2116 | ||
2117 | ||
2118 | ||
2119 | ||
2120 | extern int pclose (FILE *__stream); | |
2121 | ||
2122 | ||
2123 | ||
2124 | ||
2125 | ||
2126 | extern char *ctermid (char *__s) __attribute__ ((__nothrow__)); | |
2127 | # 818 "/usr/include/stdio.h" 3 4 | |
2128 | extern void flockfile (FILE *__stream) __attribute__ ((__nothrow__)); | |
2129 | ||
2130 | ||
2131 | ||
2132 | extern int ftrylockfile (FILE *__stream) __attribute__ ((__nothrow__)) ; | |
2133 | ||
2134 | ||
2135 | extern void funlockfile (FILE *__stream) __attribute__ ((__nothrow__)); | |
2136 | # 839 "/usr/include/stdio.h" 3 4 | |
2137 | # 1 "/usr/include/bits/stdio.h" 1 3 4 | |
2138 | # 27 "/usr/include/bits/stdio.h" 3 4 | |
2139 | #define __STDIO_INLINE __extern_inline | |
2140 | ||
2141 | ||
2142 | ||
2143 | ||
2144 | ||
2145 | extern __inline int | |
2146 | vprintf (__const char *__restrict __fmt, __gnuc_va_list __arg) | |
2147 | { | |
2148 | return vfprintf (stdout, __fmt, __arg); | |
2149 | } | |
2150 | ||
2151 | ||
2152 | extern __inline int | |
2153 | getchar (void) | |
2154 | { | |
2155 | return _IO_getc (stdin); | |
2156 | } | |
2157 | ||
2158 | ||
2159 | ||
2160 | ||
2161 | extern __inline int | |
2162 | fgetc_unlocked (FILE *__fp) | |
2163 | { | |
2164 | return (__builtin_expect (((__fp)->_IO_read_ptr >= (__fp)->_IO_read_end), 0) ? __uflow (__fp) : *(unsigned char *) (__fp)->_IO_read_ptr++); | |
2165 | } | |
2166 | ||
2167 | ||
2168 | ||
2169 | ||
2170 | ||
2171 | extern __inline int | |
2172 | getc_unlocked (FILE *__fp) | |
2173 | { | |
2174 | return (__builtin_expect (((__fp)->_IO_read_ptr >= (__fp)->_IO_read_end), 0) ? __uflow (__fp) : *(unsigned char *) (__fp)->_IO_read_ptr++); | |
2175 | } | |
2176 | ||
2177 | ||
2178 | extern __inline int | |
2179 | getchar_unlocked (void) | |
2180 | { | |
2181 | return (__builtin_expect (((stdin)->_IO_read_ptr >= (stdin)->_IO_read_end), 0) ? __uflow (stdin) : *(unsigned char *) (stdin)->_IO_read_ptr++); | |
2182 | } | |
2183 | ||
2184 | ||
2185 | ||
2186 | ||
2187 | extern __inline int | |
2188 | putchar (int __c) | |
2189 | { | |
2190 | return _IO_putc (__c, stdout); | |
2191 | } | |
2192 | ||
2193 | ||
2194 | ||
2195 | ||
2196 | extern __inline int | |
2197 | fputc_unlocked (int __c, FILE *__stream) | |
2198 | { | |
2199 | return (__builtin_expect (((__stream)->_IO_write_ptr >= (__stream)->_IO_write_end), 0) ? __overflow (__stream, (unsigned char) (__c)) : (unsigned char) (*(__stream)->_IO_write_ptr++ = (__c))); | |
2200 | } | |
2201 | ||
2202 | ||
2203 | ||
2204 | ||
2205 | ||
2206 | extern __inline int | |
2207 | putc_unlocked (int __c, FILE *__stream) | |
2208 | { | |
2209 | return (__builtin_expect (((__stream)->_IO_write_ptr >= (__stream)->_IO_write_end), 0) ? __overflow (__stream, (unsigned char) (__c)) : (unsigned char) (*(__stream)->_IO_write_ptr++ = (__c))); | |
2210 | } | |
2211 | ||
2212 | ||
2213 | extern __inline int | |
2214 | putchar_unlocked (int __c) | |
2215 | { | |
2216 | return (__builtin_expect (((stdout)->_IO_write_ptr >= (stdout)->_IO_write_end), 0) ? __overflow (stdout, (unsigned char) (__c)) : (unsigned char) (*(stdout)->_IO_write_ptr++ = (__c))); | |
2217 | } | |
2218 | # 121 "/usr/include/bits/stdio.h" 3 4 | |
2219 | extern __inline int | |
2220 | __attribute__ ((__nothrow__)) feof_unlocked (FILE *__stream) | |
2221 | { | |
2222 | return (((__stream)->_flags & 0x10) != 0); | |
2223 | } | |
2224 | ||
2225 | ||
2226 | extern __inline int | |
2227 | __attribute__ ((__nothrow__)) ferror_unlocked (FILE *__stream) | |
2228 | { | |
2229 | return (((__stream)->_flags & 0x20) != 0); | |
2230 | } | |
2231 | ||
2232 | ||
2233 | ||
2234 | ||
2235 | ||
2236 | ||
2237 | ||
2238 | #define fread_unlocked(ptr,size,n,stream) (__extension__ ((__builtin_constant_p (size) && __builtin_constant_p (n) && (size_t) (size) * (size_t) (n) <= 8 && (size_t) (size) != 0) ? ({ char *__ptr = (char *) (ptr); FILE *__stream = (stream); size_t __cnt; for (__cnt = (size_t) (size) * (size_t) (n); __cnt > 0; --__cnt) { int __c = _IO_getc_unlocked (__stream); if (__c == EOF) break; *__ptr++ = __c; } ((size_t) (size) * (size_t) (n) - __cnt) / (size_t) (size); }) : (((__builtin_constant_p (size) && (size_t) (size) == 0) || (__builtin_constant_p (n) && (size_t) (n) == 0)) ? ((void) (ptr), (void) (stream), (void) (size), (void) (n), (size_t) 0) : fread_unlocked (ptr, size, n, stream)))) | |
2239 | # 164 "/usr/include/bits/stdio.h" 3 4 | |
2240 | #define fwrite_unlocked(ptr,size,n,stream) (__extension__ ((__builtin_constant_p (size) && __builtin_constant_p (n) && (size_t) (size) * (size_t) (n) <= 8 && (size_t) (size) != 0) ? ({ const char *__ptr = (const char *) (ptr); FILE *__stream = (stream); size_t __cnt; for (__cnt = (size_t) (size) * (size_t) (n); __cnt > 0; --__cnt) if (_IO_putc_unlocked (*__ptr++, __stream) == EOF) break; ((size_t) (size) * (size_t) (n) - __cnt) / (size_t) (size); }) : (((__builtin_constant_p (size) && (size_t) (size) == 0) || (__builtin_constant_p (n) && (size_t) (n) == 0)) ? ((void) (ptr), (void) (stream), (void) (size), (void) (n), (size_t) 0) : fwrite_unlocked (ptr, size, n, stream)))) | |
2241 | # 186 "/usr/include/bits/stdio.h" 3 4 | |
2242 | #undef __STDIO_INLINE | |
2243 | # 840 "/usr/include/stdio.h" 2 3 4 | |
2244 | # 848 "/usr/include/stdio.h" 3 4 | |
2245 | ||
2246 | # 13 "unix.c" 2 | |
2247 | ||
2248 | # 1 "/usr/include/stdlib.h" 1 3 4 | |
2249 | # 28 "/usr/include/stdlib.h" 3 4 | |
2250 | #define __need_size_t | |
2251 | ||
2252 | #define __need_wchar_t | |
2253 | #define __need_NULL | |
2254 | ||
2255 | # 1 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/stddef.h" 1 3 4 | |
2256 | # 236 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/stddef.h" 3 4 | |
2257 | #undef __need_size_t | |
2258 | # 345 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/stddef.h" 3 4 | |
2259 | #undef __need_wchar_t | |
2260 | # 398 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/stddef.h" 3 4 | |
2261 | #undef NULL | |
2262 | ||
2263 | ||
2264 | ||
2265 | ||
2266 | #define NULL ((void *)0) | |
2267 | ||
2268 | ||
2269 | ||
2270 | ||
2271 | ||
2272 | #undef __need_NULL | |
2273 | # 34 "/usr/include/stdlib.h" 2 3 4 | |
2274 | ||
2275 | ||
2276 | ||
2277 | ||
2278 | #define _STDLIB_H 1 | |
2279 | # 96 "/usr/include/stdlib.h" 3 4 | |
2280 | ||
2281 | ||
2282 | typedef struct | |
2283 | { | |
2284 | int quot; | |
2285 | int rem; | |
2286 | } div_t; | |
2287 | ||
2288 | ||
2289 | ||
2290 | typedef struct | |
2291 | { | |
2292 | long int quot; | |
2293 | long int rem; | |
2294 | } ldiv_t; | |
2295 | #define __ldiv_t_defined 1 | |
2296 | ||
2297 | ||
2298 | # 129 "/usr/include/stdlib.h" 3 4 | |
2299 | #define RAND_MAX 2147483647 | |
2300 | ||
2301 | ||
2302 | ||
2303 | ||
2304 | #define EXIT_FAILURE 1 | |
2305 | #define EXIT_SUCCESS 0 | |
2306 | ||
2307 | ||
2308 | ||
2309 | #define MB_CUR_MAX (__ctype_get_mb_cur_max ()) | |
2310 | extern size_t __ctype_get_mb_cur_max (void) __attribute__ ((__nothrow__)) ; | |
2311 | ||
2312 | ||
2313 | ||
2314 | ||
2315 | extern double atof (__const char *__nptr) | |
2316 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ; | |
2317 | ||
2318 | extern int atoi (__const char *__nptr) | |
2319 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ; | |
2320 | ||
2321 | extern long int atol (__const char *__nptr) | |
2322 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ; | |
2323 | ||
2324 | ||
2325 | ||
2326 | ||
2327 | ||
2328 | __extension__ extern long long int atoll (__const char *__nptr) | |
2329 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ; | |
2330 | ||
2331 | ||
2332 | ||
2333 | ||
2334 | ||
2335 | extern double strtod (__const char *__restrict __nptr, | |
2336 | char **__restrict __endptr) | |
2337 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; | |
2338 | ||
2339 | # 182 "/usr/include/stdlib.h" 3 4 | |
2340 | ||
2341 | ||
2342 | extern long int strtol (__const char *__restrict __nptr, | |
2343 | char **__restrict __endptr, int __base) | |
2344 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; | |
2345 | ||
2346 | extern unsigned long int strtoul (__const char *__restrict __nptr, | |
2347 | char **__restrict __endptr, int __base) | |
2348 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; | |
2349 | ||
2350 | ||
2351 | ||
2352 | ||
2353 | __extension__ | |
2354 | extern long long int strtoq (__const char *__restrict __nptr, | |
2355 | char **__restrict __endptr, int __base) | |
2356 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; | |
2357 | ||
2358 | __extension__ | |
2359 | extern unsigned long long int strtouq (__const char *__restrict __nptr, | |
2360 | char **__restrict __endptr, int __base) | |
2361 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; | |
2362 | ||
2363 | ||
2364 | ||
2365 | ||
2366 | ||
2367 | __extension__ | |
2368 | extern long long int strtoll (__const char *__restrict __nptr, | |
2369 | char **__restrict __endptr, int __base) | |
2370 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; | |
2371 | ||
2372 | __extension__ | |
2373 | extern unsigned long long int strtoull (__const char *__restrict __nptr, | |
2374 | char **__restrict __endptr, int __base) | |
2375 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; | |
2376 | ||
2377 | # 279 "/usr/include/stdlib.h" 3 4 | |
2378 | extern double __strtod_internal (__const char *__restrict __nptr, | |
2379 | char **__restrict __endptr, int __group) | |
2380 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; | |
2381 | extern float __strtof_internal (__const char *__restrict __nptr, | |
2382 | char **__restrict __endptr, int __group) | |
2383 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; | |
2384 | extern long double __strtold_internal (__const char *__restrict __nptr, | |
2385 | char **__restrict __endptr, | |
2386 | int __group) | |
2387 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; | |
2388 | ||
2389 | extern long int __strtol_internal (__const char *__restrict __nptr, | |
2390 | char **__restrict __endptr, | |
2391 | int __base, int __group) | |
2392 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; | |
2393 | #define __strtol_internal_defined 1 | |
2394 | ||
2395 | ||
2396 | extern unsigned long int __strtoul_internal (__const char *__restrict __nptr, | |
2397 | char **__restrict __endptr, | |
2398 | int __base, int __group) | |
2399 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; | |
2400 | #define __strtoul_internal_defined 1 | |
2401 | ||
2402 | ||
2403 | ||
2404 | __extension__ | |
2405 | extern long long int __strtoll_internal (__const char *__restrict __nptr, | |
2406 | char **__restrict __endptr, | |
2407 | int __base, int __group) | |
2408 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; | |
2409 | #define __strtoll_internal_defined 1 | |
2410 | ||
2411 | ||
2412 | __extension__ | |
2413 | extern unsigned long long int __strtoull_internal (__const char * | |
2414 | __restrict __nptr, | |
2415 | char **__restrict __endptr, | |
2416 | int __base, int __group) | |
2417 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; | |
2418 | #define __strtoull_internal_defined 1 | |
2419 | ||
2420 | ||
2421 | ||
2422 | ||
2423 | ||
2424 | ||
2425 | ||
2426 | extern __inline double | |
2427 | __attribute__ ((__nothrow__)) strtod (__const char *__restrict __nptr, char **__restrict __endptr) | |
2428 | { | |
2429 | return __strtod_internal (__nptr, __endptr, 0); | |
2430 | } | |
2431 | extern __inline long int | |
2432 | __attribute__ ((__nothrow__)) strtol (__const char *__restrict __nptr, char **__restrict __endptr, int __base) | |
2433 | ||
2434 | { | |
2435 | return __strtol_internal (__nptr, __endptr, __base, 0); | |
2436 | } | |
2437 | extern __inline unsigned long int | |
2438 | __attribute__ ((__nothrow__)) strtoul (__const char *__restrict __nptr, char **__restrict __endptr, int __base) | |
2439 | ||
2440 | { | |
2441 | return __strtoul_internal (__nptr, __endptr, __base, 0); | |
2442 | } | |
2443 | ||
2444 | # 364 "/usr/include/stdlib.h" 3 4 | |
2445 | __extension__ extern __inline long long int | |
2446 | __attribute__ ((__nothrow__)) strtoq (__const char *__restrict __nptr, char **__restrict __endptr, int __base) | |
2447 | ||
2448 | { | |
2449 | return __strtoll_internal (__nptr, __endptr, __base, 0); | |
2450 | } | |
2451 | __extension__ extern __inline unsigned long long int | |
2452 | __attribute__ ((__nothrow__)) strtouq (__const char *__restrict __nptr, char **__restrict __endptr, int __base) | |
2453 | ||
2454 | { | |
2455 | return __strtoull_internal (__nptr, __endptr, __base, 0); | |
2456 | } | |
2457 | ||
2458 | ||
2459 | ||
2460 | ||
2461 | __extension__ extern __inline long long int | |
2462 | __attribute__ ((__nothrow__)) strtoll (__const char *__restrict __nptr, char **__restrict __endptr, int __base) | |
2463 | ||
2464 | { | |
2465 | return __strtoll_internal (__nptr, __endptr, __base, 0); | |
2466 | } | |
2467 | __extension__ extern __inline unsigned long long int | |
2468 | __attribute__ ((__nothrow__)) strtoull (__const char * __restrict __nptr, char **__restrict __endptr, int __base) | |
2469 | ||
2470 | { | |
2471 | return __strtoull_internal (__nptr, __endptr, __base, 0); | |
2472 | } | |
2473 | ||
2474 | ||
2475 | ||
2476 | ||
2477 | extern __inline double | |
2478 | __attribute__ ((__nothrow__)) atof (__const char *__nptr) | |
2479 | { | |
2480 | return strtod (__nptr, (char **) ((void *)0)); | |
2481 | } | |
2482 | extern __inline int | |
2483 | __attribute__ ((__nothrow__)) atoi (__const char *__nptr) | |
2484 | { | |
2485 | return (int) strtol (__nptr, (char **) ((void *)0), 10); | |
2486 | } | |
2487 | extern __inline long int | |
2488 | __attribute__ ((__nothrow__)) atol (__const char *__nptr) | |
2489 | { | |
2490 | return strtol (__nptr, (char **) ((void *)0), 10); | |
2491 | } | |
2492 | ||
2493 | ||
2494 | ||
2495 | ||
2496 | __extension__ extern __inline long long int | |
2497 | __attribute__ ((__nothrow__)) atoll (__const char *__nptr) | |
2498 | { | |
2499 | return strtoll (__nptr, (char **) ((void *)0), 10); | |
2500 | } | |
2501 | ||
2502 | # 429 "/usr/include/stdlib.h" 3 4 | |
2503 | extern char *l64a (long int __n) __attribute__ ((__nothrow__)) ; | |
2504 | ||
2505 | ||
2506 | extern long int a64l (__const char *__s) | |
2507 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ; | |
2508 | ||
2509 | ||
2510 | ||
2511 | ||
2512 | # 1 "/usr/include/sys/types.h" 1 3 4 | |
2513 | # 25 "/usr/include/sys/types.h" 3 4 | |
2514 | #define _SYS_TYPES_H 1 | |
2515 | ||
2516 | ||
2517 | ||
2518 | ||
2519 | ||
2520 | ||
2521 | ||
2522 | ||
2523 | ||
2524 | typedef __u_char u_char; | |
2525 | typedef __u_short u_short; | |
2526 | typedef __u_int u_int; | |
2527 | typedef __u_long u_long; | |
2528 | typedef __quad_t quad_t; | |
2529 | typedef __u_quad_t u_quad_t; | |
2530 | typedef __fsid_t fsid_t; | |
2531 | #define __u_char_defined | |
2532 | ||
2533 | ||
2534 | ||
2535 | typedef __loff_t loff_t; | |
2536 | ||
2537 | ||
2538 | ||
2539 | typedef __ino_t ino_t; | |
2540 | ||
2541 | ||
2542 | ||
2543 | #define __ino_t_defined | |
2544 | ||
2545 | ||
2546 | ||
2547 | ||
2548 | ||
2549 | ||
2550 | ||
2551 | typedef __dev_t dev_t; | |
2552 | #define __dev_t_defined | |
2553 | ||
2554 | ||
2555 | ||
2556 | typedef __gid_t gid_t; | |
2557 | #define __gid_t_defined | |
2558 | ||
2559 | ||
2560 | ||
2561 | typedef __mode_t mode_t; | |
2562 | #define __mode_t_defined | |
2563 | ||
2564 | ||
2565 | ||
2566 | typedef __nlink_t nlink_t; | |
2567 | #define __nlink_t_defined | |
2568 | ||
2569 | ||
2570 | ||
2571 | typedef __uid_t uid_t; | |
2572 | #define __uid_t_defined | |
2573 | ||
2574 | ||
2575 | ||
2576 | ||
2577 | typedef __off_t off_t; | |
2578 | ||
2579 | ||
2580 | ||
2581 | #define __off_t_defined | |
2582 | ||
2583 | ||
2584 | ||
2585 | ||
2586 | ||
2587 | ||
2588 | ||
2589 | typedef __pid_t pid_t; | |
2590 | #define __pid_t_defined | |
2591 | ||
2592 | ||
2593 | ||
2594 | typedef __id_t id_t; | |
2595 | #define __id_t_defined | |
2596 | ||
2597 | ||
2598 | ||
2599 | typedef __ssize_t ssize_t; | |
2600 | #define __ssize_t_defined | |
2601 | ||
2602 | ||
2603 | ||
2604 | ||
2605 | typedef __daddr_t daddr_t; | |
2606 | typedef __caddr_t caddr_t; | |
2607 | #define __daddr_t_defined | |
2608 | ||
2609 | ||
2610 | ||
2611 | ||
2612 | typedef __key_t key_t; | |
2613 | #define __key_t_defined | |
2614 | ||
2615 | ||
2616 | ||
2617 | ||
2618 | ||
2619 | #define __need_time_t | |
2620 | #define __need_timer_t | |
2621 | #define __need_clockid_t | |
2622 | # 1 "/usr/include/time.h" 1 3 4 | |
2623 | # 68 "/usr/include/time.h" 3 4 | |
2624 | #undef __need_clock_t | |
2625 | ||
2626 | ||
2627 | #define __time_t_defined 1 | |
2628 | ||
2629 | ||
2630 | ||
2631 | ||
2632 | ||
2633 | typedef __time_t time_t; | |
2634 | ||
2635 | ||
2636 | ||
2637 | ||
2638 | ||
2639 | ||
2640 | #undef __need_time_t | |
2641 | ||
2642 | ||
2643 | ||
2644 | #define __clockid_t_defined 1 | |
2645 | ||
2646 | ||
2647 | ||
2648 | ||
2649 | typedef __clockid_t clockid_t; | |
2650 | ||
2651 | ||
2652 | #undef __clockid_time_t | |
2653 | ||
2654 | ||
2655 | ||
2656 | #define __timer_t_defined 1 | |
2657 | ||
2658 | ||
2659 | ||
2660 | ||
2661 | typedef __timer_t timer_t; | |
2662 | ||
2663 | ||
2664 | #undef __need_timer_t | |
2665 | # 128 "/usr/include/time.h" 3 4 | |
2666 | #undef __need_timespec | |
2667 | # 134 "/usr/include/sys/types.h" 2 3 4 | |
2668 | # 146 "/usr/include/sys/types.h" 3 4 | |
2669 | #define __need_size_t | |
2670 | # 1 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/stddef.h" 1 3 4 | |
2671 | # 236 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/stddef.h" 3 4 | |
2672 | #undef __need_size_t | |
2673 | # 409 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/stddef.h" 3 4 | |
2674 | #undef __need_NULL | |
2675 | # 148 "/usr/include/sys/types.h" 2 3 4 | |
2676 | ||
2677 | ||
2678 | ||
2679 | typedef unsigned long int ulong; | |
2680 | typedef unsigned short int ushort; | |
2681 | typedef unsigned int uint; | |
2682 | # 188 "/usr/include/sys/types.h" 3 4 | |
2683 | #define __intN_t(N,MODE) typedef int int ##N ##_t __attribute__ ((__mode__ (MODE))) | |
2684 | ||
2685 | #define __u_intN_t(N,MODE) typedef unsigned int u_int ##N ##_t __attribute__ ((__mode__ (MODE))) | |
2686 | ||
2687 | ||
2688 | ||
2689 | #define __int8_t_defined | |
2690 | typedef int int8_t __attribute__ ((__mode__ (__QI__))); | |
2691 | typedef int int16_t __attribute__ ((__mode__ (__HI__))); | |
2692 | typedef int int32_t __attribute__ ((__mode__ (__SI__))); | |
2693 | typedef int int64_t __attribute__ ((__mode__ (__DI__))); | |
2694 | ||
2695 | ||
2696 | typedef unsigned int u_int8_t __attribute__ ((__mode__ (__QI__))); | |
2697 | typedef unsigned int u_int16_t __attribute__ ((__mode__ (__HI__))); | |
2698 | typedef unsigned int u_int32_t __attribute__ ((__mode__ (__SI__))); | |
2699 | typedef unsigned int u_int64_t __attribute__ ((__mode__ (__DI__))); | |
2700 | ||
2701 | typedef int register_t __attribute__ ((__mode__ (__word__))); | |
2702 | ||
2703 | ||
2704 | ||
2705 | ||
2706 | ||
2707 | #define __BIT_TYPES_DEFINED__ 1 | |
2708 | ||
2709 | ||
2710 | ||
2711 | ||
2712 | # 1 "/usr/include/endian.h" 1 3 4 | |
2713 | # 20 "/usr/include/endian.h" 3 4 | |
2714 | #define _ENDIAN_H 1 | |
2715 | # 32 "/usr/include/endian.h" 3 4 | |
2716 | #define __LITTLE_ENDIAN 1234 | |
2717 | #define __BIG_ENDIAN 4321 | |
2718 | #define __PDP_ENDIAN 3412 | |
2719 | ||
2720 | ||
2721 | # 1 "/usr/include/bits/endian.h" 1 3 4 | |
2722 | ||
2723 | ||
2724 | ||
2725 | ||
2726 | ||
2727 | ||
2728 | #define __BYTE_ORDER __LITTLE_ENDIAN | |
2729 | # 38 "/usr/include/endian.h" 2 3 4 | |
2730 | ||
2731 | ||
2732 | ||
2733 | ||
2734 | #define __FLOAT_WORD_ORDER __BYTE_ORDER | |
2735 | ||
2736 | ||
2737 | ||
2738 | #define LITTLE_ENDIAN __LITTLE_ENDIAN | |
2739 | #define BIG_ENDIAN __BIG_ENDIAN | |
2740 | #define PDP_ENDIAN __PDP_ENDIAN | |
2741 | #define BYTE_ORDER __BYTE_ORDER | |
2742 | ||
2743 | ||
2744 | ||
2745 | #define __LONG_LONG_PAIR(HI,LO) LO, HI | |
2746 | # 218 "/usr/include/sys/types.h" 2 3 4 | |
2747 | ||
2748 | ||
2749 | # 1 "/usr/include/sys/select.h" 1 3 4 | |
2750 | # 23 "/usr/include/sys/select.h" 3 4 | |
2751 | #define _SYS_SELECT_H 1 | |
2752 | ||
2753 | ||
2754 | ||
2755 | ||
2756 | ||
2757 | ||
2758 | ||
2759 | # 1 "/usr/include/bits/select.h" 1 3 4 | |
2760 | # 26 "/usr/include/bits/select.h" 3 4 | |
2761 | #define __FD_ZERO(fdsp) do { int __d0, __d1; __asm__ __volatile__ ("cld; rep; stosl" : "=c" (__d0), "=D" (__d1) : "a" (0), "0" (sizeof (fd_set) / sizeof (__fd_mask)), "1" (&__FDS_BITS (fdsp)[0]) : "memory"); } while (0) | |
2762 | # 37 "/usr/include/bits/select.h" 3 4 | |
2763 | #define __FD_SET(fd,fdsp) __asm__ __volatile__ ("btsl %1,%0" : "=m" (__FDS_BITS (fdsp)[__FDELT (fd)]) : "r" (((int) (fd)) % __NFDBITS) : "cc","memory") | |
2764 | ||
2765 | ||
2766 | ||
2767 | ||
2768 | #define __FD_CLR(fd,fdsp) __asm__ __volatile__ ("btrl %1,%0" : "=m" (__FDS_BITS (fdsp)[__FDELT (fd)]) : "r" (((int) (fd)) % __NFDBITS) : "cc","memory") | |
2769 | ||
2770 | ||
2771 | ||
2772 | ||
2773 | #define __FD_ISSET(fd,fdsp) (__extension__ ({register char __result; __asm__ __volatile__ ("btl %1,%2 ; setcb %b0" : "=q" (__result) : "r" (((int) (fd)) % __NFDBITS), "m" (__FDS_BITS (fdsp)[__FDELT (fd)]) : "cc"); __result; })) | |
2774 | # 32 "/usr/include/sys/select.h" 2 3 4 | |
2775 | ||
2776 | ||
2777 | # 1 "/usr/include/bits/sigset.h" 1 3 4 | |
2778 | # 22 "/usr/include/bits/sigset.h" 3 4 | |
2779 | #define _SIGSET_H_types 1 | |
2780 | ||
2781 | typedef int __sig_atomic_t; | |
2782 | ||
2783 | ||
2784 | ||
2785 | #define _SIGSET_NWORDS (1024 / (8 * sizeof (unsigned long int))) | |
2786 | typedef struct | |
2787 | { | |
2788 | unsigned long int __val[(1024 / (8 * sizeof (unsigned long int)))]; | |
2789 | } __sigset_t; | |
2790 | # 35 "/usr/include/sys/select.h" 2 3 4 | |
2791 | ||
2792 | ||
2793 | #define __sigset_t_defined | |
2794 | typedef __sigset_t sigset_t; | |
2795 | ||
2796 | ||
2797 | ||
2798 | #define __need_time_t | |
2799 | #define __need_timespec | |
2800 | # 1 "/usr/include/time.h" 1 3 4 | |
2801 | # 68 "/usr/include/time.h" 3 4 | |
2802 | #undef __need_clock_t | |
2803 | # 84 "/usr/include/time.h" 3 4 | |
2804 | #undef __need_time_t | |
2805 | # 96 "/usr/include/time.h" 3 4 | |
2806 | #undef __clockid_time_t | |
2807 | # 108 "/usr/include/time.h" 3 4 | |
2808 | #undef __need_timer_t | |
2809 | ||
2810 | ||
2811 | ||
2812 | ||
2813 | ||
2814 | ||
2815 | #define __timespec_defined 1 | |
2816 | ||
2817 | ||
2818 | ||
2819 | ||
2820 | ||
2821 | struct timespec | |
2822 | { | |
2823 | __time_t tv_sec; | |
2824 | long int tv_nsec; | |
2825 | }; | |
2826 | ||
2827 | ||
2828 | #undef __need_timespec | |
2829 | # 45 "/usr/include/sys/select.h" 2 3 4 | |
2830 | #define __need_timeval | |
2831 | # 1 "/usr/include/bits/time.h" 1 3 4 | |
2832 | # 62 "/usr/include/bits/time.h" 3 4 | |
2833 | #undef __need_timeval | |
2834 | ||
2835 | #define _STRUCT_TIMEVAL 1 | |
2836 | ||
2837 | ||
2838 | ||
2839 | ||
2840 | struct timeval | |
2841 | { | |
2842 | __time_t tv_sec; | |
2843 | __suseconds_t tv_usec; | |
2844 | }; | |
2845 | # 47 "/usr/include/sys/select.h" 2 3 4 | |
2846 | ||
2847 | ||
2848 | typedef __suseconds_t suseconds_t; | |
2849 | #define __suseconds_t_defined | |
2850 | ||
2851 | ||
2852 | ||
2853 | ||
2854 | typedef long int __fd_mask; | |
2855 | ||
2856 | ||
2857 | #undef __NFDBITS | |
2858 | #undef __FDELT | |
2859 | #undef __FDMASK | |
2860 | ||
2861 | #define __NFDBITS (8 * sizeof (__fd_mask)) | |
2862 | #define __FDELT(d) ((d) / __NFDBITS) | |
2863 | #define __FDMASK(d) ((__fd_mask) 1 << ((d) % __NFDBITS)) | |
2864 | ||
2865 | ||
2866 | typedef struct | |
2867 | { | |
2868 | ||
2869 | ||
2870 | ||
2871 | ||
2872 | ||
2873 | ||
2874 | __fd_mask __fds_bits[1024 / (8 * sizeof (__fd_mask))]; | |
2875 | #define __FDS_BITS(set) ((set)->__fds_bits) | |
2876 | ||
2877 | } fd_set; | |
2878 | ||
2879 | ||
2880 | #define FD_SETSIZE __FD_SETSIZE | |
2881 | ||
2882 | ||
2883 | ||
2884 | typedef __fd_mask fd_mask; | |
2885 | ||
2886 | ||
2887 | #define NFDBITS __NFDBITS | |
2888 | ||
2889 | ||
2890 | ||
2891 | ||
2892 | #define FD_SET(fd,fdsetp) __FD_SET (fd, fdsetp) | |
2893 | #define FD_CLR(fd,fdsetp) __FD_CLR (fd, fdsetp) | |
2894 | #define FD_ISSET(fd,fdsetp) __FD_ISSET (fd, fdsetp) | |
2895 | #define FD_ZERO(fdsetp) __FD_ZERO (fdsetp) | |
2896 | ||
2897 | ||
2898 | ||
2899 | # 109 "/usr/include/sys/select.h" 3 4 | |
2900 | extern int select (int __nfds, fd_set *__restrict __readfds, | |
2901 | fd_set *__restrict __writefds, | |
2902 | fd_set *__restrict __exceptfds, | |
2903 | struct timeval *__restrict __timeout); | |
2904 | # 121 "/usr/include/sys/select.h" 3 4 | |
2905 | extern int pselect (int __nfds, fd_set *__restrict __readfds, | |
2906 | fd_set *__restrict __writefds, | |
2907 | fd_set *__restrict __exceptfds, | |
2908 | const struct timespec *__restrict __timeout, | |
2909 | const __sigset_t *__restrict __sigmask); | |
2910 | ||
2911 | ||
2912 | ||
2913 | # 221 "/usr/include/sys/types.h" 2 3 4 | |
2914 | ||
2915 | ||
2916 | # 1 "/usr/include/sys/sysmacros.h" 1 3 4 | |
2917 | # 22 "/usr/include/sys/sysmacros.h" 3 4 | |
2918 | #define _SYS_SYSMACROS_H 1 | |
2919 | ||
2920 | ||
2921 | ||
2922 | ||
2923 | ||
2924 | ||
2925 | ||
2926 | __extension__ | |
2927 | extern __inline unsigned int gnu_dev_major (unsigned long long int __dev) | |
2928 | __attribute__ ((__nothrow__)); | |
2929 | __extension__ | |
2930 | extern __inline unsigned int gnu_dev_minor (unsigned long long int __dev) | |
2931 | __attribute__ ((__nothrow__)); | |
2932 | __extension__ | |
2933 | extern __inline unsigned long long int gnu_dev_makedev (unsigned int __major, | |
2934 | unsigned int __minor) | |
2935 | __attribute__ ((__nothrow__)); | |
2936 | ||
2937 | ||
2938 | __extension__ extern __inline unsigned int | |
2939 | __attribute__ ((__nothrow__)) gnu_dev_major (unsigned long long int __dev) | |
2940 | { | |
2941 | return ((__dev >> 8) & 0xfff) | ((unsigned int) (__dev >> 32) & ~0xfff); | |
2942 | } | |
2943 | ||
2944 | __extension__ extern __inline unsigned int | |
2945 | __attribute__ ((__nothrow__)) gnu_dev_minor (unsigned long long int __dev) | |
2946 | { | |
2947 | return (__dev & 0xff) | ((unsigned int) (__dev >> 12) & ~0xff); | |
2948 | } | |
2949 | ||
2950 | __extension__ extern __inline unsigned long long int | |
2951 | __attribute__ ((__nothrow__)) gnu_dev_makedev (unsigned int __major, unsigned int __minor) | |
2952 | { | |
2953 | return ((__minor & 0xff) | ((__major & 0xfff) << 8) | |
2954 | | (((unsigned long long int) (__minor & ~0xff)) << 12) | |
2955 | | (((unsigned long long int) (__major & ~0xfff)) << 32)); | |
2956 | } | |
2957 | ||
2958 | ||
2959 | ||
2960 | ||
2961 | #define major(dev) gnu_dev_major (dev) | |
2962 | #define minor(dev) gnu_dev_minor (dev) | |
2963 | #define makedev(maj,min) gnu_dev_makedev (maj, min) | |
2964 | # 224 "/usr/include/sys/types.h" 2 3 4 | |
2965 | # 235 "/usr/include/sys/types.h" 3 4 | |
2966 | typedef __blkcnt_t blkcnt_t; | |
2967 | #define __blkcnt_t_defined | |
2968 | ||
2969 | ||
2970 | typedef __fsblkcnt_t fsblkcnt_t; | |
2971 | #define __fsblkcnt_t_defined | |
2972 | ||
2973 | ||
2974 | typedef __fsfilcnt_t fsfilcnt_t; | |
2975 | #define __fsfilcnt_t_defined | |
2976 | # 270 "/usr/include/sys/types.h" 3 4 | |
2977 | # 1 "/usr/include/bits/pthreadtypes.h" 1 3 4 | |
2978 | # 20 "/usr/include/bits/pthreadtypes.h" 3 4 | |
2979 | #define _BITS_PTHREADTYPES_H 1 | |
2980 | ||
2981 | #define __SIZEOF_PTHREAD_ATTR_T 36 | |
2982 | #define __SIZEOF_PTHREAD_MUTEX_T 24 | |
2983 | #define __SIZEOF_PTHREAD_MUTEXATTR_T 4 | |
2984 | #define __SIZEOF_PTHREAD_COND_T 48 | |
2985 | #define __SIZEOF_PTHREAD_COND_COMPAT_T 12 | |
2986 | #define __SIZEOF_PTHREAD_CONDATTR_T 4 | |
2987 | #define __SIZEOF_PTHREAD_RWLOCK_T 32 | |
2988 | #define __SIZEOF_PTHREAD_RWLOCKATTR_T 8 | |
2989 | #define __SIZEOF_PTHREAD_BARRIER_T 20 | |
2990 | #define __SIZEOF_PTHREAD_BARRIERATTR_T 4 | |
2991 | ||
2992 | ||
2993 | ||
2994 | ||
2995 | typedef unsigned long int pthread_t; | |
2996 | ||
2997 | ||
2998 | typedef union | |
2999 | { | |
3000 | char __size[36]; | |
3001 | long int __align; | |
3002 | } pthread_attr_t; | |
3003 | ||
3004 | ||
3005 | typedef struct __pthread_internal_slist | |
3006 | { | |
3007 | struct __pthread_internal_slist *__next; | |
3008 | } __pthread_slist_t; | |
3009 | ||
3010 | ||
3011 | ||
3012 | ||
3013 | typedef union | |
3014 | { | |
3015 | struct __pthread_mutex_s | |
3016 | { | |
3017 | int __lock; | |
3018 | unsigned int __count; | |
3019 | int __owner; | |
3020 | ||
3021 | ||
3022 | int __kind; | |
3023 | unsigned int __nusers; | |
3024 | __extension__ union | |
3025 | { | |
3026 | int __spins; | |
3027 | __pthread_slist_t __list; | |
3028 | }; | |
3029 | } __data; | |
3030 | char __size[24]; | |
3031 | long int __align; | |
3032 | } pthread_mutex_t; | |
3033 | ||
3034 | typedef union | |
3035 | { | |
3036 | char __size[4]; | |
3037 | long int __align; | |
3038 | } pthread_mutexattr_t; | |
3039 | ||
3040 | ||
3041 | ||
3042 | ||
3043 | typedef union | |
3044 | { | |
3045 | struct | |
3046 | { | |
3047 | int __lock; | |
3048 | unsigned int __futex; | |
3049 | __extension__ unsigned long long int __total_seq; | |
3050 | __extension__ unsigned long long int __wakeup_seq; | |
3051 | __extension__ unsigned long long int __woken_seq; | |
3052 | void *__mutex; | |
3053 | unsigned int __nwaiters; | |
3054 | unsigned int __broadcast_seq; | |
3055 | } __data; | |
3056 | char __size[48]; | |
3057 | __extension__ long long int __align; | |
3058 | } pthread_cond_t; | |
3059 | ||
3060 | typedef union | |
3061 | { | |
3062 | char __size[4]; | |
3063 | long int __align; | |
3064 | } pthread_condattr_t; | |
3065 | ||
3066 | ||
3067 | ||
3068 | typedef unsigned int pthread_key_t; | |
3069 | ||
3070 | ||
3071 | ||
3072 | typedef int pthread_once_t; | |
3073 | ||
3074 | ||
3075 | ||
3076 | ||
3077 | ||
3078 | typedef union | |
3079 | { | |
3080 | struct | |
3081 | { | |
3082 | int __lock; | |
3083 | unsigned int __nr_readers; | |
3084 | unsigned int __readers_wakeup; | |
3085 | unsigned int __writer_wakeup; | |
3086 | unsigned int __nr_readers_queued; | |
3087 | unsigned int __nr_writers_queued; | |
3088 | ||
3089 | ||
3090 | unsigned int __flags; | |
3091 | int __writer; | |
3092 | } __data; | |
3093 | char __size[32]; | |
3094 | long int __align; | |
3095 | } pthread_rwlock_t; | |
3096 | ||
3097 | typedef union | |
3098 | { | |
3099 | char __size[8]; | |
3100 | long int __align; | |
3101 | } pthread_rwlockattr_t; | |
3102 | ||
3103 | ||
3104 | ||
3105 | ||
3106 | ||
3107 | typedef volatile int pthread_spinlock_t; | |
3108 | ||
3109 | ||
3110 | ||
3111 | ||
3112 | typedef union | |
3113 | { | |
3114 | char __size[20]; | |
3115 | long int __align; | |
3116 | } pthread_barrier_t; | |
3117 | ||
3118 | typedef union | |
3119 | { | |
3120 | char __size[4]; | |
3121 | int __align; | |
3122 | } pthread_barrierattr_t; | |
3123 | ||
3124 | ||
3125 | ||
3126 | ||
3127 | #define __cleanup_fct_attribute __attribute__ ((__regparm__ (1))) | |
3128 | # 271 "/usr/include/sys/types.h" 2 3 4 | |
3129 | ||
3130 | ||
3131 | ||
3132 | # 439 "/usr/include/stdlib.h" 2 3 4 | |
3133 | ||
3134 | ||
3135 | ||
3136 | ||
3137 | ||
3138 | ||
3139 | extern long int random (void) __attribute__ ((__nothrow__)); | |
3140 | ||
3141 | ||
3142 | extern void srandom (unsigned int __seed) __attribute__ ((__nothrow__)); | |
3143 | ||
3144 | ||
3145 | ||
3146 | ||
3147 | ||
3148 | extern char *initstate (unsigned int __seed, char *__statebuf, | |
3149 | size_t __statelen) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2))); | |
3150 | ||
3151 | ||
3152 | ||
3153 | extern char *setstate (char *__statebuf) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
3154 | ||
3155 | ||
3156 | ||
3157 | ||
3158 | ||
3159 | ||
3160 | ||
3161 | struct random_data | |
3162 | { | |
3163 | int32_t *fptr; | |
3164 | int32_t *rptr; | |
3165 | int32_t *state; | |
3166 | int rand_type; | |
3167 | int rand_deg; | |
3168 | int rand_sep; | |
3169 | int32_t *end_ptr; | |
3170 | }; | |
3171 | ||
3172 | extern int random_r (struct random_data *__restrict __buf, | |
3173 | int32_t *__restrict __result) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); | |
3174 | ||
3175 | extern int srandom_r (unsigned int __seed, struct random_data *__buf) | |
3176 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2))); | |
3177 | ||
3178 | extern int initstate_r (unsigned int __seed, char *__restrict __statebuf, | |
3179 | size_t __statelen, | |
3180 | struct random_data *__restrict __buf) | |
3181 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 4))); | |
3182 | ||
3183 | extern int setstate_r (char *__restrict __statebuf, | |
3184 | struct random_data *__restrict __buf) | |
3185 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); | |
3186 | ||
3187 | ||
3188 | ||
3189 | ||
3190 | ||
3191 | ||
3192 | extern int rand (void) __attribute__ ((__nothrow__)); | |
3193 | ||
3194 | extern void srand (unsigned int __seed) __attribute__ ((__nothrow__)); | |
3195 | ||
3196 | ||
3197 | ||
3198 | ||
3199 | extern int rand_r (unsigned int *__seed) __attribute__ ((__nothrow__)); | |
3200 | ||
3201 | ||
3202 | ||
3203 | ||
3204 | ||
3205 | ||
3206 | ||
3207 | extern double drand48 (void) __attribute__ ((__nothrow__)); | |
3208 | extern double erand48 (unsigned short int __xsubi[3]) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
3209 | ||
3210 | ||
3211 | extern long int lrand48 (void) __attribute__ ((__nothrow__)); | |
3212 | extern long int nrand48 (unsigned short int __xsubi[3]) | |
3213 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
3214 | ||
3215 | ||
3216 | extern long int mrand48 (void) __attribute__ ((__nothrow__)); | |
3217 | extern long int jrand48 (unsigned short int __xsubi[3]) | |
3218 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
3219 | ||
3220 | ||
3221 | extern void srand48 (long int __seedval) __attribute__ ((__nothrow__)); | |
3222 | extern unsigned short int *seed48 (unsigned short int __seed16v[3]) | |
3223 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
3224 | extern void lcong48 (unsigned short int __param[7]) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
3225 | ||
3226 | ||
3227 | ||
3228 | ||
3229 | ||
3230 | struct drand48_data | |
3231 | { | |
3232 | unsigned short int __x[3]; | |
3233 | unsigned short int __old_x[3]; | |
3234 | unsigned short int __c; | |
3235 | unsigned short int __init; | |
3236 | unsigned long long int __a; | |
3237 | }; | |
3238 | ||
3239 | ||
3240 | extern int drand48_r (struct drand48_data *__restrict __buffer, | |
3241 | double *__restrict __result) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); | |
3242 | extern int erand48_r (unsigned short int __xsubi[3], | |
3243 | struct drand48_data *__restrict __buffer, | |
3244 | double *__restrict __result) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); | |
3245 | ||
3246 | ||
3247 | extern int lrand48_r (struct drand48_data *__restrict __buffer, | |
3248 | long int *__restrict __result) | |
3249 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); | |
3250 | extern int nrand48_r (unsigned short int __xsubi[3], | |
3251 | struct drand48_data *__restrict __buffer, | |
3252 | long int *__restrict __result) | |
3253 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); | |
3254 | ||
3255 | ||
3256 | extern int mrand48_r (struct drand48_data *__restrict __buffer, | |
3257 | long int *__restrict __result) | |
3258 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); | |
3259 | extern int jrand48_r (unsigned short int __xsubi[3], | |
3260 | struct drand48_data *__restrict __buffer, | |
3261 | long int *__restrict __result) | |
3262 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); | |
3263 | ||
3264 | ||
3265 | extern int srand48_r (long int __seedval, struct drand48_data *__buffer) | |
3266 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2))); | |
3267 | ||
3268 | extern int seed48_r (unsigned short int __seed16v[3], | |
3269 | struct drand48_data *__buffer) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); | |
3270 | ||
3271 | extern int lcong48_r (unsigned short int __param[7], | |
3272 | struct drand48_data *__buffer) | |
3273 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); | |
3274 | ||
3275 | ||
3276 | ||
3277 | ||
3278 | ||
3279 | ||
3280 | #define __malloc_and_calloc_defined | |
3281 | ||
3282 | ||
3283 | extern void *malloc (size_t __size) __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) ; | |
3284 | ||
3285 | extern void *calloc (size_t __nmemb, size_t __size) | |
3286 | __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) ; | |
3287 | ||
3288 | ||
3289 | ||
3290 | ||
3291 | ||
3292 | ||
3293 | ||
3294 | extern void *realloc (void *__ptr, size_t __size) | |
3295 | __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) __attribute__ ((__warn_unused_result__)); | |
3296 | ||
3297 | extern void free (void *__ptr) __attribute__ ((__nothrow__)); | |
3298 | ||
3299 | ||
3300 | ||
3301 | ||
3302 | extern void cfree (void *__ptr) __attribute__ ((__nothrow__)); | |
3303 | ||
3304 | ||
3305 | ||
3306 | # 1 "/usr/include/alloca.h" 1 3 4 | |
3307 | # 20 "/usr/include/alloca.h" 3 4 | |
3308 | #define _ALLOCA_H 1 | |
3309 | ||
3310 | ||
3311 | ||
3312 | #define __need_size_t | |
3313 | # 1 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/stddef.h" 1 3 4 | |
3314 | # 236 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/stddef.h" 3 4 | |
3315 | #undef __need_size_t | |
3316 | # 409 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/stddef.h" 3 4 | |
3317 | #undef __need_NULL | |
3318 | # 26 "/usr/include/alloca.h" 2 3 4 | |
3319 | ||
3320 | ||
3321 | ||
3322 | ||
3323 | #undef alloca | |
3324 | ||
3325 | ||
3326 | extern void *alloca (size_t __size) __attribute__ ((__nothrow__)); | |
3327 | ||
3328 | ||
3329 | #define alloca(size) __builtin_alloca (size) | |
3330 | ||
3331 | ||
3332 | ||
3333 | # 613 "/usr/include/stdlib.h" 2 3 4 | |
3334 | ||
3335 | ||
3336 | ||
3337 | ||
3338 | extern void *valloc (size_t __size) __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) ; | |
3339 | ||
3340 | ||
3341 | ||
3342 | ||
3343 | extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size) | |
3344 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; | |
3345 | ||
3346 | ||
3347 | ||
3348 | ||
3349 | extern void abort (void) __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__)); | |
3350 | ||
3351 | ||
3352 | ||
3353 | extern int atexit (void (*__func) (void)) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
3354 | ||
3355 | ||
3356 | ||
3357 | ||
3358 | ||
3359 | extern int on_exit (void (*__func) (int __status, void *__arg), void *__arg) | |
3360 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
3361 | ||
3362 | ||
3363 | ||
3364 | ||
3365 | ||
3366 | ||
3367 | extern void exit (int __status) __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__)); | |
3368 | ||
3369 | # 658 "/usr/include/stdlib.h" 3 4 | |
3370 | ||
3371 | ||
3372 | extern char *getenv (__const char *__name) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; | |
3373 | ||
3374 | ||
3375 | ||
3376 | ||
3377 | extern char *__secure_getenv (__const char *__name) | |
3378 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; | |
3379 | ||
3380 | ||
3381 | ||
3382 | ||
3383 | ||
3384 | extern int putenv (char *__string) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
3385 | ||
3386 | ||
3387 | ||
3388 | ||
3389 | ||
3390 | extern int setenv (__const char *__name, __const char *__value, int __replace) | |
3391 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2))); | |
3392 | ||
3393 | ||
3394 | extern int unsetenv (__const char *__name) __attribute__ ((__nothrow__)); | |
3395 | ||
3396 | ||
3397 | ||
3398 | ||
3399 | ||
3400 | ||
3401 | extern int clearenv (void) __attribute__ ((__nothrow__)); | |
3402 | # 698 "/usr/include/stdlib.h" 3 4 | |
3403 | extern char *mktemp (char *__template) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; | |
3404 | # 709 "/usr/include/stdlib.h" 3 4 | |
3405 | extern int mkstemp (char *__template) __attribute__ ((__nonnull__ (1))) ; | |
3406 | # 729 "/usr/include/stdlib.h" 3 4 | |
3407 | extern char *mkdtemp (char *__template) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; | |
3408 | ||
3409 | ||
3410 | ||
3411 | ||
3412 | ||
3413 | ||
3414 | ||
3415 | ||
3416 | extern int system (__const char *__command) ; | |
3417 | ||
3418 | # 755 "/usr/include/stdlib.h" 3 4 | |
3419 | extern char *realpath (__const char *__restrict __name, | |
3420 | char *__restrict __resolved) __attribute__ ((__nothrow__)) ; | |
3421 | ||
3422 | ||
3423 | ||
3424 | ||
3425 | ||
3426 | #define __COMPAR_FN_T | |
3427 | typedef int (*__compar_fn_t) (__const void *, __const void *); | |
3428 | ||
3429 | ||
3430 | ||
3431 | ||
3432 | ||
3433 | ||
3434 | ||
3435 | ||
3436 | ||
3437 | extern void *bsearch (__const void *__key, __const void *__base, | |
3438 | size_t __nmemb, size_t __size, __compar_fn_t __compar) | |
3439 | __attribute__ ((__nonnull__ (1, 2, 5))) ; | |
3440 | ||
3441 | ||
3442 | ||
3443 | extern void qsort (void *__base, size_t __nmemb, size_t __size, | |
3444 | __compar_fn_t __compar) __attribute__ ((__nonnull__ (1, 4))); | |
3445 | ||
3446 | ||
3447 | ||
3448 | extern int abs (int __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)) ; | |
3449 | extern long int labs (long int __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)) ; | |
3450 | ||
3451 | ||
3452 | ||
3453 | ||
3454 | ||
3455 | ||
3456 | ||
3457 | ||
3458 | ||
3459 | ||
3460 | ||
3461 | ||
3462 | extern div_t div (int __numer, int __denom) | |
3463 | __attribute__ ((__nothrow__)) __attribute__ ((__const__)) ; | |
3464 | extern ldiv_t ldiv (long int __numer, long int __denom) | |
3465 | __attribute__ ((__nothrow__)) __attribute__ ((__const__)) ; | |
3466 | ||
3467 | # 820 "/usr/include/stdlib.h" 3 4 | |
3468 | extern char *ecvt (double __value, int __ndigit, int *__restrict __decpt, | |
3469 | int *__restrict __sign) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4))) ; | |
3470 | ||
3471 | ||
3472 | ||
3473 | ||
3474 | extern char *fcvt (double __value, int __ndigit, int *__restrict __decpt, | |
3475 | int *__restrict __sign) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4))) ; | |
3476 | ||
3477 | ||
3478 | ||
3479 | ||
3480 | extern char *gcvt (double __value, int __ndigit, char *__buf) | |
3481 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3))) ; | |
3482 | ||
3483 | ||
3484 | ||
3485 | ||
3486 | extern char *qecvt (long double __value, int __ndigit, | |
3487 | int *__restrict __decpt, int *__restrict __sign) | |
3488 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4))) ; | |
3489 | extern char *qfcvt (long double __value, int __ndigit, | |
3490 | int *__restrict __decpt, int *__restrict __sign) | |
3491 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4))) ; | |
3492 | extern char *qgcvt (long double __value, int __ndigit, char *__buf) | |
3493 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3))) ; | |
3494 | ||
3495 | ||
3496 | ||
3497 | ||
3498 | extern int ecvt_r (double __value, int __ndigit, int *__restrict __decpt, | |
3499 | int *__restrict __sign, char *__restrict __buf, | |
3500 | size_t __len) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4, 5))); | |
3501 | extern int fcvt_r (double __value, int __ndigit, int *__restrict __decpt, | |
3502 | int *__restrict __sign, char *__restrict __buf, | |
3503 | size_t __len) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4, 5))); | |
3504 | ||
3505 | extern int qecvt_r (long double __value, int __ndigit, | |
3506 | int *__restrict __decpt, int *__restrict __sign, | |
3507 | char *__restrict __buf, size_t __len) | |
3508 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4, 5))); | |
3509 | extern int qfcvt_r (long double __value, int __ndigit, | |
3510 | int *__restrict __decpt, int *__restrict __sign, | |
3511 | char *__restrict __buf, size_t __len) | |
3512 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4, 5))); | |
3513 | ||
3514 | ||
3515 | ||
3516 | ||
3517 | ||
3518 | ||
3519 | ||
3520 | extern int mblen (__const char *__s, size_t __n) __attribute__ ((__nothrow__)) ; | |
3521 | ||
3522 | ||
3523 | extern int mbtowc (wchar_t *__restrict __pwc, | |
3524 | __const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__)) ; | |
3525 | ||
3526 | ||
3527 | extern int wctomb (char *__s, wchar_t __wchar) __attribute__ ((__nothrow__)) ; | |
3528 | ||
3529 | ||
3530 | ||
3531 | extern size_t mbstowcs (wchar_t *__restrict __pwcs, | |
3532 | __const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__)); | |
3533 | ||
3534 | extern size_t wcstombs (char *__restrict __s, | |
3535 | __const wchar_t *__restrict __pwcs, size_t __n) | |
3536 | __attribute__ ((__nothrow__)); | |
3537 | ||
3538 | ||
3539 | ||
3540 | ||
3541 | ||
3542 | ||
3543 | ||
3544 | ||
3545 | extern int rpmatch (__const char *__response) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; | |
3546 | # 925 "/usr/include/stdlib.h" 3 4 | |
3547 | extern int posix_openpt (int __oflag) ; | |
3548 | # 960 "/usr/include/stdlib.h" 3 4 | |
3549 | extern int getloadavg (double __loadavg[], int __nelem) | |
3550 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
3551 | # 974 "/usr/include/stdlib.h" 3 4 | |
3552 | #undef __need_malloc_and_calloc | |
3553 | ||
3554 | ||
3555 | # 15 "unix.c" 2 | |
3556 | ||
3557 | # 1 "/usr/include/string.h" 1 3 4 | |
3558 | # 24 "/usr/include/string.h" 3 4 | |
3559 | #define _STRING_H 1 | |
3560 | ||
3561 | ||
3562 | ||
3563 | ||
3564 | ||
3565 | ||
3566 | #define __need_size_t | |
3567 | #define __need_NULL | |
3568 | # 1 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/stddef.h" 1 3 4 | |
3569 | # 236 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/stddef.h" 3 4 | |
3570 | #undef __need_size_t | |
3571 | # 398 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/stddef.h" 3 4 | |
3572 | #undef NULL | |
3573 | ||
3574 | ||
3575 | ||
3576 | ||
3577 | #define NULL ((void *)0) | |
3578 | ||
3579 | ||
3580 | ||
3581 | ||
3582 | ||
3583 | #undef __need_NULL | |
3584 | # 34 "/usr/include/string.h" 2 3 4 | |
3585 | ||
3586 | ||
3587 | ||
3588 | ||
3589 | extern void *memcpy (void *__restrict __dest, | |
3590 | __const void *__restrict __src, size_t __n) | |
3591 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); | |
3592 | ||
3593 | ||
3594 | extern void *memmove (void *__dest, __const void *__src, size_t __n) | |
3595 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); | |
3596 | ||
3597 | ||
3598 | ||
3599 | ||
3600 | ||
3601 | ||
3602 | extern void *memccpy (void *__restrict __dest, __const void *__restrict __src, | |
3603 | int __c, size_t __n) | |
3604 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); | |
3605 | ||
3606 | ||
3607 | ||
3608 | ||
3609 | ||
3610 | extern void *memset (void *__s, int __c, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
3611 | ||
3612 | ||
3613 | extern int memcmp (__const void *__s1, __const void *__s2, size_t __n) | |
3614 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); | |
3615 | ||
3616 | ||
3617 | extern void *memchr (__const void *__s, int __c, size_t __n) | |
3618 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); | |
3619 | ||
3620 | # 82 "/usr/include/string.h" 3 4 | |
3621 | ||
3622 | ||
3623 | extern char *strcpy (char *__restrict __dest, __const char *__restrict __src) | |
3624 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); | |
3625 | ||
3626 | extern char *strncpy (char *__restrict __dest, | |
3627 | __const char *__restrict __src, size_t __n) | |
3628 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); | |
3629 | ||
3630 | ||
3631 | extern char *strcat (char *__restrict __dest, __const char *__restrict __src) | |
3632 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); | |
3633 | ||
3634 | extern char *strncat (char *__restrict __dest, __const char *__restrict __src, | |
3635 | size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); | |
3636 | ||
3637 | ||
3638 | extern int strcmp (__const char *__s1, __const char *__s2) | |
3639 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); | |
3640 | ||
3641 | extern int strncmp (__const char *__s1, __const char *__s2, size_t __n) | |
3642 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); | |
3643 | ||
3644 | ||
3645 | extern int strcoll (__const char *__s1, __const char *__s2) | |
3646 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); | |
3647 | ||
3648 | extern size_t strxfrm (char *__restrict __dest, | |
3649 | __const char *__restrict __src, size_t __n) | |
3650 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2))); | |
3651 | ||
3652 | # 130 "/usr/include/string.h" 3 4 | |
3653 | extern char *strdup (__const char *__s) | |
3654 | __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1))); | |
3655 | # 165 "/usr/include/string.h" 3 4 | |
3656 | ||
3657 | ||
3658 | extern char *strchr (__const char *__s, int __c) | |
3659 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); | |
3660 | ||
3661 | extern char *strrchr (__const char *__s, int __c) | |
3662 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); | |
3663 | ||
3664 | # 181 "/usr/include/string.h" 3 4 | |
3665 | ||
3666 | ||
3667 | ||
3668 | extern size_t strcspn (__const char *__s, __const char *__reject) | |
3669 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); | |
3670 | ||
3671 | ||
3672 | extern size_t strspn (__const char *__s, __const char *__accept) | |
3673 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); | |
3674 | ||
3675 | extern char *strpbrk (__const char *__s, __const char *__accept) | |
3676 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); | |
3677 | ||
3678 | extern char *strstr (__const char *__haystack, __const char *__needle) | |
3679 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); | |
3680 | ||
3681 | ||
3682 | ||
3683 | extern char *strtok (char *__restrict __s, __const char *__restrict __delim) | |
3684 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2))); | |
3685 | ||
3686 | ||
3687 | ||
3688 | ||
3689 | extern char *__strtok_r (char *__restrict __s, | |
3690 | __const char *__restrict __delim, | |
3691 | char **__restrict __save_ptr) | |
3692 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 3))); | |
3693 | ||
3694 | extern char *strtok_r (char *__restrict __s, __const char *__restrict __delim, | |
3695 | char **__restrict __save_ptr) | |
3696 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 3))); | |
3697 | # 240 "/usr/include/string.h" 3 4 | |
3698 | ||
3699 | ||
3700 | extern size_t strlen (__const char *__s) | |
3701 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); | |
3702 | ||
3703 | # 254 "/usr/include/string.h" 3 4 | |
3704 | ||
3705 | ||
3706 | extern char *strerror (int __errnum) __attribute__ ((__nothrow__)); | |
3707 | ||
3708 | # 270 "/usr/include/string.h" 3 4 | |
3709 | extern int strerror_r (int __errnum, char *__buf, size_t __buflen) __asm__ ("" "__xpg_strerror_r") __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2))); | |
3710 | # 294 "/usr/include/string.h" 3 4 | |
3711 | extern void __bzero (void *__s, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
3712 | ||
3713 | ||
3714 | ||
3715 | extern void bcopy (__const void *__src, void *__dest, size_t __n) | |
3716 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); | |
3717 | ||
3718 | ||
3719 | extern void bzero (void *__s, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
3720 | ||
3721 | ||
3722 | extern int bcmp (__const void *__s1, __const void *__s2, size_t __n) | |
3723 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); | |
3724 | ||
3725 | ||
3726 | extern char *index (__const char *__s, int __c) | |
3727 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); | |
3728 | ||
3729 | ||
3730 | extern char *rindex (__const char *__s, int __c) | |
3731 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); | |
3732 | ||
3733 | ||
3734 | ||
3735 | extern int ffs (int __i) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); | |
3736 | # 331 "/usr/include/string.h" 3 4 | |
3737 | extern int strcasecmp (__const char *__s1, __const char *__s2) | |
3738 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); | |
3739 | ||
3740 | ||
3741 | extern int strncasecmp (__const char *__s1, __const char *__s2, size_t __n) | |
3742 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); | |
3743 | # 354 "/usr/include/string.h" 3 4 | |
3744 | extern char *strsep (char **__restrict __stringp, | |
3745 | __const char *__restrict __delim) | |
3746 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); | |
3747 | # 420 "/usr/include/string.h" 3 4 | |
3748 | # 1 "/usr/include/bits/string.h" 1 3 4 | |
3749 | # 26 "/usr/include/bits/string.h" 3 4 | |
3750 | #define _STRING_ARCH_unaligned 1 | |
3751 | # 421 "/usr/include/string.h" 2 3 4 | |
3752 | ||
3753 | ||
3754 | # 1 "/usr/include/bits/string2.h" 1 3 4 | |
3755 | # 46 "/usr/include/bits/string2.h" 3 4 | |
3756 | #define __STRING_INLINE __extern_inline | |
3757 | # 56 "/usr/include/bits/string2.h" 3 4 | |
3758 | #define __STRING2_SMALL_GET16(src,idx) (((__const unsigned char *) (__const char *) (src))[idx + 1] << 8 | ((__const unsigned char *) (__const char *) (src))[idx]) | |
3759 | ||
3760 | ||
3761 | #define __STRING2_SMALL_GET32(src,idx) (((((__const unsigned char *) (__const char *) (src))[idx + 3] << 8 | ((__const unsigned char *) (__const char *) (src))[idx + 2]) << 8 | ((__const unsigned char *) (__const char *) (src))[idx + 1]) << 8 | ((__const unsigned char *) (__const char *) (src))[idx]) | |
3762 | # 93 "/usr/include/bits/string2.h" 3 4 | |
3763 | #define __string2_1bptr_p(__x) ((size_t)(const void *)((__x) + 1) - (size_t)(const void *)(__x) == 1) | |
3764 | # 195 "/usr/include/bits/string2.h" 3 4 | |
3765 | #define __bzero(s,n) __builtin_memset (s, '\0', n) | |
3766 | # 394 "/usr/include/bits/string2.h" 3 4 | |
3767 | extern void *__rawmemchr (const void *__s, int __c); | |
3768 | ||
3769 | #define strchr(s,c) (__extension__ (__builtin_constant_p (c) && !__builtin_constant_p (s) && (c) == '\0' ? (char *) __rawmemchr (s, c) : __builtin_strchr (s, c))) | |
3770 | # 761 "/usr/include/bits/string2.h" 3 4 | |
3771 | #define strncpy(dest,src,n) __builtin_strncpy (dest, src, n) | |
3772 | # 785 "/usr/include/bits/string2.h" 3 4 | |
3773 | #define strncat(dest,src,n) __builtin_strncat (dest, src, n) | |
3774 | # 800 "/usr/include/bits/string2.h" 3 4 | |
3775 | #define strcmp(s1,s2) __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (s1) && __builtin_constant_p (s2) && (__s1_len = strlen (s1), __s2_len = strlen (s2), (!__string2_1bptr_p (s1) || __s1_len >= 4) && (!__string2_1bptr_p (s2) || __s2_len >= 4)) ? __builtin_strcmp (s1, s2) : (__builtin_constant_p (s1) && __string2_1bptr_p (s1) && (__s1_len = strlen (s1), __s1_len < 4) ? (__builtin_constant_p (s2) && __string2_1bptr_p (s2) ? __builtin_strcmp (s1, s2) : __strcmp_cg (s1, s2, __s1_len)) : (__builtin_constant_p (s2) && __string2_1bptr_p (s2) && (__s2_len = strlen (s2), __s2_len < 4) ? (__builtin_constant_p (s1) && __string2_1bptr_p (s1) ? __builtin_strcmp (s1, s2) : __strcmp_gc (s1, s2, __s2_len)) : __builtin_strcmp (s1, s2)))); }) | |
3776 | # 842 "/usr/include/bits/string2.h" 3 4 | |
3777 | #define __strcmp_cc(s1,s2,l) (__extension__ ({ register int __result = (((__const unsigned char *) (__const char *) (s1))[0] - ((__const unsigned char *) (__const char *)(s2))[0]); if (l > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (s1))[1] - ((__const unsigned char *) (__const char *) (s2))[1]); if (l > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (s1))[2] - ((__const unsigned char *) (__const char *) (s2))[2]); if (l > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (s1))[3] - ((__const unsigned char *) (__const char *) (s2))[3]); } } __result; })) | |
3778 | # 869 "/usr/include/bits/string2.h" 3 4 | |
3779 | #define __strcmp_cg(s1,s2,l1) (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) (s2); register int __result = (((__const unsigned char *) (__const char *) (s1))[0] - __s2[0]); if (l1 > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (s1))[1] - __s2[1]); if (l1 > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (s1))[2] - __s2[2]); if (l1 > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (s1))[3] - __s2[3]); } } __result; })) | |
3780 | # 891 "/usr/include/bits/string2.h" 3 4 | |
3781 | #define __strcmp_gc(s1,s2,l2) (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) (s1); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) (s2))[0]; if (l2 > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) (s2))[1]); if (l2 > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) (s2))[2]); if (l2 > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) (s2))[3]); } } __result; })) | |
3782 | # 920 "/usr/include/bits/string2.h" 3 4 | |
3783 | #define strncmp(s1,s2,n) (__extension__ (__builtin_constant_p (n) && ((__builtin_constant_p (s1) && strlen (s1) < ((size_t) (n))) || (__builtin_constant_p (s2) && strlen (s2) < ((size_t) (n)))) ? strcmp (s1, s2) : strncmp (s1, s2, n))) | |
3784 | # 935 "/usr/include/bits/string2.h" 3 4 | |
3785 | #define strcspn(s,reject) __extension__ ({ char __r0, __r1, __r2; (__builtin_constant_p (reject) && __string2_1bptr_p (reject) ? ((__builtin_constant_p (s) && __string2_1bptr_p (s)) ? __builtin_strcspn (s, reject) : ((__r0 = ((__const char *) (reject))[0], __r0 == '\0') ? strlen (s) : ((__r1 = ((__const char *) (reject))[1], __r1 == '\0') ? __strcspn_c1 (s, __r0) : ((__r2 = ((__const char *) (reject))[2], __r2 == '\0') ? __strcspn_c2 (s, __r0, __r1) : (((__const char *) (reject))[3] == '\0' ? __strcspn_c3 (s, __r0, __r1, __r2) : __builtin_strcspn (s, reject)))))) : __builtin_strcspn (s, reject)); }) | |
3786 | # 969 "/usr/include/bits/string2.h" 3 4 | |
3787 | extern __inline size_t __strcspn_c1 (__const char *__s, int __reject); | |
3788 | extern __inline size_t | |
3789 | __strcspn_c1 (__const char *__s, int __reject) | |
3790 | { | |
3791 | register size_t __result = 0; | |
3792 | while (__s[__result] != '\0' && __s[__result] != __reject) | |
3793 | ++__result; | |
3794 | return __result; | |
3795 | } | |
3796 | ||
3797 | extern __inline size_t __strcspn_c2 (__const char *__s, int __reject1, | |
3798 | int __reject2); | |
3799 | extern __inline size_t | |
3800 | __strcspn_c2 (__const char *__s, int __reject1, int __reject2) | |
3801 | { | |
3802 | register size_t __result = 0; | |
3803 | while (__s[__result] != '\0' && __s[__result] != __reject1 | |
3804 | && __s[__result] != __reject2) | |
3805 | ++__result; | |
3806 | return __result; | |
3807 | } | |
3808 | ||
3809 | extern __inline size_t __strcspn_c3 (__const char *__s, int __reject1, | |
3810 | int __reject2, int __reject3); | |
3811 | extern __inline size_t | |
3812 | __strcspn_c3 (__const char *__s, int __reject1, int __reject2, | |
3813 | int __reject3) | |
3814 | { | |
3815 | register size_t __result = 0; | |
3816 | while (__s[__result] != '\0' && __s[__result] != __reject1 | |
3817 | && __s[__result] != __reject2 && __s[__result] != __reject3) | |
3818 | ++__result; | |
3819 | return __result; | |
3820 | } | |
3821 | # 1011 "/usr/include/bits/string2.h" 3 4 | |
3822 | #define strspn(s,accept) __extension__ ({ char __a0, __a1, __a2; (__builtin_constant_p (accept) && __string2_1bptr_p (accept) ? ((__builtin_constant_p (s) && __string2_1bptr_p (s)) ? __builtin_strspn (s, accept) : ((__a0 = ((__const char *) (accept))[0], __a0 == '\0') ? ((void) (s), 0) : ((__a1 = ((__const char *) (accept))[1], __a1 == '\0') ? __strspn_c1 (s, __a0) : ((__a2 = ((__const char *) (accept))[2], __a2 == '\0') ? __strspn_c2 (s, __a0, __a1) : (((__const char *) (accept))[3] == '\0' ? __strspn_c3 (s, __a0, __a1, __a2) : __builtin_strspn (s, accept)))))) : __builtin_strspn (s, accept)); }) | |
3823 | # 1045 "/usr/include/bits/string2.h" 3 4 | |
3824 | extern __inline size_t __strspn_c1 (__const char *__s, int __accept); | |
3825 | extern __inline size_t | |
3826 | __strspn_c1 (__const char *__s, int __accept) | |
3827 | { | |
3828 | register size_t __result = 0; | |
3829 | ||
3830 | while (__s[__result] == __accept) | |
3831 | ++__result; | |
3832 | return __result; | |
3833 | } | |
3834 | ||
3835 | extern __inline size_t __strspn_c2 (__const char *__s, int __accept1, | |
3836 | int __accept2); | |
3837 | extern __inline size_t | |
3838 | __strspn_c2 (__const char *__s, int __accept1, int __accept2) | |
3839 | { | |
3840 | register size_t __result = 0; | |
3841 | ||
3842 | while (__s[__result] == __accept1 || __s[__result] == __accept2) | |
3843 | ++__result; | |
3844 | return __result; | |
3845 | } | |
3846 | ||
3847 | extern __inline size_t __strspn_c3 (__const char *__s, int __accept1, | |
3848 | int __accept2, int __accept3); | |
3849 | extern __inline size_t | |
3850 | __strspn_c3 (__const char *__s, int __accept1, int __accept2, int __accept3) | |
3851 | { | |
3852 | register size_t __result = 0; | |
3853 | ||
3854 | while (__s[__result] == __accept1 || __s[__result] == __accept2 | |
3855 | || __s[__result] == __accept3) | |
3856 | ++__result; | |
3857 | return __result; | |
3858 | } | |
3859 | ||
3860 | ||
3861 | ||
3862 | ||
3863 | ||
3864 | ||
3865 | ||
3866 | #define strpbrk(s,accept) __extension__ ({ char __a0, __a1, __a2; (__builtin_constant_p (accept) && __string2_1bptr_p (accept) ? ((__builtin_constant_p (s) && __string2_1bptr_p (s)) ? __builtin_strpbrk (s, accept) : ((__a0 = ((__const char *) (accept))[0], __a0 == '\0') ? ((void) (s), (char *) NULL) : ((__a1 = ((__const char *) (accept))[1], __a1 == '\0') ? __builtin_strchr (s, __a0) : ((__a2 = ((__const char *) (accept))[2], __a2 == '\0') ? __strpbrk_c2 (s, __a0, __a1) : (((__const char *) (accept))[3] == '\0' ? __strpbrk_c3 (s, __a0, __a1, __a2) : __builtin_strpbrk (s, accept)))))) : __builtin_strpbrk (s, accept)); }) | |
3867 | # 1121 "/usr/include/bits/string2.h" 3 4 | |
3868 | extern __inline char *__strpbrk_c2 (__const char *__s, int __accept1, | |
3869 | int __accept2); | |
3870 | extern __inline char * | |
3871 | __strpbrk_c2 (__const char *__s, int __accept1, int __accept2) | |
3872 | { | |
3873 | ||
3874 | while (*__s != '\0' && *__s != __accept1 && *__s != __accept2) | |
3875 | ++__s; | |
3876 | return *__s == '\0' ? ((void *)0) : (char *) (size_t) __s; | |
3877 | } | |
3878 | ||
3879 | extern __inline char *__strpbrk_c3 (__const char *__s, int __accept1, | |
3880 | int __accept2, int __accept3); | |
3881 | extern __inline char * | |
3882 | __strpbrk_c3 (__const char *__s, int __accept1, int __accept2, | |
3883 | int __accept3) | |
3884 | { | |
3885 | ||
3886 | while (*__s != '\0' && *__s != __accept1 && *__s != __accept2 | |
3887 | && *__s != __accept3) | |
3888 | ++__s; | |
3889 | return *__s == '\0' ? ((void *)0) : (char *) (size_t) __s; | |
3890 | } | |
3891 | # 1164 "/usr/include/bits/string2.h" 3 4 | |
3892 | #define __strtok_r(s,sep,nextp) (__extension__ (__builtin_constant_p (sep) && __string2_1bptr_p (sep) ? (((__const char *) (sep))[0] != '\0' && ((__const char *) (sep))[1] == '\0' ? __strtok_r_1c (s, ((__const char *) (sep))[0], nextp) : __strtok_r (s, sep, nextp)) : __strtok_r (s, sep, nextp))) | |
3893 | # 1173 "/usr/include/bits/string2.h" 3 4 | |
3894 | extern __inline char *__strtok_r_1c (char *__s, char __sep, char **__nextp); | |
3895 | extern __inline char * | |
3896 | __strtok_r_1c (char *__s, char __sep, char **__nextp) | |
3897 | { | |
3898 | char *__result; | |
3899 | if (__s == ((void *)0)) | |
3900 | __s = *__nextp; | |
3901 | while (*__s == __sep) | |
3902 | ++__s; | |
3903 | __result = ((void *)0); | |
3904 | if (*__s != '\0') | |
3905 | { | |
3906 | __result = __s++; | |
3907 | while (*__s != '\0') | |
3908 | if (*__s++ == __sep) | |
3909 | { | |
3910 | __s[-1] = '\0'; | |
3911 | break; | |
3912 | } | |
3913 | *__nextp = __s; | |
3914 | } | |
3915 | return __result; | |
3916 | } | |
3917 | ||
3918 | #define strtok_r(s,sep,nextp) __strtok_r (s, sep, nextp) | |
3919 | ||
3920 | ||
3921 | ||
3922 | ||
3923 | ||
3924 | ||
3925 | ||
3926 | extern char *__strsep_g (char **__stringp, __const char *__delim); | |
3927 | #define __strsep(s,reject) __extension__ ({ char __r0, __r1, __r2; (__builtin_constant_p (reject) && __string2_1bptr_p (reject) && (__r0 = ((__const char *) (reject))[0], ((__const char *) (reject))[0] != '\0') ? ((__r1 = ((__const char *) (reject))[1], ((__const char *) (reject))[1] == '\0') ? __strsep_1c (s, __r0) : ((__r2 = ((__const char *) (reject))[2], __r2 == '\0') ? __strsep_2c (s, __r0, __r1) : (((__const char *) (reject))[3] == '\0' ? __strsep_3c (s, __r0, __r1, __r2) : __strsep_g (s, reject)))) : __strsep_g (s, reject)); }) | |
3928 | # 1223 "/usr/include/bits/string2.h" 3 4 | |
3929 | extern __inline char *__strsep_1c (char **__s, char __reject); | |
3930 | extern __inline char * | |
3931 | __strsep_1c (char **__s, char __reject) | |
3932 | { | |
3933 | register char *__retval = *__s; | |
3934 | if (__retval != ((void *)0) && (*__s = (__extension__ (__builtin_constant_p (__reject) && !__builtin_constant_p (__retval) && (__reject) == '\0' ? (char *) __rawmemchr (__retval, __reject) : __builtin_strchr (__retval, __reject)))) != ((void *)0)) | |
3935 | *(*__s)++ = '\0'; | |
3936 | return __retval; | |
3937 | } | |
3938 | ||
3939 | extern __inline char *__strsep_2c (char **__s, char __reject1, char __reject2); | |
3940 | extern __inline char * | |
3941 | __strsep_2c (char **__s, char __reject1, char __reject2) | |
3942 | { | |
3943 | register char *__retval = *__s; | |
3944 | if (__retval != ((void *)0)) | |
3945 | { | |
3946 | register char *__cp = __retval; | |
3947 | while (1) | |
3948 | { | |
3949 | if (*__cp == '\0') | |
3950 | { | |
3951 | __cp = ((void *)0); | |
3952 | break; | |
3953 | } | |
3954 | if (*__cp == __reject1 || *__cp == __reject2) | |
3955 | { | |
3956 | *__cp++ = '\0'; | |
3957 | break; | |
3958 | } | |
3959 | ++__cp; | |
3960 | } | |
3961 | *__s = __cp; | |
3962 | } | |
3963 | return __retval; | |
3964 | } | |
3965 | ||
3966 | extern __inline char *__strsep_3c (char **__s, char __reject1, char __reject2, | |
3967 | char __reject3); | |
3968 | extern __inline char * | |
3969 | __strsep_3c (char **__s, char __reject1, char __reject2, char __reject3) | |
3970 | { | |
3971 | register char *__retval = *__s; | |
3972 | if (__retval != ((void *)0)) | |
3973 | { | |
3974 | register char *__cp = __retval; | |
3975 | while (1) | |
3976 | { | |
3977 | if (*__cp == '\0') | |
3978 | { | |
3979 | __cp = ((void *)0); | |
3980 | break; | |
3981 | } | |
3982 | if (*__cp == __reject1 || *__cp == __reject2 || *__cp == __reject3) | |
3983 | { | |
3984 | *__cp++ = '\0'; | |
3985 | break; | |
3986 | } | |
3987 | ++__cp; | |
3988 | } | |
3989 | *__s = __cp; | |
3990 | } | |
3991 | return __retval; | |
3992 | } | |
3993 | ||
3994 | #define strsep(s,reject) __strsep (s, reject) | |
3995 | # 1298 "/usr/include/bits/string2.h" 3 4 | |
3996 | #define __need_malloc_and_calloc | |
3997 | ||
3998 | ||
3999 | ||
4000 | ||
4001 | ||
4002 | extern char *__strdup (__const char *__string) __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)); | |
4003 | #define __strdup(s) (__extension__ (__builtin_constant_p (s) && __string2_1bptr_p (s) ? (((__const char *) (s))[0] == '\0' ? (char *) calloc (1, 1) : ({ size_t __len = strlen (s) + 1; char *__retval = (char *) malloc (__len); if (__retval != NULL) __retval = (char *) memcpy (__retval, s, __len); __retval; })) : __strdup (s))) | |
4004 | # 1317 "/usr/include/bits/string2.h" 3 4 | |
4005 | #define strdup(s) __strdup (s) | |
4006 | ||
4007 | ||
4008 | ||
4009 | ||
4010 | ||
4011 | extern char *__strndup (__const char *__string, size_t __n) | |
4012 | __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)); | |
4013 | #define __strndup(s,n) (__extension__ (__builtin_constant_p (s) && __string2_1bptr_p (s) ? (((__const char *) (s))[0] == '\0' ? (char *) calloc (1, 1) : ({ size_t __len = strlen (s) + 1; size_t __n = (n); char *__retval; if (__n < __len) __len = __n + 1; __retval = (char *) malloc (__len); if (__retval != NULL) { __retval[__len - 1] = '\0'; __retval = (char *) memcpy (__retval, s, __len - 1); } __retval; })) : __strndup (s, n))) | |
4014 | # 1352 "/usr/include/bits/string2.h" 3 4 | |
4015 | #undef __STRING_INLINE | |
4016 | # 424 "/usr/include/string.h" 2 3 4 | |
4017 | # 432 "/usr/include/string.h" 3 4 | |
4018 | ||
4019 | # 17 "unix.c" 2 | |
4020 | # 1 "/usr/include/fcntl.h" 1 3 4 | |
4021 | # 25 "/usr/include/fcntl.h" 3 4 | |
4022 | #define _FCNTL_H 1 | |
4023 | ||
4024 | ||
4025 | ||
4026 | ||
4027 | ||
4028 | ||
4029 | ||
4030 | ||
4031 | # 1 "/usr/include/bits/fcntl.h" 1 3 4 | |
4032 | # 33 "/usr/include/bits/fcntl.h" 3 4 | |
4033 | #define O_ACCMODE 0003 | |
4034 | #define O_RDONLY 00 | |
4035 | #define O_WRONLY 01 | |
4036 | #define O_RDWR 02 | |
4037 | #define O_CREAT 0100 | |
4038 | #define O_EXCL 0200 | |
4039 | #define O_NOCTTY 0400 | |
4040 | #define O_TRUNC 01000 | |
4041 | #define O_APPEND 02000 | |
4042 | #define O_NONBLOCK 04000 | |
4043 | #define O_NDELAY O_NONBLOCK | |
4044 | #define O_SYNC 010000 | |
4045 | #define O_FSYNC O_SYNC | |
4046 | #define O_ASYNC 020000 | |
4047 | # 59 "/usr/include/bits/fcntl.h" 3 4 | |
4048 | #define O_DSYNC O_SYNC | |
4049 | #define O_RSYNC O_SYNC | |
4050 | ||
4051 | ||
4052 | ||
4053 | ||
4054 | ||
4055 | ||
4056 | ||
4057 | #define F_DUPFD 0 | |
4058 | #define F_GETFD 1 | |
4059 | #define F_SETFD 2 | |
4060 | #define F_GETFL 3 | |
4061 | #define F_SETFL 4 | |
4062 | ||
4063 | #define F_GETLK 5 | |
4064 | #define F_SETLK 6 | |
4065 | #define F_SETLKW 7 | |
4066 | ||
4067 | ||
4068 | ||
4069 | ||
4070 | ||
4071 | #define F_GETLK64 12 | |
4072 | #define F_SETLK64 13 | |
4073 | #define F_SETLKW64 14 | |
4074 | ||
4075 | ||
4076 | #define F_SETOWN 8 | |
4077 | #define F_GETOWN 9 | |
4078 | # 103 "/usr/include/bits/fcntl.h" 3 4 | |
4079 | #define FD_CLOEXEC 1 | |
4080 | ||
4081 | ||
4082 | #define F_RDLCK 0 | |
4083 | #define F_WRLCK 1 | |
4084 | #define F_UNLCK 2 | |
4085 | ||
4086 | ||
4087 | #define F_EXLCK 4 | |
4088 | #define F_SHLCK 8 | |
4089 | ||
4090 | ||
4091 | ||
4092 | #define LOCK_SH 1 | |
4093 | #define LOCK_EX 2 | |
4094 | #define LOCK_NB 4 | |
4095 | ||
4096 | #define LOCK_UN 8 | |
4097 | # 141 "/usr/include/bits/fcntl.h" 3 4 | |
4098 | struct flock | |
4099 | { | |
4100 | short int l_type; | |
4101 | short int l_whence; | |
4102 | ||
4103 | __off_t l_start; | |
4104 | __off_t l_len; | |
4105 | ||
4106 | ||
4107 | ||
4108 | ||
4109 | __pid_t l_pid; | |
4110 | }; | |
4111 | # 169 "/usr/include/bits/fcntl.h" 3 4 | |
4112 | #define FAPPEND O_APPEND | |
4113 | #define FFSYNC O_FSYNC | |
4114 | #define FASYNC O_ASYNC | |
4115 | #define FNONBLOCK O_NONBLOCK | |
4116 | #define FNDELAY O_NDELAY | |
4117 | ||
4118 | ||
4119 | ||
4120 | ||
4121 | #define POSIX_FADV_NORMAL 0 | |
4122 | #define POSIX_FADV_RANDOM 1 | |
4123 | #define POSIX_FADV_SEQUENTIAL 2 | |
4124 | #define POSIX_FADV_WILLNEED 3 | |
4125 | #define POSIX_FADV_DONTNEED 4 | |
4126 | #define POSIX_FADV_NOREUSE 5 | |
4127 | # 208 "/usr/include/bits/fcntl.h" 3 4 | |
4128 | ||
4129 | # 237 "/usr/include/bits/fcntl.h" 3 4 | |
4130 | ||
4131 | # 35 "/usr/include/fcntl.h" 2 3 4 | |
4132 | # 45 "/usr/include/fcntl.h" 3 4 | |
4133 | #define R_OK 4 | |
4134 | #define W_OK 2 | |
4135 | #define X_OK 1 | |
4136 | #define F_OK 0 | |
4137 | # 76 "/usr/include/fcntl.h" 3 4 | |
4138 | extern int fcntl (int __fd, int __cmd, ...); | |
4139 | # 85 "/usr/include/fcntl.h" 3 4 | |
4140 | extern int open (__const char *__file, int __oflag, ...) __attribute__ ((__nonnull__ (1))); | |
4141 | # 130 "/usr/include/fcntl.h" 3 4 | |
4142 | extern int creat (__const char *__file, __mode_t __mode) __attribute__ ((__nonnull__ (1))); | |
4143 | # 153 "/usr/include/fcntl.h" 3 4 | |
4144 | #define F_ULOCK 0 | |
4145 | #define F_LOCK 1 | |
4146 | #define F_TLOCK 2 | |
4147 | #define F_TEST 3 | |
4148 | ||
4149 | ||
4150 | extern int lockf (int __fd, int __cmd, __off_t __len); | |
4151 | # 176 "/usr/include/fcntl.h" 3 4 | |
4152 | extern int posix_fadvise (int __fd, __off_t __offset, __off_t __len, | |
4153 | int __advise) __attribute__ ((__nothrow__)); | |
4154 | # 198 "/usr/include/fcntl.h" 3 4 | |
4155 | extern int posix_fallocate (int __fd, __off_t __offset, __off_t __len); | |
4156 | # 213 "/usr/include/fcntl.h" 3 4 | |
4157 | ||
4158 | # 18 "unix.c" 2 | |
4159 | # 1 "/usr/include/ctype.h" 1 3 4 | |
4160 | # 25 "/usr/include/ctype.h" 3 4 | |
4161 | #define _CTYPE_H 1 | |
4162 | ||
4163 | ||
4164 | ||
4165 | ||
4166 | ||
4167 | # 45 "/usr/include/ctype.h" 3 4 | |
4168 | #define _ISbit(bit) ((bit) < 8 ? ((1 << (bit)) << 8) : ((1 << (bit)) >> 8)) | |
4169 | ||
4170 | ||
4171 | enum | |
4172 | { | |
4173 | _ISupper = ((0) < 8 ? ((1 << (0)) << 8) : ((1 << (0)) >> 8)), | |
4174 | _ISlower = ((1) < 8 ? ((1 << (1)) << 8) : ((1 << (1)) >> 8)), | |
4175 | _ISalpha = ((2) < 8 ? ((1 << (2)) << 8) : ((1 << (2)) >> 8)), | |
4176 | _ISdigit = ((3) < 8 ? ((1 << (3)) << 8) : ((1 << (3)) >> 8)), | |
4177 | _ISxdigit = ((4) < 8 ? ((1 << (4)) << 8) : ((1 << (4)) >> 8)), | |
4178 | _ISspace = ((5) < 8 ? ((1 << (5)) << 8) : ((1 << (5)) >> 8)), | |
4179 | _ISprint = ((6) < 8 ? ((1 << (6)) << 8) : ((1 << (6)) >> 8)), | |
4180 | _ISgraph = ((7) < 8 ? ((1 << (7)) << 8) : ((1 << (7)) >> 8)), | |
4181 | _ISblank = ((8) < 8 ? ((1 << (8)) << 8) : ((1 << (8)) >> 8)), | |
4182 | _IScntrl = ((9) < 8 ? ((1 << (9)) << 8) : ((1 << (9)) >> 8)), | |
4183 | _ISpunct = ((10) < 8 ? ((1 << (10)) << 8) : ((1 << (10)) >> 8)), | |
4184 | _ISalnum = ((11) < 8 ? ((1 << (11)) << 8) : ((1 << (11)) >> 8)) | |
4185 | }; | |
4186 | # 81 "/usr/include/ctype.h" 3 4 | |
4187 | extern __const unsigned short int **__ctype_b_loc (void) | |
4188 | __attribute__ ((__const)); | |
4189 | extern __const __int32_t **__ctype_tolower_loc (void) | |
4190 | __attribute__ ((__const)); | |
4191 | extern __const __int32_t **__ctype_toupper_loc (void) | |
4192 | __attribute__ ((__const)); | |
4193 | ||
4194 | #define __isctype(c,type) ((*__ctype_b_loc ())[(int) (c)] & (unsigned short int) type) | |
4195 | ||
4196 | ||
4197 | #define __isascii(c) (((c) & ~0x7f) == 0) | |
4198 | #define __toascii(c) ((c) & 0x7f) | |
4199 | ||
4200 | #define __exctype(name) extern int name (int) __THROW | |
4201 | ||
4202 | ||
4203 | ||
4204 | ||
4205 | ||
4206 | ||
4207 | ||
4208 | extern int isalnum (int) __attribute__ ((__nothrow__)); | |
4209 | extern int isalpha (int) __attribute__ ((__nothrow__)); | |
4210 | extern int iscntrl (int) __attribute__ ((__nothrow__)); | |
4211 | extern int isdigit (int) __attribute__ ((__nothrow__)); | |
4212 | extern int islower (int) __attribute__ ((__nothrow__)); | |
4213 | extern int isgraph (int) __attribute__ ((__nothrow__)); | |
4214 | extern int isprint (int) __attribute__ ((__nothrow__)); | |
4215 | extern int ispunct (int) __attribute__ ((__nothrow__)); | |
4216 | extern int isspace (int) __attribute__ ((__nothrow__)); | |
4217 | extern int isupper (int) __attribute__ ((__nothrow__)); | |
4218 | extern int isxdigit (int) __attribute__ ((__nothrow__)); | |
4219 | ||
4220 | ||
4221 | ||
4222 | extern int tolower (int __c) __attribute__ ((__nothrow__)); | |
4223 | ||
4224 | ||
4225 | extern int toupper (int __c) __attribute__ ((__nothrow__)); | |
4226 | ||
4227 | ||
4228 | # 142 "/usr/include/ctype.h" 3 4 | |
4229 | extern int isascii (int __c) __attribute__ ((__nothrow__)); | |
4230 | ||
4231 | ||
4232 | ||
4233 | extern int toascii (int __c) __attribute__ ((__nothrow__)); | |
4234 | ||
4235 | ||
4236 | ||
4237 | extern int _toupper (int) __attribute__ ((__nothrow__)); | |
4238 | extern int _tolower (int) __attribute__ ((__nothrow__)); | |
4239 | ||
4240 | ||
4241 | ||
4242 | #define __tobody(c,f,a,args) (__extension__ ({ int __res; if (sizeof (c) > 1) { if (__builtin_constant_p (c)) { int __c = (c); __res = __c < -128 || __c > 255 ? __c : (a)[__c]; } else __res = f args; } else __res = (a)[(int) (c)]; __res; })) | |
4243 | # 173 "/usr/include/ctype.h" 3 4 | |
4244 | #define isalnum(c) __isctype((c), _ISalnum) | |
4245 | #define isalpha(c) __isctype((c), _ISalpha) | |
4246 | #define iscntrl(c) __isctype((c), _IScntrl) | |
4247 | #define isdigit(c) __isctype((c), _ISdigit) | |
4248 | #define islower(c) __isctype((c), _ISlower) | |
4249 | #define isgraph(c) __isctype((c), _ISgraph) | |
4250 | #define isprint(c) __isctype((c), _ISprint) | |
4251 | #define ispunct(c) __isctype((c), _ISpunct) | |
4252 | #define isspace(c) __isctype((c), _ISspace) | |
4253 | #define isupper(c) __isctype((c), _ISupper) | |
4254 | #define isxdigit(c) __isctype((c), _ISxdigit) | |
4255 | ||
4256 | ||
4257 | ||
4258 | ||
4259 | ||
4260 | ||
4261 | extern __inline int | |
4262 | __attribute__ ((__nothrow__)) tolower (int __c) | |
4263 | { | |
4264 | return __c >= -128 && __c < 256 ? (*__ctype_tolower_loc ())[__c] : __c; | |
4265 | } | |
4266 | ||
4267 | extern __inline int | |
4268 | __attribute__ ((__nothrow__)) toupper (int __c) | |
4269 | { | |
4270 | return __c >= -128 && __c < 256 ? (*__ctype_toupper_loc ())[__c] : __c; | |
4271 | } | |
4272 | ||
4273 | ||
4274 | ||
4275 | #define tolower(c) __tobody (c, tolower, *__ctype_tolower_loc (), (c)) | |
4276 | #define toupper(c) __tobody (c, toupper, *__ctype_toupper_loc (), (c)) | |
4277 | ||
4278 | ||
4279 | ||
4280 | #define isascii(c) __isascii (c) | |
4281 | #define toascii(c) __toascii (c) | |
4282 | ||
4283 | #define _tolower(c) ((int) (*__ctype_tolower_loc ())[(int) (c)]) | |
4284 | #define _toupper(c) ((int) (*__ctype_toupper_loc ())[(int) (c)]) | |
4285 | # 323 "/usr/include/ctype.h" 3 4 | |
4286 | ||
4287 | # 19 "unix.c" 2 | |
4288 | # 1 "/usr/include/time.h" 1 3 4 | |
4289 | # 28 "/usr/include/time.h" 3 4 | |
4290 | #define _TIME_H 1 | |
4291 | ||
4292 | ||
4293 | ||
4294 | ||
4295 | ||
4296 | ||
4297 | ||
4298 | ||
4299 | #define __need_size_t | |
4300 | #define __need_NULL | |
4301 | # 1 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/stddef.h" 1 3 4 | |
4302 | # 236 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/stddef.h" 3 4 | |
4303 | #undef __need_size_t | |
4304 | # 398 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/stddef.h" 3 4 | |
4305 | #undef NULL | |
4306 | ||
4307 | ||
4308 | ||
4309 | ||
4310 | #define NULL ((void *)0) | |
4311 | ||
4312 | ||
4313 | ||
4314 | ||
4315 | ||
4316 | #undef __need_NULL | |
4317 | # 40 "/usr/include/time.h" 2 3 4 | |
4318 | ||
4319 | ||
4320 | ||
4321 | # 1 "/usr/include/bits/time.h" 1 3 4 | |
4322 | # 26 "/usr/include/bits/time.h" 3 4 | |
4323 | #define _BITS_TIME_H 1 | |
4324 | ||
4325 | ||
4326 | ||
4327 | ||
4328 | ||
4329 | ||
4330 | ||
4331 | #define CLOCKS_PER_SEC 1000000l | |
4332 | # 46 "/usr/include/bits/time.h" 3 4 | |
4333 | #define CLOCK_REALTIME 0 | |
4334 | ||
4335 | #define CLOCK_MONOTONIC 1 | |
4336 | ||
4337 | #define CLOCK_PROCESS_CPUTIME_ID 2 | |
4338 | ||
4339 | #define CLOCK_THREAD_CPUTIME_ID 3 | |
4340 | ||
4341 | ||
4342 | #define TIMER_ABSTIME 1 | |
4343 | # 44 "/usr/include/time.h" 2 3 4 | |
4344 | # 55 "/usr/include/time.h" 3 4 | |
4345 | #define __clock_t_defined 1 | |
4346 | ||
4347 | ||
4348 | ||
4349 | ||
4350 | ||
4351 | typedef __clock_t clock_t; | |
4352 | ||
4353 | ||
4354 | ||
4355 | ||
4356 | ||
4357 | ||
4358 | #undef __need_clock_t | |
4359 | # 84 "/usr/include/time.h" 3 4 | |
4360 | #undef __need_time_t | |
4361 | # 96 "/usr/include/time.h" 3 4 | |
4362 | #undef __clockid_time_t | |
4363 | # 108 "/usr/include/time.h" 3 4 | |
4364 | #undef __need_timer_t | |
4365 | # 128 "/usr/include/time.h" 3 4 | |
4366 | #undef __need_timespec | |
4367 | ||
4368 | ||
4369 | ||
4370 | ||
4371 | ||
4372 | struct tm | |
4373 | { | |
4374 | int tm_sec; | |
4375 | int tm_min; | |
4376 | int tm_hour; | |
4377 | int tm_mday; | |
4378 | int tm_mon; | |
4379 | int tm_year; | |
4380 | int tm_wday; | |
4381 | int tm_yday; | |
4382 | int tm_isdst; | |
4383 | ||
4384 | ||
4385 | long int tm_gmtoff; | |
4386 | __const char *tm_zone; | |
4387 | ||
4388 | ||
4389 | ||
4390 | ||
4391 | }; | |
4392 | ||
4393 | ||
4394 | ||
4395 | ||
4396 | ||
4397 | ||
4398 | ||
4399 | ||
4400 | struct itimerspec | |
4401 | { | |
4402 | struct timespec it_interval; | |
4403 | struct timespec it_value; | |
4404 | }; | |
4405 | ||
4406 | ||
4407 | struct sigevent; | |
4408 | # 181 "/usr/include/time.h" 3 4 | |
4409 | ||
4410 | ||
4411 | ||
4412 | extern clock_t clock (void) __attribute__ ((__nothrow__)); | |
4413 | ||
4414 | ||
4415 | extern time_t time (time_t *__timer) __attribute__ ((__nothrow__)); | |
4416 | ||
4417 | ||
4418 | extern double difftime (time_t __time1, time_t __time0) | |
4419 | __attribute__ ((__nothrow__)) __attribute__ ((__const__)); | |
4420 | ||
4421 | ||
4422 | extern time_t mktime (struct tm *__tp) __attribute__ ((__nothrow__)); | |
4423 | ||
4424 | ||
4425 | ||
4426 | ||
4427 | ||
4428 | extern size_t strftime (char *__restrict __s, size_t __maxsize, | |
4429 | __const char *__restrict __format, | |
4430 | __const struct tm *__restrict __tp) __attribute__ ((__nothrow__)); | |
4431 | ||
4432 | # 229 "/usr/include/time.h" 3 4 | |
4433 | ||
4434 | ||
4435 | ||
4436 | extern struct tm *gmtime (__const time_t *__timer) __attribute__ ((__nothrow__)); | |
4437 | ||
4438 | ||
4439 | ||
4440 | extern struct tm *localtime (__const time_t *__timer) __attribute__ ((__nothrow__)); | |
4441 | ||
4442 | ||
4443 | ||
4444 | ||
4445 | ||
4446 | extern struct tm *gmtime_r (__const time_t *__restrict __timer, | |
4447 | struct tm *__restrict __tp) __attribute__ ((__nothrow__)); | |
4448 | ||
4449 | ||
4450 | ||
4451 | extern struct tm *localtime_r (__const time_t *__restrict __timer, | |
4452 | struct tm *__restrict __tp) __attribute__ ((__nothrow__)); | |
4453 | ||
4454 | ||
4455 | ||
4456 | ||
4457 | ||
4458 | extern char *asctime (__const struct tm *__tp) __attribute__ ((__nothrow__)); | |
4459 | ||
4460 | ||
4461 | extern char *ctime (__const time_t *__timer) __attribute__ ((__nothrow__)); | |
4462 | ||
4463 | ||
4464 | ||
4465 | ||
4466 | ||
4467 | ||
4468 | ||
4469 | extern char *asctime_r (__const struct tm *__restrict __tp, | |
4470 | char *__restrict __buf) __attribute__ ((__nothrow__)); | |
4471 | ||
4472 | ||
4473 | extern char *ctime_r (__const time_t *__restrict __timer, | |
4474 | char *__restrict __buf) __attribute__ ((__nothrow__)); | |
4475 | ||
4476 | ||
4477 | ||
4478 | ||
4479 | extern char *__tzname[2]; | |
4480 | extern int __daylight; | |
4481 | extern long int __timezone; | |
4482 | ||
4483 | ||
4484 | ||
4485 | ||
4486 | extern char *tzname[2]; | |
4487 | ||
4488 | ||
4489 | ||
4490 | extern void tzset (void) __attribute__ ((__nothrow__)); | |
4491 | ||
4492 | ||
4493 | ||
4494 | extern int daylight; | |
4495 | extern long int timezone; | |
4496 | ||
4497 | ||
4498 | ||
4499 | ||
4500 | ||
4501 | extern int stime (__const time_t *__when) __attribute__ ((__nothrow__)); | |
4502 | ||
4503 | ||
4504 | ||
4505 | ||
4506 | ||
4507 | #define __isleap(year) ((year) % 4 == 0 && ((year) % 100 != 0 || (year) % 400 == 0)) | |
4508 | # 312 "/usr/include/time.h" 3 4 | |
4509 | extern time_t timegm (struct tm *__tp) __attribute__ ((__nothrow__)); | |
4510 | ||
4511 | ||
4512 | extern time_t timelocal (struct tm *__tp) __attribute__ ((__nothrow__)); | |
4513 | ||
4514 | ||
4515 | extern int dysize (int __year) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); | |
4516 | # 327 "/usr/include/time.h" 3 4 | |
4517 | extern int nanosleep (__const struct timespec *__requested_time, | |
4518 | struct timespec *__remaining); | |
4519 | ||
4520 | ||
4521 | ||
4522 | extern int clock_getres (clockid_t __clock_id, struct timespec *__res) __attribute__ ((__nothrow__)); | |
4523 | ||
4524 | ||
4525 | extern int clock_gettime (clockid_t __clock_id, struct timespec *__tp) __attribute__ ((__nothrow__)); | |
4526 | ||
4527 | ||
4528 | extern int clock_settime (clockid_t __clock_id, __const struct timespec *__tp) | |
4529 | __attribute__ ((__nothrow__)); | |
4530 | ||
4531 | ||
4532 | ||
4533 | ||
4534 | ||
4535 | ||
4536 | extern int clock_nanosleep (clockid_t __clock_id, int __flags, | |
4537 | __const struct timespec *__req, | |
4538 | struct timespec *__rem); | |
4539 | ||
4540 | ||
4541 | extern int clock_getcpuclockid (pid_t __pid, clockid_t *__clock_id) __attribute__ ((__nothrow__)); | |
4542 | ||
4543 | ||
4544 | ||
4545 | ||
4546 | extern int timer_create (clockid_t __clock_id, | |
4547 | struct sigevent *__restrict __evp, | |
4548 | timer_t *__restrict __timerid) __attribute__ ((__nothrow__)); | |
4549 | ||
4550 | ||
4551 | extern int timer_delete (timer_t __timerid) __attribute__ ((__nothrow__)); | |
4552 | ||
4553 | ||
4554 | extern int timer_settime (timer_t __timerid, int __flags, | |
4555 | __const struct itimerspec *__restrict __value, | |
4556 | struct itimerspec *__restrict __ovalue) __attribute__ ((__nothrow__)); | |
4557 | ||
4558 | ||
4559 | extern int timer_gettime (timer_t __timerid, struct itimerspec *__value) | |
4560 | __attribute__ ((__nothrow__)); | |
4561 | ||
4562 | ||
4563 | extern int timer_getoverrun (timer_t __timerid) __attribute__ ((__nothrow__)); | |
4564 | # 416 "/usr/include/time.h" 3 4 | |
4565 | ||
4566 | # 20 "unix.c" 2 | |
4567 | ||
4568 | # 1 "/usr/include/signal.h" 1 3 4 | |
4569 | # 26 "/usr/include/signal.h" 3 4 | |
4570 | #define _SIGNAL_H | |
4571 | ||
4572 | ||
4573 | ||
4574 | ||
4575 | ||
4576 | ||
4577 | # 1 "/usr/include/bits/sigset.h" 1 3 4 | |
4578 | # 44 "/usr/include/bits/sigset.h" 3 4 | |
4579 | #define _SIGSET_H_fns 1 | |
4580 | ||
4581 | ||
4582 | #define _EXTERN_INLINE __extern_inline | |
4583 | ||
4584 | ||
4585 | ||
4586 | #define __sigmask(sig) (((unsigned long int) 1) << (((sig) - 1) % (8 * sizeof (unsigned long int)))) | |
4587 | ||
4588 | ||
4589 | ||
4590 | #define __sigword(sig) (((sig) - 1) / (8 * sizeof (unsigned long int))) | |
4591 | ||
4592 | ||
4593 | #define __sigemptyset(set) (__extension__ ({ int __cnt = _SIGSET_NWORDS; sigset_t *__set = (set); while (--__cnt >= 0) __set->__val[__cnt] = 0; 0; })) | |
4594 | ||
4595 | ||
4596 | ||
4597 | ||
4598 | #define __sigfillset(set) (__extension__ ({ int __cnt = _SIGSET_NWORDS; sigset_t *__set = (set); while (--__cnt >= 0) __set->__val[__cnt] = ~0UL; 0; })) | |
4599 | # 104 "/usr/include/bits/sigset.h" 3 4 | |
4600 | extern int __sigismember (__const __sigset_t *, int); | |
4601 | extern int __sigaddset (__sigset_t *, int); | |
4602 | extern int __sigdelset (__sigset_t *, int); | |
4603 | ||
4604 | ||
4605 | #define __SIGSETFN(NAME,BODY,CONST) _EXTERN_INLINE int NAME (CONST __sigset_t *__set, int __sig) { unsigned long int __mask = __sigmask (__sig); unsigned long int __word = __sigword (__sig); return BODY; } | |
4606 | # 118 "/usr/include/bits/sigset.h" 3 4 | |
4607 | extern __inline int __sigismember (__const __sigset_t *__set, int __sig) { unsigned long int __mask = (((unsigned long int) 1) << (((__sig) - 1) % (8 * sizeof (unsigned long int)))); unsigned long int __word = (((__sig) - 1) / (8 * sizeof (unsigned long int))); return (__set->__val[__word] & __mask) ? 1 : 0; } | |
4608 | extern __inline int __sigaddset ( __sigset_t *__set, int __sig) { unsigned long int __mask = (((unsigned long int) 1) << (((__sig) - 1) % (8 * sizeof (unsigned long int)))); unsigned long int __word = (((__sig) - 1) / (8 * sizeof (unsigned long int))); return ((__set->__val[__word] |= __mask), 0); } | |
4609 | extern __inline int __sigdelset ( __sigset_t *__set, int __sig) { unsigned long int __mask = (((unsigned long int) 1) << (((__sig) - 1) % (8 * sizeof (unsigned long int)))); unsigned long int __word = (((__sig) - 1) / (8 * sizeof (unsigned long int))); return ((__set->__val[__word] &= ~__mask), 0); } | |
4610 | ||
4611 | #undef __SIGSETFN | |
4612 | # 34 "/usr/include/signal.h" 2 3 4 | |
4613 | ||
4614 | ||
4615 | ||
4616 | ||
4617 | ||
4618 | #define __sig_atomic_t_defined | |
4619 | ||
4620 | typedef __sig_atomic_t sig_atomic_t; | |
4621 | ||
4622 | ||
4623 | #undef __need_sig_atomic_t | |
4624 | ||
4625 | ||
4626 | ||
4627 | ||
4628 | ||
4629 | ||
4630 | ||
4631 | #undef __need_sigset_t | |
4632 | ||
4633 | ||
4634 | ||
4635 | ||
4636 | ||
4637 | # 1 "/usr/include/bits/signum.h" 1 3 4 | |
4638 | # 23 "/usr/include/bits/signum.h" 3 4 | |
4639 | #define SIG_ERR ((__sighandler_t) -1) | |
4640 | #define SIG_DFL ((__sighandler_t) 0) | |
4641 | #define SIG_IGN ((__sighandler_t) 1) | |
4642 | ||
4643 | ||
4644 | ||
4645 | ||
4646 | ||
4647 | ||
4648 | ||
4649 | #define SIGHUP 1 | |
4650 | #define SIGINT 2 | |
4651 | #define SIGQUIT 3 | |
4652 | #define SIGILL 4 | |
4653 | #define SIGTRAP 5 | |
4654 | #define SIGABRT 6 | |
4655 | #define SIGIOT 6 | |
4656 | #define SIGBUS 7 | |
4657 | #define SIGFPE 8 | |
4658 | #define SIGKILL 9 | |
4659 | #define SIGUSR1 10 | |
4660 | #define SIGSEGV 11 | |
4661 | #define SIGUSR2 12 | |
4662 | #define SIGPIPE 13 | |
4663 | #define SIGALRM 14 | |
4664 | #define SIGTERM 15 | |
4665 | #define SIGSTKFLT 16 | |
4666 | #define SIGCLD SIGCHLD | |
4667 | #define SIGCHLD 17 | |
4668 | #define SIGCONT 18 | |
4669 | #define SIGSTOP 19 | |
4670 | #define SIGTSTP 20 | |
4671 | #define SIGTTIN 21 | |
4672 | #define SIGTTOU 22 | |
4673 | #define SIGURG 23 | |
4674 | #define SIGXCPU 24 | |
4675 | #define SIGXFSZ 25 | |
4676 | #define SIGVTALRM 26 | |
4677 | #define SIGPROF 27 | |
4678 | #define SIGWINCH 28 | |
4679 | #define SIGPOLL SIGIO | |
4680 | #define SIGIO 29 | |
4681 | #define SIGPWR 30 | |
4682 | #define SIGSYS 31 | |
4683 | #define SIGUNUSED 31 | |
4684 | ||
4685 | #define _NSIG 65 | |
4686 | ||
4687 | ||
4688 | #define SIGRTMIN (__libc_current_sigrtmin ()) | |
4689 | #define SIGRTMAX (__libc_current_sigrtmax ()) | |
4690 | ||
4691 | ||
4692 | ||
4693 | #define __SIGRTMIN 32 | |
4694 | #define __SIGRTMAX (_NSIG - 1) | |
4695 | # 59 "/usr/include/signal.h" 2 3 4 | |
4696 | # 75 "/usr/include/signal.h" 3 4 | |
4697 | typedef void (*__sighandler_t) (int); | |
4698 | ||
4699 | ||
4700 | ||
4701 | ||
4702 | extern __sighandler_t __sysv_signal (int __sig, __sighandler_t __handler) | |
4703 | __attribute__ ((__nothrow__)); | |
4704 | # 90 "/usr/include/signal.h" 3 4 | |
4705 | ||
4706 | ||
4707 | extern __sighandler_t signal (int __sig, __sighandler_t __handler) | |
4708 | __attribute__ ((__nothrow__)); | |
4709 | # 104 "/usr/include/signal.h" 3 4 | |
4710 | ||
4711 | # 117 "/usr/include/signal.h" 3 4 | |
4712 | extern int kill (__pid_t __pid, int __sig) __attribute__ ((__nothrow__)); | |
4713 | ||
4714 | ||
4715 | ||
4716 | ||
4717 | ||
4718 | ||
4719 | extern int killpg (__pid_t __pgrp, int __sig) __attribute__ ((__nothrow__)); | |
4720 | ||
4721 | ||
4722 | ||
4723 | ||
4724 | extern int raise (int __sig) __attribute__ ((__nothrow__)); | |
4725 | ||
4726 | ||
4727 | ||
4728 | ||
4729 | extern __sighandler_t ssignal (int __sig, __sighandler_t __handler) | |
4730 | __attribute__ ((__nothrow__)); | |
4731 | extern int gsignal (int __sig) __attribute__ ((__nothrow__)); | |
4732 | ||
4733 | ||
4734 | ||
4735 | ||
4736 | extern void psignal (int __sig, __const char *__s); | |
4737 | # 153 "/usr/include/signal.h" 3 4 | |
4738 | extern int __sigpause (int __sig_or_mask, int __is_sig); | |
4739 | # 178 "/usr/include/signal.h" 3 4 | |
4740 | #define sigmask(sig) __sigmask(sig) | |
4741 | ||
4742 | ||
4743 | extern int sigblock (int __mask) __attribute__ ((__nothrow__)) __attribute__ ((__deprecated__)); | |
4744 | ||
4745 | ||
4746 | extern int sigsetmask (int __mask) __attribute__ ((__nothrow__)) __attribute__ ((__deprecated__)); | |
4747 | ||
4748 | ||
4749 | extern int siggetmask (void) __attribute__ ((__nothrow__)) __attribute__ ((__deprecated__)); | |
4750 | ||
4751 | ||
4752 | ||
4753 | ||
4754 | #define NSIG _NSIG | |
4755 | # 201 "/usr/include/signal.h" 3 4 | |
4756 | typedef __sighandler_t sig_t; | |
4757 | ||
4758 | ||
4759 | ||
4760 | ||
4761 | ||
4762 | ||
4763 | #define __need_timespec | |
4764 | ||
4765 | ||
4766 | ||
4767 | # 1 "/usr/include/bits/siginfo.h" 1 3 4 | |
4768 | # 25 "/usr/include/bits/siginfo.h" 3 4 | |
4769 | # 1 "/usr/include/bits/wordsize.h" 1 3 4 | |
4770 | # 19 "/usr/include/bits/wordsize.h" 3 4 | |
4771 | #define __WORDSIZE 32 | |
4772 | # 26 "/usr/include/bits/siginfo.h" 2 3 4 | |
4773 | ||
4774 | ||
4775 | ||
4776 | ||
4777 | #define __have_sigval_t 1 | |
4778 | ||
4779 | ||
4780 | typedef union sigval | |
4781 | { | |
4782 | int sival_int; | |
4783 | void *sival_ptr; | |
4784 | } sigval_t; | |
4785 | ||
4786 | ||
4787 | ||
4788 | ||
4789 | #define __have_siginfo_t 1 | |
4790 | ||
4791 | #define __SI_MAX_SIZE 128 | |
4792 | ||
4793 | ||
4794 | ||
4795 | #define __SI_PAD_SIZE ((__SI_MAX_SIZE / sizeof (int)) - 3) | |
4796 | ||
4797 | ||
4798 | typedef struct siginfo | |
4799 | { | |
4800 | int si_signo; | |
4801 | int si_errno; | |
4802 | ||
4803 | int si_code; | |
4804 | ||
4805 | union | |
4806 | { | |
4807 | int _pad[((128 / sizeof (int)) - 3)]; | |
4808 | ||
4809 | ||
4810 | struct | |
4811 | { | |
4812 | __pid_t si_pid; | |
4813 | __uid_t si_uid; | |
4814 | } _kill; | |
4815 | ||
4816 | ||
4817 | struct | |
4818 | { | |
4819 | int si_tid; | |
4820 | int si_overrun; | |
4821 | sigval_t si_sigval; | |
4822 | } _timer; | |
4823 | ||
4824 | ||
4825 | struct | |
4826 | { | |
4827 | __pid_t si_pid; | |
4828 | __uid_t si_uid; | |
4829 | sigval_t si_sigval; | |
4830 | } _rt; | |
4831 | ||
4832 | ||
4833 | struct | |
4834 | { | |
4835 | __pid_t si_pid; | |
4836 | __uid_t si_uid; | |
4837 | int si_status; | |
4838 | __clock_t si_utime; | |
4839 | __clock_t si_stime; | |
4840 | } _sigchld; | |
4841 | ||
4842 | ||
4843 | struct | |
4844 | { | |
4845 | void *si_addr; | |
4846 | } _sigfault; | |
4847 | ||
4848 | ||
4849 | struct | |
4850 | { | |
4851 | long int si_band; | |
4852 | int si_fd; | |
4853 | } _sigpoll; | |
4854 | } _sifields; | |
4855 | } siginfo_t; | |
4856 | ||
4857 | ||
4858 | ||
4859 | #define si_pid _sifields._kill.si_pid | |
4860 | #define si_uid _sifields._kill.si_uid | |
4861 | #define si_timerid _sifields._timer.si_tid | |
4862 | #define si_overrun _sifields._timer.si_overrun | |
4863 | #define si_status _sifields._sigchld.si_status | |
4864 | #define si_utime _sifields._sigchld.si_utime | |
4865 | #define si_stime _sifields._sigchld.si_stime | |
4866 | #define si_value _sifields._rt.si_sigval | |
4867 | #define si_int _sifields._rt.si_sigval.sival_int | |
4868 | #define si_ptr _sifields._rt.si_sigval.sival_ptr | |
4869 | #define si_addr _sifields._sigfault.si_addr | |
4870 | #define si_band _sifields._sigpoll.si_band | |
4871 | #define si_fd _sifields._sigpoll.si_fd | |
4872 | ||
4873 | ||
4874 | ||
4875 | ||
4876 | enum | |
4877 | { | |
4878 | SI_ASYNCNL = -60, | |
4879 | #define SI_ASYNCNL SI_ASYNCNL | |
4880 | SI_TKILL = -6, | |
4881 | #define SI_TKILL SI_TKILL | |
4882 | SI_SIGIO, | |
4883 | #define SI_SIGIO SI_SIGIO | |
4884 | SI_ASYNCIO, | |
4885 | #define SI_ASYNCIO SI_ASYNCIO | |
4886 | SI_MESGQ, | |
4887 | #define SI_MESGQ SI_MESGQ | |
4888 | SI_TIMER, | |
4889 | #define SI_TIMER SI_TIMER | |
4890 | SI_QUEUE, | |
4891 | #define SI_QUEUE SI_QUEUE | |
4892 | SI_USER, | |
4893 | #define SI_USER SI_USER | |
4894 | SI_KERNEL = 0x80 | |
4895 | #define SI_KERNEL SI_KERNEL | |
4896 | }; | |
4897 | ||
4898 | ||
4899 | ||
4900 | enum | |
4901 | { | |
4902 | ILL_ILLOPC = 1, | |
4903 | #define ILL_ILLOPC ILL_ILLOPC | |
4904 | ILL_ILLOPN, | |
4905 | #define ILL_ILLOPN ILL_ILLOPN | |
4906 | ILL_ILLADR, | |
4907 | #define ILL_ILLADR ILL_ILLADR | |
4908 | ILL_ILLTRP, | |
4909 | #define ILL_ILLTRP ILL_ILLTRP | |
4910 | ILL_PRVOPC, | |
4911 | #define ILL_PRVOPC ILL_PRVOPC | |
4912 | ILL_PRVREG, | |
4913 | #define ILL_PRVREG ILL_PRVREG | |
4914 | ILL_COPROC, | |
4915 | #define ILL_COPROC ILL_COPROC | |
4916 | ILL_BADSTK | |
4917 | #define ILL_BADSTK ILL_BADSTK | |
4918 | }; | |
4919 | ||
4920 | ||
4921 | enum | |
4922 | { | |
4923 | FPE_INTDIV = 1, | |
4924 | #define FPE_INTDIV FPE_INTDIV | |
4925 | FPE_INTOVF, | |
4926 | #define FPE_INTOVF FPE_INTOVF | |
4927 | FPE_FLTDIV, | |
4928 | #define FPE_FLTDIV FPE_FLTDIV | |
4929 | FPE_FLTOVF, | |
4930 | #define FPE_FLTOVF FPE_FLTOVF | |
4931 | FPE_FLTUND, | |
4932 | #define FPE_FLTUND FPE_FLTUND | |
4933 | FPE_FLTRES, | |
4934 | #define FPE_FLTRES FPE_FLTRES | |
4935 | FPE_FLTINV, | |
4936 | #define FPE_FLTINV FPE_FLTINV | |
4937 | FPE_FLTSUB | |
4938 | #define FPE_FLTSUB FPE_FLTSUB | |
4939 | }; | |
4940 | ||
4941 | ||
4942 | enum | |
4943 | { | |
4944 | SEGV_MAPERR = 1, | |
4945 | #define SEGV_MAPERR SEGV_MAPERR | |
4946 | SEGV_ACCERR | |
4947 | #define SEGV_ACCERR SEGV_ACCERR | |
4948 | }; | |
4949 | ||
4950 | ||
4951 | enum | |
4952 | { | |
4953 | BUS_ADRALN = 1, | |
4954 | #define BUS_ADRALN BUS_ADRALN | |
4955 | BUS_ADRERR, | |
4956 | #define BUS_ADRERR BUS_ADRERR | |
4957 | BUS_OBJERR | |
4958 | #define BUS_OBJERR BUS_OBJERR | |
4959 | }; | |
4960 | ||
4961 | ||
4962 | enum | |
4963 | { | |
4964 | TRAP_BRKPT = 1, | |
4965 | #define TRAP_BRKPT TRAP_BRKPT | |
4966 | TRAP_TRACE | |
4967 | #define TRAP_TRACE TRAP_TRACE | |
4968 | }; | |
4969 | ||
4970 | ||
4971 | enum | |
4972 | { | |
4973 | CLD_EXITED = 1, | |
4974 | #define CLD_EXITED CLD_EXITED | |
4975 | CLD_KILLED, | |
4976 | #define CLD_KILLED CLD_KILLED | |
4977 | CLD_DUMPED, | |
4978 | #define CLD_DUMPED CLD_DUMPED | |
4979 | CLD_TRAPPED, | |
4980 | #define CLD_TRAPPED CLD_TRAPPED | |
4981 | CLD_STOPPED, | |
4982 | #define CLD_STOPPED CLD_STOPPED | |
4983 | CLD_CONTINUED | |
4984 | #define CLD_CONTINUED CLD_CONTINUED | |
4985 | }; | |
4986 | ||
4987 | ||
4988 | enum | |
4989 | { | |
4990 | POLL_IN = 1, | |
4991 | #define POLL_IN POLL_IN | |
4992 | POLL_OUT, | |
4993 | #define POLL_OUT POLL_OUT | |
4994 | POLL_MSG, | |
4995 | #define POLL_MSG POLL_MSG | |
4996 | POLL_ERR, | |
4997 | #define POLL_ERR POLL_ERR | |
4998 | POLL_PRI, | |
4999 | #define POLL_PRI POLL_PRI | |
5000 | POLL_HUP | |
5001 | #define POLL_HUP POLL_HUP | |
5002 | }; | |
5003 | ||
5004 | #undef __need_siginfo_t | |
5005 | ||
5006 | ||
5007 | ||
5008 | ||
5009 | ||
5010 | #define __have_sigevent_t 1 | |
5011 | ||
5012 | ||
5013 | #define __SIGEV_MAX_SIZE 64 | |
5014 | ||
5015 | ||
5016 | ||
5017 | #define __SIGEV_PAD_SIZE ((__SIGEV_MAX_SIZE / sizeof (int)) - 3) | |
5018 | ||
5019 | ||
5020 | typedef struct sigevent | |
5021 | { | |
5022 | sigval_t sigev_value; | |
5023 | int sigev_signo; | |
5024 | int sigev_notify; | |
5025 | ||
5026 | union | |
5027 | { | |
5028 | int _pad[((64 / sizeof (int)) - 3)]; | |
5029 | ||
5030 | ||
5031 | ||
5032 | __pid_t _tid; | |
5033 | ||
5034 | struct | |
5035 | { | |
5036 | void (*_function) (sigval_t); | |
5037 | void *_attribute; | |
5038 | } _sigev_thread; | |
5039 | } _sigev_un; | |
5040 | } sigevent_t; | |
5041 | ||
5042 | ||
5043 | #define sigev_notify_function _sigev_un._sigev_thread._function | |
5044 | #define sigev_notify_attributes _sigev_un._sigev_thread._attribute | |
5045 | ||
5046 | ||
5047 | enum | |
5048 | { | |
5049 | SIGEV_SIGNAL = 0, | |
5050 | #define SIGEV_SIGNAL SIGEV_SIGNAL | |
5051 | SIGEV_NONE, | |
5052 | #define SIGEV_NONE SIGEV_NONE | |
5053 | SIGEV_THREAD, | |
5054 | #define SIGEV_THREAD SIGEV_THREAD | |
5055 | ||
5056 | SIGEV_THREAD_ID = 4 | |
5057 | #define SIGEV_THREAD_ID SIGEV_THREAD_ID | |
5058 | }; | |
5059 | # 213 "/usr/include/signal.h" 2 3 4 | |
5060 | ||
5061 | ||
5062 | ||
5063 | extern int sigemptyset (sigset_t *__set) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
5064 | ||
5065 | ||
5066 | extern int sigfillset (sigset_t *__set) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
5067 | ||
5068 | ||
5069 | extern int sigaddset (sigset_t *__set, int __signo) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
5070 | ||
5071 | ||
5072 | extern int sigdelset (sigset_t *__set, int __signo) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
5073 | ||
5074 | ||
5075 | extern int sigismember (__const sigset_t *__set, int __signo) | |
5076 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
5077 | # 246 "/usr/include/signal.h" 3 4 | |
5078 | # 1 "/usr/include/bits/sigaction.h" 1 3 4 | |
5079 | # 25 "/usr/include/bits/sigaction.h" 3 4 | |
5080 | struct sigaction | |
5081 | { | |
5082 | ||
5083 | ||
5084 | union | |
5085 | { | |
5086 | ||
5087 | __sighandler_t sa_handler; | |
5088 | ||
5089 | void (*sa_sigaction) (int, siginfo_t *, void *); | |
5090 | } | |
5091 | __sigaction_handler; | |
5092 | #define sa_handler __sigaction_handler.sa_handler | |
5093 | #define sa_sigaction __sigaction_handler.sa_sigaction | |
5094 | ||
5095 | ||
5096 | ||
5097 | ||
5098 | ||
5099 | __sigset_t sa_mask; | |
5100 | ||
5101 | ||
5102 | int sa_flags; | |
5103 | ||
5104 | ||
5105 | void (*sa_restorer) (void); | |
5106 | }; | |
5107 | ||
5108 | ||
5109 | #define SA_NOCLDSTOP 1 | |
5110 | #define SA_NOCLDWAIT 2 | |
5111 | #define SA_SIGINFO 4 | |
5112 | ||
5113 | ||
5114 | #define SA_ONSTACK 0x08000000 | |
5115 | #define SA_RESTART 0x10000000 | |
5116 | #define SA_NODEFER 0x40000000 | |
5117 | ||
5118 | #define SA_RESETHAND 0x80000000 | |
5119 | ||
5120 | ||
5121 | #define SA_INTERRUPT 0x20000000 | |
5122 | ||
5123 | ||
5124 | #define SA_NOMASK SA_NODEFER | |
5125 | #define SA_ONESHOT SA_RESETHAND | |
5126 | #define SA_STACK SA_ONSTACK | |
5127 | ||
5128 | ||
5129 | ||
5130 | #define SIG_BLOCK 0 | |
5131 | #define SIG_UNBLOCK 1 | |
5132 | #define SIG_SETMASK 2 | |
5133 | # 247 "/usr/include/signal.h" 2 3 4 | |
5134 | ||
5135 | ||
5136 | extern int sigprocmask (int __how, __const sigset_t *__restrict __set, | |
5137 | sigset_t *__restrict __oset) __attribute__ ((__nothrow__)); | |
5138 | ||
5139 | ||
5140 | ||
5141 | ||
5142 | ||
5143 | ||
5144 | extern int sigsuspend (__const sigset_t *__set) __attribute__ ((__nonnull__ (1))); | |
5145 | ||
5146 | ||
5147 | extern int sigaction (int __sig, __const struct sigaction *__restrict __act, | |
5148 | struct sigaction *__restrict __oact) __attribute__ ((__nothrow__)); | |
5149 | ||
5150 | ||
5151 | extern int sigpending (sigset_t *__set) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
5152 | ||
5153 | ||
5154 | ||
5155 | ||
5156 | ||
5157 | ||
5158 | extern int sigwait (__const sigset_t *__restrict __set, int *__restrict __sig) | |
5159 | __attribute__ ((__nonnull__ (1, 2))); | |
5160 | ||
5161 | ||
5162 | ||
5163 | ||
5164 | ||
5165 | ||
5166 | extern int sigwaitinfo (__const sigset_t *__restrict __set, | |
5167 | siginfo_t *__restrict __info) __attribute__ ((__nonnull__ (1))); | |
5168 | ||
5169 | ||
5170 | ||
5171 | ||
5172 | ||
5173 | ||
5174 | extern int sigtimedwait (__const sigset_t *__restrict __set, | |
5175 | siginfo_t *__restrict __info, | |
5176 | __const struct timespec *__restrict __timeout) | |
5177 | __attribute__ ((__nonnull__ (1))); | |
5178 | ||
5179 | ||
5180 | ||
5181 | extern int sigqueue (__pid_t __pid, int __sig, __const union sigval __val) | |
5182 | __attribute__ ((__nothrow__)); | |
5183 | # 304 "/usr/include/signal.h" 3 4 | |
5184 | extern __const char *__const _sys_siglist[65]; | |
5185 | extern __const char *__const sys_siglist[65]; | |
5186 | ||
5187 | ||
5188 | struct sigvec | |
5189 | { | |
5190 | __sighandler_t sv_handler; | |
5191 | int sv_mask; | |
5192 | ||
5193 | int sv_flags; | |
5194 | #define sv_onstack sv_flags | |
5195 | }; | |
5196 | ||
5197 | ||
5198 | #define SV_ONSTACK (1 << 0) | |
5199 | #define SV_INTERRUPT (1 << 1) | |
5200 | #define SV_RESETHAND (1 << 2) | |
5201 | ||
5202 | ||
5203 | ||
5204 | ||
5205 | ||
5206 | ||
5207 | ||
5208 | extern int sigvec (int __sig, __const struct sigvec *__vec, | |
5209 | struct sigvec *__ovec) __attribute__ ((__nothrow__)); | |
5210 | ||
5211 | ||
5212 | ||
5213 | # 1 "/usr/include/bits/sigcontext.h" 1 3 4 | |
5214 | # 26 "/usr/include/bits/sigcontext.h" 3 4 | |
5215 | #define sigcontext_struct sigcontext | |
5216 | ||
5217 | # 1 "/usr/include/asm/sigcontext.h" 1 3 4 | |
5218 | ||
5219 | #define _ASMi386_SIGCONTEXT_H | |
5220 | # 19 "/usr/include/asm/sigcontext.h" 3 4 | |
5221 | struct _fpreg { | |
5222 | unsigned short significand[4]; | |
5223 | unsigned short exponent; | |
5224 | }; | |
5225 | ||
5226 | struct _fpxreg { | |
5227 | unsigned short significand[4]; | |
5228 | unsigned short exponent; | |
5229 | unsigned short padding[3]; | |
5230 | }; | |
5231 | ||
5232 | struct _xmmreg { | |
5233 | unsigned long element[4]; | |
5234 | }; | |
5235 | ||
5236 | struct _fpstate { | |
5237 | ||
5238 | unsigned long cw; | |
5239 | unsigned long sw; | |
5240 | unsigned long tag; | |
5241 | unsigned long ipoff; | |
5242 | unsigned long cssel; | |
5243 | unsigned long dataoff; | |
5244 | unsigned long datasel; | |
5245 | struct _fpreg _st[8]; | |
5246 | unsigned short status; | |
5247 | unsigned short magic; | |
5248 | ||
5249 | ||
5250 | unsigned long _fxsr_env[6]; | |
5251 | unsigned long mxcsr; | |
5252 | unsigned long reserved; | |
5253 | struct _fpxreg _fxsr_st[8]; | |
5254 | struct _xmmreg _xmm[8]; | |
5255 | unsigned long padding[56]; | |
5256 | }; | |
5257 | ||
5258 | #define X86_FXSR_MAGIC 0x0000 | |
5259 | ||
5260 | struct sigcontext { | |
5261 | unsigned short gs, __gsh; | |
5262 | unsigned short fs, __fsh; | |
5263 | unsigned short es, __esh; | |
5264 | unsigned short ds, __dsh; | |
5265 | unsigned long edi; | |
5266 | unsigned long esi; | |
5267 | unsigned long ebp; | |
5268 | unsigned long esp; | |
5269 | unsigned long ebx; | |
5270 | unsigned long edx; | |
5271 | unsigned long ecx; | |
5272 | unsigned long eax; | |
5273 | unsigned long trapno; | |
5274 | unsigned long err; | |
5275 | unsigned long eip; | |
5276 | unsigned short cs, __csh; | |
5277 | unsigned long eflags; | |
5278 | unsigned long esp_at_signal; | |
5279 | unsigned short ss, __ssh; | |
5280 | struct _fpstate * fpstate; | |
5281 | unsigned long oldmask; | |
5282 | unsigned long cr2; | |
5283 | }; | |
5284 | # 29 "/usr/include/bits/sigcontext.h" 2 3 4 | |
5285 | # 334 "/usr/include/signal.h" 2 3 4 | |
5286 | ||
5287 | ||
5288 | extern int sigreturn (struct sigcontext *__scp) __attribute__ ((__nothrow__)); | |
5289 | # 346 "/usr/include/signal.h" 3 4 | |
5290 | extern int siginterrupt (int __sig, int __interrupt) __attribute__ ((__nothrow__)); | |
5291 | ||
5292 | # 1 "/usr/include/bits/sigstack.h" 1 3 4 | |
5293 | # 26 "/usr/include/bits/sigstack.h" 3 4 | |
5294 | struct sigstack | |
5295 | { | |
5296 | void *ss_sp; | |
5297 | int ss_onstack; | |
5298 | }; | |
5299 | ||
5300 | ||
5301 | ||
5302 | enum | |
5303 | { | |
5304 | SS_ONSTACK = 1, | |
5305 | #define SS_ONSTACK SS_ONSTACK | |
5306 | SS_DISABLE | |
5307 | #define SS_DISABLE SS_DISABLE | |
5308 | }; | |
5309 | ||
5310 | ||
5311 | #define MINSIGSTKSZ 2048 | |
5312 | ||
5313 | ||
5314 | #define SIGSTKSZ 8192 | |
5315 | ||
5316 | ||
5317 | ||
5318 | typedef struct sigaltstack | |
5319 | { | |
5320 | void *ss_sp; | |
5321 | int ss_flags; | |
5322 | size_t ss_size; | |
5323 | } stack_t; | |
5324 | # 349 "/usr/include/signal.h" 2 3 4 | |
5325 | # 357 "/usr/include/signal.h" 3 4 | |
5326 | extern int sigstack (struct sigstack *__ss, struct sigstack *__oss) | |
5327 | __attribute__ ((__nothrow__)) __attribute__ ((__deprecated__)); | |
5328 | ||
5329 | ||
5330 | ||
5331 | extern int sigaltstack (__const struct sigaltstack *__restrict __ss, | |
5332 | struct sigaltstack *__restrict __oss) __attribute__ ((__nothrow__)); | |
5333 | # 387 "/usr/include/signal.h" 3 4 | |
5334 | # 1 "/usr/include/bits/sigthread.h" 1 3 4 | |
5335 | # 21 "/usr/include/bits/sigthread.h" 3 4 | |
5336 | #define _BITS_SIGTHREAD_H 1 | |
5337 | # 31 "/usr/include/bits/sigthread.h" 3 4 | |
5338 | extern int pthread_sigmask (int __how, | |
5339 | __const __sigset_t *__restrict __newmask, | |
5340 | __sigset_t *__restrict __oldmask)__attribute__ ((__nothrow__)); | |
5341 | ||
5342 | ||
5343 | extern int pthread_kill (pthread_t __threadid, int __signo) __attribute__ ((__nothrow__)); | |
5344 | # 388 "/usr/include/signal.h" 2 3 4 | |
5345 | ||
5346 | ||
5347 | ||
5348 | ||
5349 | ||
5350 | ||
5351 | extern int __libc_current_sigrtmin (void) __attribute__ ((__nothrow__)); | |
5352 | ||
5353 | extern int __libc_current_sigrtmax (void) __attribute__ ((__nothrow__)); | |
5354 | ||
5355 | ||
5356 | ||
5357 | ||
5358 | # 22 "unix.c" 2 | |
5359 | ||
5360 | ||
5361 | # 1 "/usr/include/getopt.h" 1 3 4 | |
5362 | # 24 "/usr/include/getopt.h" 3 4 | |
5363 | #define _GETOPT_H 1 | |
5364 | # 59 "/usr/include/getopt.h" 3 4 | |
5365 | extern char *optarg; | |
5366 | # 73 "/usr/include/getopt.h" 3 4 | |
5367 | extern int optind; | |
5368 | ||
5369 | ||
5370 | ||
5371 | ||
5372 | extern int opterr; | |
5373 | ||
5374 | ||
5375 | ||
5376 | extern int optopt; | |
5377 | # 106 "/usr/include/getopt.h" 3 4 | |
5378 | struct option | |
5379 | { | |
5380 | const char *name; | |
5381 | ||
5382 | ||
5383 | int has_arg; | |
5384 | int *flag; | |
5385 | int val; | |
5386 | }; | |
5387 | ||
5388 | ||
5389 | ||
5390 | #define no_argument 0 | |
5391 | #define required_argument 1 | |
5392 | #define optional_argument 2 | |
5393 | # 152 "/usr/include/getopt.h" 3 4 | |
5394 | extern int getopt (int ___argc, char *const *___argv, const char *__shortopts) | |
5395 | __attribute__ ((__nothrow__)); | |
5396 | ||
5397 | ||
5398 | ||
5399 | ||
5400 | ||
5401 | extern int getopt_long (int ___argc, char *const *___argv, | |
5402 | const char *__shortopts, | |
5403 | const struct option *__longopts, int *__longind) | |
5404 | __attribute__ ((__nothrow__)); | |
5405 | extern int getopt_long_only (int ___argc, char *const *___argv, | |
5406 | const char *__shortopts, | |
5407 | const struct option *__longopts, int *__longind) | |
5408 | __attribute__ ((__nothrow__)); | |
5409 | # 175 "/usr/include/getopt.h" 3 4 | |
5410 | #undef __need_getopt | |
5411 | # 25 "unix.c" 2 | |
5412 | ||
5413 | ||
5414 | ||
5415 | ||
5416 | # 1 "/usr/include/unistd.h" 1 3 4 | |
5417 | # 24 "/usr/include/unistd.h" 3 4 | |
5418 | #define _UNISTD_H 1 | |
5419 | ||
5420 | ||
5421 | ||
5422 | ||
5423 | ||
5424 | ||
5425 | ||
5426 | ||
5427 | ||
5428 | #define _POSIX_VERSION 200112L | |
5429 | ||
5430 | ||
5431 | ||
5432 | ||
5433 | ||
5434 | #define _POSIX2_VERSION 200112L | |
5435 | ||
5436 | ||
5437 | ||
5438 | #define _POSIX2_C_BIND 200112L | |
5439 | ||
5440 | ||
5441 | ||
5442 | #define _POSIX2_C_DEV 200112L | |
5443 | ||
5444 | ||
5445 | ||
5446 | #define _POSIX2_SW_DEV 200112L | |
5447 | ||
5448 | ||
5449 | ||
5450 | #define _POSIX2_LOCALEDEF 200112L | |
5451 | ||
5452 | ||
5453 | ||
5454 | #define _XOPEN_VERSION 600 | |
5455 | ||
5456 | ||
5457 | ||
5458 | ||
5459 | ||
5460 | ||
5461 | ||
5462 | #define _XOPEN_XCU_VERSION 4 | |
5463 | ||
5464 | ||
5465 | #define _XOPEN_XPG2 1 | |
5466 | #define _XOPEN_XPG3 1 | |
5467 | #define _XOPEN_XPG4 1 | |
5468 | ||
5469 | ||
5470 | #define _XOPEN_UNIX 1 | |
5471 | ||
5472 | ||
5473 | #define _XOPEN_CRYPT 1 | |
5474 | ||
5475 | ||
5476 | ||
5477 | #define _XOPEN_ENH_I18N 1 | |
5478 | ||
5479 | ||
5480 | #define _XOPEN_LEGACY 1 | |
5481 | # 173 "/usr/include/unistd.h" 3 4 | |
5482 | # 1 "/usr/include/bits/posix_opt.h" 1 3 4 | |
5483 | # 21 "/usr/include/bits/posix_opt.h" 3 4 | |
5484 | #define _POSIX_OPT_H 1 | |
5485 | ||
5486 | ||
5487 | #define _POSIX_JOB_CONTROL 1 | |
5488 | ||
5489 | ||
5490 | #define _POSIX_SAVED_IDS 1 | |
5491 | ||
5492 | ||
5493 | #define _POSIX_PRIORITY_SCHEDULING 200112L | |
5494 | ||
5495 | ||
5496 | #define _POSIX_SYNCHRONIZED_IO 200112L | |
5497 | ||
5498 | ||
5499 | #define _POSIX_FSYNC 200112L | |
5500 | ||
5501 | ||
5502 | #define _POSIX_MAPPED_FILES 200112L | |
5503 | ||
5504 | ||
5505 | #define _POSIX_MEMLOCK 200112L | |
5506 | ||
5507 | ||
5508 | #define _POSIX_MEMLOCK_RANGE 200112L | |
5509 | ||
5510 | ||
5511 | #define _POSIX_MEMORY_PROTECTION 200112L | |
5512 | ||
5513 | ||
5514 | #define _POSIX_CHOWN_RESTRICTED 1 | |
5515 | ||
5516 | ||
5517 | ||
5518 | #define _POSIX_VDISABLE '\0' | |
5519 | ||
5520 | ||
5521 | #define _POSIX_NO_TRUNC 1 | |
5522 | ||
5523 | ||
5524 | #define _XOPEN_REALTIME 1 | |
5525 | ||
5526 | ||
5527 | #define _XOPEN_REALTIME_THREADS 1 | |
5528 | ||
5529 | ||
5530 | #define _XOPEN_SHM 1 | |
5531 | ||
5532 | ||
5533 | #define _POSIX_THREADS 200112L | |
5534 | ||
5535 | ||
5536 | #define _POSIX_REENTRANT_FUNCTIONS 1 | |
5537 | #define _POSIX_THREAD_SAFE_FUNCTIONS 200112L | |
5538 | ||
5539 | ||
5540 | #define _POSIX_THREAD_PRIORITY_SCHEDULING 200112L | |
5541 | ||
5542 | ||
5543 | #define _POSIX_THREAD_ATTR_STACKSIZE 200112L | |
5544 | ||
5545 | ||
5546 | #define _POSIX_THREAD_ATTR_STACKADDR 200112L | |
5547 | ||
5548 | ||
5549 | #define _POSIX_THREAD_PRIO_INHERIT 200112L | |
5550 | ||
5551 | ||
5552 | ||
5553 | #define _POSIX_THREAD_PRIO_PROTECT 200112L | |
5554 | ||
5555 | ||
5556 | #define _POSIX_SEMAPHORES 200112L | |
5557 | ||
5558 | ||
5559 | #define _POSIX_REALTIME_SIGNALS 200112L | |
5560 | ||
5561 | ||
5562 | #define _POSIX_ASYNCHRONOUS_IO 200112L | |
5563 | #define _POSIX_ASYNC_IO 1 | |
5564 | ||
5565 | #define _LFS_ASYNCHRONOUS_IO 1 | |
5566 | ||
5567 | #define _POSIX_PRIORITIZED_IO 200112L | |
5568 | ||
5569 | ||
5570 | #define _LFS64_ASYNCHRONOUS_IO 1 | |
5571 | ||
5572 | ||
5573 | #define _LFS_LARGEFILE 1 | |
5574 | #define _LFS64_LARGEFILE 1 | |
5575 | #define _LFS64_STDIO 1 | |
5576 | ||
5577 | ||
5578 | #define _POSIX_SHARED_MEMORY_OBJECTS 200112L | |
5579 | ||
5580 | ||
5581 | #define _POSIX_CPUTIME 0 | |
5582 | ||
5583 | ||
5584 | #define _POSIX_THREAD_CPUTIME 0 | |
5585 | ||
5586 | ||
5587 | #define _POSIX_REGEXP 1 | |
5588 | ||
5589 | ||
5590 | #define _POSIX_READER_WRITER_LOCKS 200112L | |
5591 | ||
5592 | ||
5593 | #define _POSIX_SHELL 1 | |
5594 | ||
5595 | ||
5596 | #define _POSIX_TIMEOUTS 200112L | |
5597 | ||
5598 | ||
5599 | #define _POSIX_SPIN_LOCKS 200112L | |
5600 | ||
5601 | ||
5602 | #define _POSIX_SPAWN 200112L | |
5603 | ||
5604 | ||
5605 | #define _POSIX_TIMERS 200112L | |
5606 | ||
5607 | ||
5608 | #define _POSIX_BARRIERS 200112L | |
5609 | ||
5610 | ||
5611 | #define _POSIX_MESSAGE_PASSING 200112L | |
5612 | ||
5613 | ||
5614 | #define _POSIX_THREAD_PROCESS_SHARED 200112L | |
5615 | ||
5616 | ||
5617 | #define _POSIX_MONOTONIC_CLOCK 0 | |
5618 | ||
5619 | ||
5620 | #define _POSIX_CLOCK_SELECTION 200112L | |
5621 | ||
5622 | ||
5623 | #define _POSIX_ADVISORY_INFO 200112L | |
5624 | ||
5625 | ||
5626 | #define _POSIX_IPV6 200112L | |
5627 | ||
5628 | ||
5629 | #define _POSIX_RAW_SOCKETS 200112L | |
5630 | ||
5631 | ||
5632 | #define _POSIX2_CHAR_TERM 200112L | |
5633 | ||
5634 | ||
5635 | #define _POSIX_SPORADIC_SERVER -1 | |
5636 | #define _POSIX_THREAD_SPORADIC_SERVER -1 | |
5637 | ||
5638 | ||
5639 | #define _POSIX_TRACE -1 | |
5640 | #define _POSIX_TRACE_EVENT_FILTER -1 | |
5641 | #define _POSIX_TRACE_INHERIT -1 | |
5642 | #define _POSIX_TRACE_LOG -1 | |
5643 | ||
5644 | ||
5645 | #define _POSIX_TYPED_MEMORY_OBJECTS -1 | |
5646 | # 174 "/usr/include/unistd.h" 2 3 4 | |
5647 | ||
5648 | ||
5649 | ||
5650 | ||
5651 | ||
5652 | ||
5653 | ||
5654 | #define STDIN_FILENO 0 | |
5655 | #define STDOUT_FILENO 1 | |
5656 | #define STDERR_FILENO 2 | |
5657 | # 195 "/usr/include/unistd.h" 3 4 | |
5658 | #define __need_size_t | |
5659 | #define __need_NULL | |
5660 | # 1 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/stddef.h" 1 3 4 | |
5661 | # 236 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/stddef.h" 3 4 | |
5662 | #undef __need_size_t | |
5663 | # 398 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/stddef.h" 3 4 | |
5664 | #undef NULL | |
5665 | ||
5666 | ||
5667 | ||
5668 | ||
5669 | #define NULL ((void *)0) | |
5670 | ||
5671 | ||
5672 | ||
5673 | ||
5674 | ||
5675 | #undef __need_NULL | |
5676 | # 198 "/usr/include/unistd.h" 2 3 4 | |
5677 | # 226 "/usr/include/unistd.h" 3 4 | |
5678 | typedef __useconds_t useconds_t; | |
5679 | #define __useconds_t_defined | |
5680 | # 238 "/usr/include/unistd.h" 3 4 | |
5681 | typedef __intptr_t intptr_t; | |
5682 | #define __intptr_t_defined | |
5683 | ||
5684 | ||
5685 | ||
5686 | ||
5687 | ||
5688 | typedef __socklen_t socklen_t; | |
5689 | #define __socklen_t_defined | |
5690 | ||
5691 | ||
5692 | ||
5693 | ||
5694 | ||
5695 | #define R_OK 4 | |
5696 | #define W_OK 2 | |
5697 | #define X_OK 1 | |
5698 | #define F_OK 0 | |
5699 | ||
5700 | ||
5701 | extern int access (__const char *__name, int __type) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
5702 | # 289 "/usr/include/unistd.h" 3 4 | |
5703 | #define L_SET SEEK_SET | |
5704 | #define L_INCR SEEK_CUR | |
5705 | #define L_XTND SEEK_END | |
5706 | # 301 "/usr/include/unistd.h" 3 4 | |
5707 | extern __off_t lseek (int __fd, __off_t __offset, int __whence) __attribute__ ((__nothrow__)); | |
5708 | # 320 "/usr/include/unistd.h" 3 4 | |
5709 | extern int close (int __fd); | |
5710 | ||
5711 | ||
5712 | ||
5713 | ||
5714 | ||
5715 | ||
5716 | extern ssize_t read (int __fd, void *__buf, size_t __nbytes) ; | |
5717 | ||
5718 | ||
5719 | ||
5720 | ||
5721 | ||
5722 | extern ssize_t write (int __fd, __const void *__buf, size_t __n) ; | |
5723 | # 384 "/usr/include/unistd.h" 3 4 | |
5724 | extern int pipe (int __pipedes[2]) __attribute__ ((__nothrow__)) ; | |
5725 | # 393 "/usr/include/unistd.h" 3 4 | |
5726 | extern unsigned int alarm (unsigned int __seconds) __attribute__ ((__nothrow__)); | |
5727 | # 405 "/usr/include/unistd.h" 3 4 | |
5728 | extern unsigned int sleep (unsigned int __seconds); | |
5729 | ||
5730 | ||
5731 | ||
5732 | ||
5733 | ||
5734 | ||
5735 | extern __useconds_t ualarm (__useconds_t __value, __useconds_t __interval) | |
5736 | __attribute__ ((__nothrow__)); | |
5737 | ||
5738 | ||
5739 | ||
5740 | ||
5741 | ||
5742 | ||
5743 | extern int usleep (__useconds_t __useconds); | |
5744 | # 429 "/usr/include/unistd.h" 3 4 | |
5745 | extern int pause (void); | |
5746 | ||
5747 | ||
5748 | ||
5749 | extern int chown (__const char *__file, __uid_t __owner, __gid_t __group) | |
5750 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; | |
5751 | ||
5752 | ||
5753 | ||
5754 | extern int fchown (int __fd, __uid_t __owner, __gid_t __group) __attribute__ ((__nothrow__)) ; | |
5755 | ||
5756 | ||
5757 | ||
5758 | ||
5759 | extern int lchown (__const char *__file, __uid_t __owner, __gid_t __group) | |
5760 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; | |
5761 | # 457 "/usr/include/unistd.h" 3 4 | |
5762 | extern int chdir (__const char *__path) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; | |
5763 | ||
5764 | ||
5765 | ||
5766 | extern int fchdir (int __fd) __attribute__ ((__nothrow__)) ; | |
5767 | # 471 "/usr/include/unistd.h" 3 4 | |
5768 | extern char *getcwd (char *__buf, size_t __size) __attribute__ ((__nothrow__)) ; | |
5769 | # 484 "/usr/include/unistd.h" 3 4 | |
5770 | extern char *getwd (char *__buf) | |
5771 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__deprecated__)) ; | |
5772 | ||
5773 | ||
5774 | ||
5775 | ||
5776 | extern int dup (int __fd) __attribute__ ((__nothrow__)) ; | |
5777 | ||
5778 | ||
5779 | extern int dup2 (int __fd, int __fd2) __attribute__ ((__nothrow__)); | |
5780 | ||
5781 | ||
5782 | extern char **__environ; | |
5783 | ||
5784 | ||
5785 | ||
5786 | ||
5787 | ||
5788 | ||
5789 | ||
5790 | extern int execve (__const char *__path, char *__const __argv[], | |
5791 | char *__const __envp[]) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
5792 | # 516 "/usr/include/unistd.h" 3 4 | |
5793 | extern int execv (__const char *__path, char *__const __argv[]) | |
5794 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
5795 | ||
5796 | ||
5797 | ||
5798 | extern int execle (__const char *__path, __const char *__arg, ...) | |
5799 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
5800 | ||
5801 | ||
5802 | ||
5803 | extern int execl (__const char *__path, __const char *__arg, ...) | |
5804 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
5805 | ||
5806 | ||
5807 | ||
5808 | extern int execvp (__const char *__file, char *__const __argv[]) | |
5809 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
5810 | ||
5811 | ||
5812 | ||
5813 | ||
5814 | extern int execlp (__const char *__file, __const char *__arg, ...) | |
5815 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
5816 | ||
5817 | ||
5818 | ||
5819 | ||
5820 | extern int nice (int __inc) __attribute__ ((__nothrow__)) ; | |
5821 | ||
5822 | ||
5823 | ||
5824 | ||
5825 | extern void _exit (int __status) __attribute__ ((__noreturn__)); | |
5826 | ||
5827 | ||
5828 | ||
5829 | ||
5830 | ||
5831 | # 1 "/usr/include/bits/confname.h" 1 3 4 | |
5832 | # 26 "/usr/include/bits/confname.h" 3 4 | |
5833 | enum | |
5834 | { | |
5835 | _PC_LINK_MAX, | |
5836 | #define _PC_LINK_MAX _PC_LINK_MAX | |
5837 | _PC_MAX_CANON, | |
5838 | #define _PC_MAX_CANON _PC_MAX_CANON | |
5839 | _PC_MAX_INPUT, | |
5840 | #define _PC_MAX_INPUT _PC_MAX_INPUT | |
5841 | _PC_NAME_MAX, | |
5842 | #define _PC_NAME_MAX _PC_NAME_MAX | |
5843 | _PC_PATH_MAX, | |
5844 | #define _PC_PATH_MAX _PC_PATH_MAX | |
5845 | _PC_PIPE_BUF, | |
5846 | #define _PC_PIPE_BUF _PC_PIPE_BUF | |
5847 | _PC_CHOWN_RESTRICTED, | |
5848 | #define _PC_CHOWN_RESTRICTED _PC_CHOWN_RESTRICTED | |
5849 | _PC_NO_TRUNC, | |
5850 | #define _PC_NO_TRUNC _PC_NO_TRUNC | |
5851 | _PC_VDISABLE, | |
5852 | #define _PC_VDISABLE _PC_VDISABLE | |
5853 | _PC_SYNC_IO, | |
5854 | #define _PC_SYNC_IO _PC_SYNC_IO | |
5855 | _PC_ASYNC_IO, | |
5856 | #define _PC_ASYNC_IO _PC_ASYNC_IO | |
5857 | _PC_PRIO_IO, | |
5858 | #define _PC_PRIO_IO _PC_PRIO_IO | |
5859 | _PC_SOCK_MAXBUF, | |
5860 | #define _PC_SOCK_MAXBUF _PC_SOCK_MAXBUF | |
5861 | _PC_FILESIZEBITS, | |
5862 | #define _PC_FILESIZEBITS _PC_FILESIZEBITS | |
5863 | _PC_REC_INCR_XFER_SIZE, | |
5864 | #define _PC_REC_INCR_XFER_SIZE _PC_REC_INCR_XFER_SIZE | |
5865 | _PC_REC_MAX_XFER_SIZE, | |
5866 | #define _PC_REC_MAX_XFER_SIZE _PC_REC_MAX_XFER_SIZE | |
5867 | _PC_REC_MIN_XFER_SIZE, | |
5868 | #define _PC_REC_MIN_XFER_SIZE _PC_REC_MIN_XFER_SIZE | |
5869 | _PC_REC_XFER_ALIGN, | |
5870 | #define _PC_REC_XFER_ALIGN _PC_REC_XFER_ALIGN | |
5871 | _PC_ALLOC_SIZE_MIN, | |
5872 | #define _PC_ALLOC_SIZE_MIN _PC_ALLOC_SIZE_MIN | |
5873 | _PC_SYMLINK_MAX, | |
5874 | #define _PC_SYMLINK_MAX _PC_SYMLINK_MAX | |
5875 | _PC_2_SYMLINKS | |
5876 | #define _PC_2_SYMLINKS _PC_2_SYMLINKS | |
5877 | }; | |
5878 | ||
5879 | ||
5880 | enum | |
5881 | { | |
5882 | _SC_ARG_MAX, | |
5883 | #define _SC_ARG_MAX _SC_ARG_MAX | |
5884 | _SC_CHILD_MAX, | |
5885 | #define _SC_CHILD_MAX _SC_CHILD_MAX | |
5886 | _SC_CLK_TCK, | |
5887 | #define _SC_CLK_TCK _SC_CLK_TCK | |
5888 | _SC_NGROUPS_MAX, | |
5889 | #define _SC_NGROUPS_MAX _SC_NGROUPS_MAX | |
5890 | _SC_OPEN_MAX, | |
5891 | #define _SC_OPEN_MAX _SC_OPEN_MAX | |
5892 | _SC_STREAM_MAX, | |
5893 | #define _SC_STREAM_MAX _SC_STREAM_MAX | |
5894 | _SC_TZNAME_MAX, | |
5895 | #define _SC_TZNAME_MAX _SC_TZNAME_MAX | |
5896 | _SC_JOB_CONTROL, | |
5897 | #define _SC_JOB_CONTROL _SC_JOB_CONTROL | |
5898 | _SC_SAVED_IDS, | |
5899 | #define _SC_SAVED_IDS _SC_SAVED_IDS | |
5900 | _SC_REALTIME_SIGNALS, | |
5901 | #define _SC_REALTIME_SIGNALS _SC_REALTIME_SIGNALS | |
5902 | _SC_PRIORITY_SCHEDULING, | |
5903 | #define _SC_PRIORITY_SCHEDULING _SC_PRIORITY_SCHEDULING | |
5904 | _SC_TIMERS, | |
5905 | #define _SC_TIMERS _SC_TIMERS | |
5906 | _SC_ASYNCHRONOUS_IO, | |
5907 | #define _SC_ASYNCHRONOUS_IO _SC_ASYNCHRONOUS_IO | |
5908 | _SC_PRIORITIZED_IO, | |
5909 | #define _SC_PRIORITIZED_IO _SC_PRIORITIZED_IO | |
5910 | _SC_SYNCHRONIZED_IO, | |
5911 | #define _SC_SYNCHRONIZED_IO _SC_SYNCHRONIZED_IO | |
5912 | _SC_FSYNC, | |
5913 | #define _SC_FSYNC _SC_FSYNC | |
5914 | _SC_MAPPED_FILES, | |
5915 | #define _SC_MAPPED_FILES _SC_MAPPED_FILES | |
5916 | _SC_MEMLOCK, | |
5917 | #define _SC_MEMLOCK _SC_MEMLOCK | |
5918 | _SC_MEMLOCK_RANGE, | |
5919 | #define _SC_MEMLOCK_RANGE _SC_MEMLOCK_RANGE | |
5920 | _SC_MEMORY_PROTECTION, | |
5921 | #define _SC_MEMORY_PROTECTION _SC_MEMORY_PROTECTION | |
5922 | _SC_MESSAGE_PASSING, | |
5923 | #define _SC_MESSAGE_PASSING _SC_MESSAGE_PASSING | |
5924 | _SC_SEMAPHORES, | |
5925 | #define _SC_SEMAPHORES _SC_SEMAPHORES | |
5926 | _SC_SHARED_MEMORY_OBJECTS, | |
5927 | #define _SC_SHARED_MEMORY_OBJECTS _SC_SHARED_MEMORY_OBJECTS | |
5928 | _SC_AIO_LISTIO_MAX, | |
5929 | #define _SC_AIO_LISTIO_MAX _SC_AIO_LISTIO_MAX | |
5930 | _SC_AIO_MAX, | |
5931 | #define _SC_AIO_MAX _SC_AIO_MAX | |
5932 | _SC_AIO_PRIO_DELTA_MAX, | |
5933 | #define _SC_AIO_PRIO_DELTA_MAX _SC_AIO_PRIO_DELTA_MAX | |
5934 | _SC_DELAYTIMER_MAX, | |
5935 | #define _SC_DELAYTIMER_MAX _SC_DELAYTIMER_MAX | |
5936 | _SC_MQ_OPEN_MAX, | |
5937 | #define _SC_MQ_OPEN_MAX _SC_MQ_OPEN_MAX | |
5938 | _SC_MQ_PRIO_MAX, | |
5939 | #define _SC_MQ_PRIO_MAX _SC_MQ_PRIO_MAX | |
5940 | _SC_VERSION, | |
5941 | #define _SC_VERSION _SC_VERSION | |
5942 | _SC_PAGESIZE, | |
5943 | #define _SC_PAGESIZE _SC_PAGESIZE | |
5944 | #define _SC_PAGE_SIZE _SC_PAGESIZE | |
5945 | _SC_RTSIG_MAX, | |
5946 | #define _SC_RTSIG_MAX _SC_RTSIG_MAX | |
5947 | _SC_SEM_NSEMS_MAX, | |
5948 | #define _SC_SEM_NSEMS_MAX _SC_SEM_NSEMS_MAX | |
5949 | _SC_SEM_VALUE_MAX, | |
5950 | #define _SC_SEM_VALUE_MAX _SC_SEM_VALUE_MAX | |
5951 | _SC_SIGQUEUE_MAX, | |
5952 | #define _SC_SIGQUEUE_MAX _SC_SIGQUEUE_MAX | |
5953 | _SC_TIMER_MAX, | |
5954 | #define _SC_TIMER_MAX _SC_TIMER_MAX | |
5955 | ||
5956 | ||
5957 | ||
5958 | _SC_BC_BASE_MAX, | |
5959 | #define _SC_BC_BASE_MAX _SC_BC_BASE_MAX | |
5960 | _SC_BC_DIM_MAX, | |
5961 | #define _SC_BC_DIM_MAX _SC_BC_DIM_MAX | |
5962 | _SC_BC_SCALE_MAX, | |
5963 | #define _SC_BC_SCALE_MAX _SC_BC_SCALE_MAX | |
5964 | _SC_BC_STRING_MAX, | |
5965 | #define _SC_BC_STRING_MAX _SC_BC_STRING_MAX | |
5966 | _SC_COLL_WEIGHTS_MAX, | |
5967 | #define _SC_COLL_WEIGHTS_MAX _SC_COLL_WEIGHTS_MAX | |
5968 | _SC_EQUIV_CLASS_MAX, | |
5969 | #define _SC_EQUIV_CLASS_MAX _SC_EQUIV_CLASS_MAX | |
5970 | _SC_EXPR_NEST_MAX, | |
5971 | #define _SC_EXPR_NEST_MAX _SC_EXPR_NEST_MAX | |
5972 | _SC_LINE_MAX, | |
5973 | #define _SC_LINE_MAX _SC_LINE_MAX | |
5974 | _SC_RE_DUP_MAX, | |
5975 | #define _SC_RE_DUP_MAX _SC_RE_DUP_MAX | |
5976 | _SC_CHARCLASS_NAME_MAX, | |
5977 | #define _SC_CHARCLASS_NAME_MAX _SC_CHARCLASS_NAME_MAX | |
5978 | ||
5979 | _SC_2_VERSION, | |
5980 | #define _SC_2_VERSION _SC_2_VERSION | |
5981 | _SC_2_C_BIND, | |
5982 | #define _SC_2_C_BIND _SC_2_C_BIND | |
5983 | _SC_2_C_DEV, | |
5984 | #define _SC_2_C_DEV _SC_2_C_DEV | |
5985 | _SC_2_FORT_DEV, | |
5986 | #define _SC_2_FORT_DEV _SC_2_FORT_DEV | |
5987 | _SC_2_FORT_RUN, | |
5988 | #define _SC_2_FORT_RUN _SC_2_FORT_RUN | |
5989 | _SC_2_SW_DEV, | |
5990 | #define _SC_2_SW_DEV _SC_2_SW_DEV | |
5991 | _SC_2_LOCALEDEF, | |
5992 | #define _SC_2_LOCALEDEF _SC_2_LOCALEDEF | |
5993 | ||
5994 | _SC_PII, | |
5995 | #define _SC_PII _SC_PII | |
5996 | _SC_PII_XTI, | |
5997 | #define _SC_PII_XTI _SC_PII_XTI | |
5998 | _SC_PII_SOCKET, | |
5999 | #define _SC_PII_SOCKET _SC_PII_SOCKET | |
6000 | _SC_PII_INTERNET, | |
6001 | #define _SC_PII_INTERNET _SC_PII_INTERNET | |
6002 | _SC_PII_OSI, | |
6003 | #define _SC_PII_OSI _SC_PII_OSI | |
6004 | _SC_POLL, | |
6005 | #define _SC_POLL _SC_POLL | |
6006 | _SC_SELECT, | |
6007 | #define _SC_SELECT _SC_SELECT | |
6008 | _SC_UIO_MAXIOV, | |
6009 | #define _SC_UIO_MAXIOV _SC_UIO_MAXIOV | |
6010 | _SC_IOV_MAX = _SC_UIO_MAXIOV, | |
6011 | #define _SC_IOV_MAX _SC_IOV_MAX | |
6012 | _SC_PII_INTERNET_STREAM, | |
6013 | #define _SC_PII_INTERNET_STREAM _SC_PII_INTERNET_STREAM | |
6014 | _SC_PII_INTERNET_DGRAM, | |
6015 | #define _SC_PII_INTERNET_DGRAM _SC_PII_INTERNET_DGRAM | |
6016 | _SC_PII_OSI_COTS, | |
6017 | #define _SC_PII_OSI_COTS _SC_PII_OSI_COTS | |
6018 | _SC_PII_OSI_CLTS, | |
6019 | #define _SC_PII_OSI_CLTS _SC_PII_OSI_CLTS | |
6020 | _SC_PII_OSI_M, | |
6021 | #define _SC_PII_OSI_M _SC_PII_OSI_M | |
6022 | _SC_T_IOV_MAX, | |
6023 | #define _SC_T_IOV_MAX _SC_T_IOV_MAX | |
6024 | ||
6025 | ||
6026 | _SC_THREADS, | |
6027 | #define _SC_THREADS _SC_THREADS | |
6028 | _SC_THREAD_SAFE_FUNCTIONS, | |
6029 | #define _SC_THREAD_SAFE_FUNCTIONS _SC_THREAD_SAFE_FUNCTIONS | |
6030 | _SC_GETGR_R_SIZE_MAX, | |
6031 | #define _SC_GETGR_R_SIZE_MAX _SC_GETGR_R_SIZE_MAX | |
6032 | _SC_GETPW_R_SIZE_MAX, | |
6033 | #define _SC_GETPW_R_SIZE_MAX _SC_GETPW_R_SIZE_MAX | |
6034 | _SC_LOGIN_NAME_MAX, | |
6035 | #define _SC_LOGIN_NAME_MAX _SC_LOGIN_NAME_MAX | |
6036 | _SC_TTY_NAME_MAX, | |
6037 | #define _SC_TTY_NAME_MAX _SC_TTY_NAME_MAX | |
6038 | _SC_THREAD_DESTRUCTOR_ITERATIONS, | |
6039 | #define _SC_THREAD_DESTRUCTOR_ITERATIONS _SC_THREAD_DESTRUCTOR_ITERATIONS | |
6040 | _SC_THREAD_KEYS_MAX, | |
6041 | #define _SC_THREAD_KEYS_MAX _SC_THREAD_KEYS_MAX | |
6042 | _SC_THREAD_STACK_MIN, | |
6043 | #define _SC_THREAD_STACK_MIN _SC_THREAD_STACK_MIN | |
6044 | _SC_THREAD_THREADS_MAX, | |
6045 | #define _SC_THREAD_THREADS_MAX _SC_THREAD_THREADS_MAX | |
6046 | _SC_THREAD_ATTR_STACKADDR, | |
6047 | #define _SC_THREAD_ATTR_STACKADDR _SC_THREAD_ATTR_STACKADDR | |
6048 | _SC_THREAD_ATTR_STACKSIZE, | |
6049 | #define _SC_THREAD_ATTR_STACKSIZE _SC_THREAD_ATTR_STACKSIZE | |
6050 | _SC_THREAD_PRIORITY_SCHEDULING, | |
6051 | #define _SC_THREAD_PRIORITY_SCHEDULING _SC_THREAD_PRIORITY_SCHEDULING | |
6052 | _SC_THREAD_PRIO_INHERIT, | |
6053 | #define _SC_THREAD_PRIO_INHERIT _SC_THREAD_PRIO_INHERIT | |
6054 | _SC_THREAD_PRIO_PROTECT, | |
6055 | #define _SC_THREAD_PRIO_PROTECT _SC_THREAD_PRIO_PROTECT | |
6056 | _SC_THREAD_PROCESS_SHARED, | |
6057 | #define _SC_THREAD_PROCESS_SHARED _SC_THREAD_PROCESS_SHARED | |
6058 | ||
6059 | _SC_NPROCESSORS_CONF, | |
6060 | #define _SC_NPROCESSORS_CONF _SC_NPROCESSORS_CONF | |
6061 | _SC_NPROCESSORS_ONLN, | |
6062 | #define _SC_NPROCESSORS_ONLN _SC_NPROCESSORS_ONLN | |
6063 | _SC_PHYS_PAGES, | |
6064 | #define _SC_PHYS_PAGES _SC_PHYS_PAGES | |
6065 | _SC_AVPHYS_PAGES, | |
6066 | #define _SC_AVPHYS_PAGES _SC_AVPHYS_PAGES | |
6067 | _SC_ATEXIT_MAX, | |
6068 | #define _SC_ATEXIT_MAX _SC_ATEXIT_MAX | |
6069 | _SC_PASS_MAX, | |
6070 | #define _SC_PASS_MAX _SC_PASS_MAX | |
6071 | ||
6072 | _SC_XOPEN_VERSION, | |
6073 | #define _SC_XOPEN_VERSION _SC_XOPEN_VERSION | |
6074 | _SC_XOPEN_XCU_VERSION, | |
6075 | #define _SC_XOPEN_XCU_VERSION _SC_XOPEN_XCU_VERSION | |
6076 | _SC_XOPEN_UNIX, | |
6077 | #define _SC_XOPEN_UNIX _SC_XOPEN_UNIX | |
6078 | _SC_XOPEN_CRYPT, | |
6079 | #define _SC_XOPEN_CRYPT _SC_XOPEN_CRYPT | |
6080 | _SC_XOPEN_ENH_I18N, | |
6081 | #define _SC_XOPEN_ENH_I18N _SC_XOPEN_ENH_I18N | |
6082 | _SC_XOPEN_SHM, | |
6083 | #define _SC_XOPEN_SHM _SC_XOPEN_SHM | |
6084 | ||
6085 | _SC_2_CHAR_TERM, | |
6086 | #define _SC_2_CHAR_TERM _SC_2_CHAR_TERM | |
6087 | _SC_2_C_VERSION, | |
6088 | #define _SC_2_C_VERSION _SC_2_C_VERSION | |
6089 | _SC_2_UPE, | |
6090 | #define _SC_2_UPE _SC_2_UPE | |
6091 | ||
6092 | _SC_XOPEN_XPG2, | |
6093 | #define _SC_XOPEN_XPG2 _SC_XOPEN_XPG2 | |
6094 | _SC_XOPEN_XPG3, | |
6095 | #define _SC_XOPEN_XPG3 _SC_XOPEN_XPG3 | |
6096 | _SC_XOPEN_XPG4, | |
6097 | #define _SC_XOPEN_XPG4 _SC_XOPEN_XPG4 | |
6098 | ||
6099 | _SC_CHAR_BIT, | |
6100 | #define _SC_CHAR_BIT _SC_CHAR_BIT | |
6101 | _SC_CHAR_MAX, | |
6102 | #define _SC_CHAR_MAX _SC_CHAR_MAX | |
6103 | _SC_CHAR_MIN, | |
6104 | #define _SC_CHAR_MIN _SC_CHAR_MIN | |
6105 | _SC_INT_MAX, | |
6106 | #define _SC_INT_MAX _SC_INT_MAX | |
6107 | _SC_INT_MIN, | |
6108 | #define _SC_INT_MIN _SC_INT_MIN | |
6109 | _SC_LONG_BIT, | |
6110 | #define _SC_LONG_BIT _SC_LONG_BIT | |
6111 | _SC_WORD_BIT, | |
6112 | #define _SC_WORD_BIT _SC_WORD_BIT | |
6113 | _SC_MB_LEN_MAX, | |
6114 | #define _SC_MB_LEN_MAX _SC_MB_LEN_MAX | |
6115 | _SC_NZERO, | |
6116 | #define _SC_NZERO _SC_NZERO | |
6117 | _SC_SSIZE_MAX, | |
6118 | #define _SC_SSIZE_MAX _SC_SSIZE_MAX | |
6119 | _SC_SCHAR_MAX, | |
6120 | #define _SC_SCHAR_MAX _SC_SCHAR_MAX | |
6121 | _SC_SCHAR_MIN, | |
6122 | #define _SC_SCHAR_MIN _SC_SCHAR_MIN | |
6123 | _SC_SHRT_MAX, | |
6124 | #define _SC_SHRT_MAX _SC_SHRT_MAX | |
6125 | _SC_SHRT_MIN, | |
6126 | #define _SC_SHRT_MIN _SC_SHRT_MIN | |
6127 | _SC_UCHAR_MAX, | |
6128 | #define _SC_UCHAR_MAX _SC_UCHAR_MAX | |
6129 | _SC_UINT_MAX, | |
6130 | #define _SC_UINT_MAX _SC_UINT_MAX | |
6131 | _SC_ULONG_MAX, | |
6132 | #define _SC_ULONG_MAX _SC_ULONG_MAX | |
6133 | _SC_USHRT_MAX, | |
6134 | #define _SC_USHRT_MAX _SC_USHRT_MAX | |
6135 | ||
6136 | _SC_NL_ARGMAX, | |
6137 | #define _SC_NL_ARGMAX _SC_NL_ARGMAX | |
6138 | _SC_NL_LANGMAX, | |
6139 | #define _SC_NL_LANGMAX _SC_NL_LANGMAX | |
6140 | _SC_NL_MSGMAX, | |
6141 | #define _SC_NL_MSGMAX _SC_NL_MSGMAX | |
6142 | _SC_NL_NMAX, | |
6143 | #define _SC_NL_NMAX _SC_NL_NMAX | |
6144 | _SC_NL_SETMAX, | |
6145 | #define _SC_NL_SETMAX _SC_NL_SETMAX | |
6146 | _SC_NL_TEXTMAX, | |
6147 | #define _SC_NL_TEXTMAX _SC_NL_TEXTMAX | |
6148 | ||
6149 | _SC_XBS5_ILP32_OFF32, | |
6150 | #define _SC_XBS5_ILP32_OFF32 _SC_XBS5_ILP32_OFF32 | |
6151 | _SC_XBS5_ILP32_OFFBIG, | |
6152 | #define _SC_XBS5_ILP32_OFFBIG _SC_XBS5_ILP32_OFFBIG | |
6153 | _SC_XBS5_LP64_OFF64, | |
6154 | #define _SC_XBS5_LP64_OFF64 _SC_XBS5_LP64_OFF64 | |
6155 | _SC_XBS5_LPBIG_OFFBIG, | |
6156 | #define _SC_XBS5_LPBIG_OFFBIG _SC_XBS5_LPBIG_OFFBIG | |
6157 | ||
6158 | _SC_XOPEN_LEGACY, | |
6159 | #define _SC_XOPEN_LEGACY _SC_XOPEN_LEGACY | |
6160 | _SC_XOPEN_REALTIME, | |
6161 | #define _SC_XOPEN_REALTIME _SC_XOPEN_REALTIME | |
6162 | _SC_XOPEN_REALTIME_THREADS, | |
6163 | #define _SC_XOPEN_REALTIME_THREADS _SC_XOPEN_REALTIME_THREADS | |
6164 | ||
6165 | _SC_ADVISORY_INFO, | |
6166 | #define _SC_ADVISORY_INFO _SC_ADVISORY_INFO | |
6167 | _SC_BARRIERS, | |
6168 | #define _SC_BARRIERS _SC_BARRIERS | |
6169 | _SC_BASE, | |
6170 | #define _SC_BASE _SC_BASE | |
6171 | _SC_C_LANG_SUPPORT, | |
6172 | #define _SC_C_LANG_SUPPORT _SC_C_LANG_SUPPORT | |
6173 | _SC_C_LANG_SUPPORT_R, | |
6174 | #define _SC_C_LANG_SUPPORT_R _SC_C_LANG_SUPPORT_R | |
6175 | _SC_CLOCK_SELECTION, | |
6176 | #define _SC_CLOCK_SELECTION _SC_CLOCK_SELECTION | |
6177 | _SC_CPUTIME, | |
6178 | #define _SC_CPUTIME _SC_CPUTIME | |
6179 | _SC_THREAD_CPUTIME, | |
6180 | #define _SC_THREAD_CPUTIME _SC_THREAD_CPUTIME | |
6181 | _SC_DEVICE_IO, | |
6182 | #define _SC_DEVICE_IO _SC_DEVICE_IO | |
6183 | _SC_DEVICE_SPECIFIC, | |
6184 | #define _SC_DEVICE_SPECIFIC _SC_DEVICE_SPECIFIC | |
6185 | _SC_DEVICE_SPECIFIC_R, | |
6186 | #define _SC_DEVICE_SPECIFIC_R _SC_DEVICE_SPECIFIC_R | |
6187 | _SC_FD_MGMT, | |
6188 | #define _SC_FD_MGMT _SC_FD_MGMT | |
6189 | _SC_FIFO, | |
6190 | #define _SC_FIFO _SC_FIFO | |
6191 | _SC_PIPE, | |
6192 | #define _SC_PIPE _SC_PIPE | |
6193 | _SC_FILE_ATTRIBUTES, | |
6194 | #define _SC_FILE_ATTRIBUTES _SC_FILE_ATTRIBUTES | |
6195 | _SC_FILE_LOCKING, | |
6196 | #define _SC_FILE_LOCKING _SC_FILE_LOCKING | |
6197 | _SC_FILE_SYSTEM, | |
6198 | #define _SC_FILE_SYSTEM _SC_FILE_SYSTEM | |
6199 | _SC_MONOTONIC_CLOCK, | |
6200 | #define _SC_MONOTONIC_CLOCK _SC_MONOTONIC_CLOCK | |
6201 | _SC_MULTI_PROCESS, | |
6202 | #define _SC_MULTI_PROCESS _SC_MULTI_PROCESS | |
6203 | _SC_SINGLE_PROCESS, | |
6204 | #define _SC_SINGLE_PROCESS _SC_SINGLE_PROCESS | |
6205 | _SC_NETWORKING, | |
6206 | #define _SC_NETWORKING _SC_NETWORKING | |
6207 | _SC_READER_WRITER_LOCKS, | |
6208 | #define _SC_READER_WRITER_LOCKS _SC_READER_WRITER_LOCKS | |
6209 | _SC_SPIN_LOCKS, | |
6210 | #define _SC_SPIN_LOCKS _SC_SPIN_LOCKS | |
6211 | _SC_REGEXP, | |
6212 | #define _SC_REGEXP _SC_REGEXP | |
6213 | _SC_REGEX_VERSION, | |
6214 | #define _SC_REGEX_VERSION _SC_REGEX_VERSION | |
6215 | _SC_SHELL, | |
6216 | #define _SC_SHELL _SC_SHELL | |
6217 | _SC_SIGNALS, | |
6218 | #define _SC_SIGNALS _SC_SIGNALS | |
6219 | _SC_SPAWN, | |
6220 | #define _SC_SPAWN _SC_SPAWN | |
6221 | _SC_SPORADIC_SERVER, | |
6222 | #define _SC_SPORADIC_SERVER _SC_SPORADIC_SERVER | |
6223 | _SC_THREAD_SPORADIC_SERVER, | |
6224 | #define _SC_THREAD_SPORADIC_SERVER _SC_THREAD_SPORADIC_SERVER | |
6225 | _SC_SYSTEM_DATABASE, | |
6226 | #define _SC_SYSTEM_DATABASE _SC_SYSTEM_DATABASE | |
6227 | _SC_SYSTEM_DATABASE_R, | |
6228 | #define _SC_SYSTEM_DATABASE_R _SC_SYSTEM_DATABASE_R | |
6229 | _SC_TIMEOUTS, | |
6230 | #define _SC_TIMEOUTS _SC_TIMEOUTS | |
6231 | _SC_TYPED_MEMORY_OBJECTS, | |
6232 | #define _SC_TYPED_MEMORY_OBJECTS _SC_TYPED_MEMORY_OBJECTS | |
6233 | _SC_USER_GROUPS, | |
6234 | #define _SC_USER_GROUPS _SC_USER_GROUPS | |
6235 | _SC_USER_GROUPS_R, | |
6236 | #define _SC_USER_GROUPS_R _SC_USER_GROUPS_R | |
6237 | _SC_2_PBS, | |
6238 | #define _SC_2_PBS _SC_2_PBS | |
6239 | _SC_2_PBS_ACCOUNTING, | |
6240 | #define _SC_2_PBS_ACCOUNTING _SC_2_PBS_ACCOUNTING | |
6241 | _SC_2_PBS_LOCATE, | |
6242 | #define _SC_2_PBS_LOCATE _SC_2_PBS_LOCATE | |
6243 | _SC_2_PBS_MESSAGE, | |
6244 | #define _SC_2_PBS_MESSAGE _SC_2_PBS_MESSAGE | |
6245 | _SC_2_PBS_TRACK, | |
6246 | #define _SC_2_PBS_TRACK _SC_2_PBS_TRACK | |
6247 | _SC_SYMLOOP_MAX, | |
6248 | #define _SC_SYMLOOP_MAX _SC_SYMLOOP_MAX | |
6249 | _SC_STREAMS, | |
6250 | #define _SC_STREAMS _SC_STREAMS | |
6251 | _SC_2_PBS_CHECKPOINT, | |
6252 | #define _SC_2_PBS_CHECKPOINT _SC_2_PBS_CHECKPOINT | |
6253 | ||
6254 | _SC_V6_ILP32_OFF32, | |
6255 | #define _SC_V6_ILP32_OFF32 _SC_V6_ILP32_OFF32 | |
6256 | _SC_V6_ILP32_OFFBIG, | |
6257 | #define _SC_V6_ILP32_OFFBIG _SC_V6_ILP32_OFFBIG | |
6258 | _SC_V6_LP64_OFF64, | |
6259 | #define _SC_V6_LP64_OFF64 _SC_V6_LP64_OFF64 | |
6260 | _SC_V6_LPBIG_OFFBIG, | |
6261 | #define _SC_V6_LPBIG_OFFBIG _SC_V6_LPBIG_OFFBIG | |
6262 | ||
6263 | _SC_HOST_NAME_MAX, | |
6264 | #define _SC_HOST_NAME_MAX _SC_HOST_NAME_MAX | |
6265 | _SC_TRACE, | |
6266 | #define _SC_TRACE _SC_TRACE | |
6267 | _SC_TRACE_EVENT_FILTER, | |
6268 | #define _SC_TRACE_EVENT_FILTER _SC_TRACE_EVENT_FILTER | |
6269 | _SC_TRACE_INHERIT, | |
6270 | #define _SC_TRACE_INHERIT _SC_TRACE_INHERIT | |
6271 | _SC_TRACE_LOG, | |
6272 | #define _SC_TRACE_LOG _SC_TRACE_LOG | |
6273 | ||
6274 | _SC_LEVEL1_ICACHE_SIZE, | |
6275 | #define _SC_LEVEL1_ICACHE_SIZE _SC_LEVEL1_ICACHE_SIZE | |
6276 | _SC_LEVEL1_ICACHE_ASSOC, | |
6277 | #define _SC_LEVEL1_ICACHE_ASSOC _SC_LEVEL1_ICACHE_ASSOC | |
6278 | _SC_LEVEL1_ICACHE_LINESIZE, | |
6279 | #define _SC_LEVEL1_ICACHE_LINESIZE _SC_LEVEL1_ICACHE_LINESIZE | |
6280 | _SC_LEVEL1_DCACHE_SIZE, | |
6281 | #define _SC_LEVEL1_DCACHE_SIZE _SC_LEVEL1_DCACHE_SIZE | |
6282 | _SC_LEVEL1_DCACHE_ASSOC, | |
6283 | #define _SC_LEVEL1_DCACHE_ASSOC _SC_LEVEL1_DCACHE_ASSOC | |
6284 | _SC_LEVEL1_DCACHE_LINESIZE, | |
6285 | #define _SC_LEVEL1_DCACHE_LINESIZE _SC_LEVEL1_DCACHE_LINESIZE | |
6286 | _SC_LEVEL2_CACHE_SIZE, | |
6287 | #define _SC_LEVEL2_CACHE_SIZE _SC_LEVEL2_CACHE_SIZE | |
6288 | _SC_LEVEL2_CACHE_ASSOC, | |
6289 | #define _SC_LEVEL2_CACHE_ASSOC _SC_LEVEL2_CACHE_ASSOC | |
6290 | _SC_LEVEL2_CACHE_LINESIZE, | |
6291 | #define _SC_LEVEL2_CACHE_LINESIZE _SC_LEVEL2_CACHE_LINESIZE | |
6292 | _SC_LEVEL3_CACHE_SIZE, | |
6293 | #define _SC_LEVEL3_CACHE_SIZE _SC_LEVEL3_CACHE_SIZE | |
6294 | _SC_LEVEL3_CACHE_ASSOC, | |
6295 | #define _SC_LEVEL3_CACHE_ASSOC _SC_LEVEL3_CACHE_ASSOC | |
6296 | _SC_LEVEL3_CACHE_LINESIZE, | |
6297 | #define _SC_LEVEL3_CACHE_LINESIZE _SC_LEVEL3_CACHE_LINESIZE | |
6298 | _SC_LEVEL4_CACHE_SIZE, | |
6299 | #define _SC_LEVEL4_CACHE_SIZE _SC_LEVEL4_CACHE_SIZE | |
6300 | _SC_LEVEL4_CACHE_ASSOC, | |
6301 | #define _SC_LEVEL4_CACHE_ASSOC _SC_LEVEL4_CACHE_ASSOC | |
6302 | _SC_LEVEL4_CACHE_LINESIZE, | |
6303 | #define _SC_LEVEL4_CACHE_LINESIZE _SC_LEVEL4_CACHE_LINESIZE | |
6304 | ||
6305 | ||
6306 | _SC_IPV6 = _SC_LEVEL1_ICACHE_SIZE + 50, | |
6307 | #define _SC_IPV6 _SC_IPV6 | |
6308 | _SC_RAW_SOCKETS | |
6309 | #define _SC_RAW_SOCKETS _SC_RAW_SOCKETS | |
6310 | }; | |
6311 | ||
6312 | ||
6313 | enum | |
6314 | { | |
6315 | _CS_PATH, | |
6316 | #define _CS_PATH _CS_PATH | |
6317 | ||
6318 | _CS_V6_WIDTH_RESTRICTED_ENVS, | |
6319 | #define _CS_V6_WIDTH_RESTRICTED_ENVS _CS_V6_WIDTH_RESTRICTED_ENVS | |
6320 | ||
6321 | _CS_GNU_LIBC_VERSION, | |
6322 | #define _CS_GNU_LIBC_VERSION _CS_GNU_LIBC_VERSION | |
6323 | _CS_GNU_LIBPTHREAD_VERSION, | |
6324 | #define _CS_GNU_LIBPTHREAD_VERSION _CS_GNU_LIBPTHREAD_VERSION | |
6325 | ||
6326 | _CS_LFS_CFLAGS = 1000, | |
6327 | #define _CS_LFS_CFLAGS _CS_LFS_CFLAGS | |
6328 | _CS_LFS_LDFLAGS, | |
6329 | #define _CS_LFS_LDFLAGS _CS_LFS_LDFLAGS | |
6330 | _CS_LFS_LIBS, | |
6331 | #define _CS_LFS_LIBS _CS_LFS_LIBS | |
6332 | _CS_LFS_LINTFLAGS, | |
6333 | #define _CS_LFS_LINTFLAGS _CS_LFS_LINTFLAGS | |
6334 | _CS_LFS64_CFLAGS, | |
6335 | #define _CS_LFS64_CFLAGS _CS_LFS64_CFLAGS | |
6336 | _CS_LFS64_LDFLAGS, | |
6337 | #define _CS_LFS64_LDFLAGS _CS_LFS64_LDFLAGS | |
6338 | _CS_LFS64_LIBS, | |
6339 | #define _CS_LFS64_LIBS _CS_LFS64_LIBS | |
6340 | _CS_LFS64_LINTFLAGS, | |
6341 | #define _CS_LFS64_LINTFLAGS _CS_LFS64_LINTFLAGS | |
6342 | ||
6343 | _CS_XBS5_ILP32_OFF32_CFLAGS = 1100, | |
6344 | #define _CS_XBS5_ILP32_OFF32_CFLAGS _CS_XBS5_ILP32_OFF32_CFLAGS | |
6345 | _CS_XBS5_ILP32_OFF32_LDFLAGS, | |
6346 | #define _CS_XBS5_ILP32_OFF32_LDFLAGS _CS_XBS5_ILP32_OFF32_LDFLAGS | |
6347 | _CS_XBS5_ILP32_OFF32_LIBS, | |
6348 | #define _CS_XBS5_ILP32_OFF32_LIBS _CS_XBS5_ILP32_OFF32_LIBS | |
6349 | _CS_XBS5_ILP32_OFF32_LINTFLAGS, | |
6350 | #define _CS_XBS5_ILP32_OFF32_LINTFLAGS _CS_XBS5_ILP32_OFF32_LINTFLAGS | |
6351 | _CS_XBS5_ILP32_OFFBIG_CFLAGS, | |
6352 | #define _CS_XBS5_ILP32_OFFBIG_CFLAGS _CS_XBS5_ILP32_OFFBIG_CFLAGS | |
6353 | _CS_XBS5_ILP32_OFFBIG_LDFLAGS, | |
6354 | #define _CS_XBS5_ILP32_OFFBIG_LDFLAGS _CS_XBS5_ILP32_OFFBIG_LDFLAGS | |
6355 | _CS_XBS5_ILP32_OFFBIG_LIBS, | |
6356 | #define _CS_XBS5_ILP32_OFFBIG_LIBS _CS_XBS5_ILP32_OFFBIG_LIBS | |
6357 | _CS_XBS5_ILP32_OFFBIG_LINTFLAGS, | |
6358 | #define _CS_XBS5_ILP32_OFFBIG_LINTFLAGS _CS_XBS5_ILP32_OFFBIG_LINTFLAGS | |
6359 | _CS_XBS5_LP64_OFF64_CFLAGS, | |
6360 | #define _CS_XBS5_LP64_OFF64_CFLAGS _CS_XBS5_LP64_OFF64_CFLAGS | |
6361 | _CS_XBS5_LP64_OFF64_LDFLAGS, | |
6362 | #define _CS_XBS5_LP64_OFF64_LDFLAGS _CS_XBS5_LP64_OFF64_LDFLAGS | |
6363 | _CS_XBS5_LP64_OFF64_LIBS, | |
6364 | #define _CS_XBS5_LP64_OFF64_LIBS _CS_XBS5_LP64_OFF64_LIBS | |
6365 | _CS_XBS5_LP64_OFF64_LINTFLAGS, | |
6366 | #define _CS_XBS5_LP64_OFF64_LINTFLAGS _CS_XBS5_LP64_OFF64_LINTFLAGS | |
6367 | _CS_XBS5_LPBIG_OFFBIG_CFLAGS, | |
6368 | #define _CS_XBS5_LPBIG_OFFBIG_CFLAGS _CS_XBS5_LPBIG_OFFBIG_CFLAGS | |
6369 | _CS_XBS5_LPBIG_OFFBIG_LDFLAGS, | |
6370 | #define _CS_XBS5_LPBIG_OFFBIG_LDFLAGS _CS_XBS5_LPBIG_OFFBIG_LDFLAGS | |
6371 | _CS_XBS5_LPBIG_OFFBIG_LIBS, | |
6372 | #define _CS_XBS5_LPBIG_OFFBIG_LIBS _CS_XBS5_LPBIG_OFFBIG_LIBS | |
6373 | _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS, | |
6374 | #define _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS | |
6375 | ||
6376 | _CS_POSIX_V6_ILP32_OFF32_CFLAGS, | |
6377 | #define _CS_POSIX_V6_ILP32_OFF32_CFLAGS _CS_POSIX_V6_ILP32_OFF32_CFLAGS | |
6378 | _CS_POSIX_V6_ILP32_OFF32_LDFLAGS, | |
6379 | #define _CS_POSIX_V6_ILP32_OFF32_LDFLAGS _CS_POSIX_V6_ILP32_OFF32_LDFLAGS | |
6380 | _CS_POSIX_V6_ILP32_OFF32_LIBS, | |
6381 | #define _CS_POSIX_V6_ILP32_OFF32_LIBS _CS_POSIX_V6_ILP32_OFF32_LIBS | |
6382 | _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS, | |
6383 | #define _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS | |
6384 | _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS, | |
6385 | #define _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS | |
6386 | _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS, | |
6387 | #define _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS | |
6388 | _CS_POSIX_V6_ILP32_OFFBIG_LIBS, | |
6389 | #define _CS_POSIX_V6_ILP32_OFFBIG_LIBS _CS_POSIX_V6_ILP32_OFFBIG_LIBS | |
6390 | _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS, | |
6391 | #define _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS | |
6392 | _CS_POSIX_V6_LP64_OFF64_CFLAGS, | |
6393 | #define _CS_POSIX_V6_LP64_OFF64_CFLAGS _CS_POSIX_V6_LP64_OFF64_CFLAGS | |
6394 | _CS_POSIX_V6_LP64_OFF64_LDFLAGS, | |
6395 | #define _CS_POSIX_V6_LP64_OFF64_LDFLAGS _CS_POSIX_V6_LP64_OFF64_LDFLAGS | |
6396 | _CS_POSIX_V6_LP64_OFF64_LIBS, | |
6397 | #define _CS_POSIX_V6_LP64_OFF64_LIBS _CS_POSIX_V6_LP64_OFF64_LIBS | |
6398 | _CS_POSIX_V6_LP64_OFF64_LINTFLAGS, | |
6399 | #define _CS_POSIX_V6_LP64_OFF64_LINTFLAGS _CS_POSIX_V6_LP64_OFF64_LINTFLAGS | |
6400 | _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS, | |
6401 | #define _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS | |
6402 | _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS, | |
6403 | #define _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS | |
6404 | _CS_POSIX_V6_LPBIG_OFFBIG_LIBS, | |
6405 | #define _CS_POSIX_V6_LPBIG_OFFBIG_LIBS _CS_POSIX_V6_LPBIG_OFFBIG_LIBS | |
6406 | _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS | |
6407 | #define _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS | |
6408 | }; | |
6409 | # 555 "/usr/include/unistd.h" 2 3 4 | |
6410 | ||
6411 | ||
6412 | extern long int pathconf (__const char *__path, int __name) | |
6413 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
6414 | ||
6415 | ||
6416 | extern long int fpathconf (int __fd, int __name) __attribute__ ((__nothrow__)); | |
6417 | ||
6418 | ||
6419 | extern long int sysconf (int __name) __attribute__ ((__nothrow__)); | |
6420 | ||
6421 | ||
6422 | ||
6423 | extern size_t confstr (int __name, char *__buf, size_t __len) __attribute__ ((__nothrow__)); | |
6424 | ||
6425 | ||
6426 | ||
6427 | ||
6428 | extern __pid_t getpid (void) __attribute__ ((__nothrow__)); | |
6429 | ||
6430 | ||
6431 | extern __pid_t getppid (void) __attribute__ ((__nothrow__)); | |
6432 | ||
6433 | ||
6434 | ||
6435 | ||
6436 | extern __pid_t getpgrp (void) __attribute__ ((__nothrow__)); | |
6437 | # 591 "/usr/include/unistd.h" 3 4 | |
6438 | extern __pid_t __getpgid (__pid_t __pid) __attribute__ ((__nothrow__)); | |
6439 | # 600 "/usr/include/unistd.h" 3 4 | |
6440 | extern int setpgid (__pid_t __pid, __pid_t __pgid) __attribute__ ((__nothrow__)); | |
6441 | # 617 "/usr/include/unistd.h" 3 4 | |
6442 | extern int setpgrp (void) __attribute__ ((__nothrow__)); | |
6443 | # 634 "/usr/include/unistd.h" 3 4 | |
6444 | extern __pid_t setsid (void) __attribute__ ((__nothrow__)); | |
6445 | ||
6446 | ||
6447 | ||
6448 | ||
6449 | ||
6450 | ||
6451 | ||
6452 | extern __uid_t getuid (void) __attribute__ ((__nothrow__)); | |
6453 | ||
6454 | ||
6455 | extern __uid_t geteuid (void) __attribute__ ((__nothrow__)); | |
6456 | ||
6457 | ||
6458 | extern __gid_t getgid (void) __attribute__ ((__nothrow__)); | |
6459 | ||
6460 | ||
6461 | extern __gid_t getegid (void) __attribute__ ((__nothrow__)); | |
6462 | ||
6463 | ||
6464 | ||
6465 | ||
6466 | extern int getgroups (int __size, __gid_t __list[]) __attribute__ ((__nothrow__)) ; | |
6467 | # 667 "/usr/include/unistd.h" 3 4 | |
6468 | extern int setuid (__uid_t __uid) __attribute__ ((__nothrow__)); | |
6469 | ||
6470 | ||
6471 | ||
6472 | ||
6473 | extern int setreuid (__uid_t __ruid, __uid_t __euid) __attribute__ ((__nothrow__)); | |
6474 | ||
6475 | ||
6476 | ||
6477 | ||
6478 | extern int seteuid (__uid_t __uid) __attribute__ ((__nothrow__)); | |
6479 | ||
6480 | ||
6481 | ||
6482 | ||
6483 | ||
6484 | ||
6485 | extern int setgid (__gid_t __gid) __attribute__ ((__nothrow__)); | |
6486 | ||
6487 | ||
6488 | ||
6489 | ||
6490 | extern int setregid (__gid_t __rgid, __gid_t __egid) __attribute__ ((__nothrow__)); | |
6491 | ||
6492 | ||
6493 | ||
6494 | ||
6495 | extern int setegid (__gid_t __gid) __attribute__ ((__nothrow__)); | |
6496 | # 723 "/usr/include/unistd.h" 3 4 | |
6497 | extern __pid_t fork (void) __attribute__ ((__nothrow__)); | |
6498 | ||
6499 | ||
6500 | ||
6501 | ||
6502 | ||
6503 | ||
6504 | extern __pid_t vfork (void) __attribute__ ((__nothrow__)); | |
6505 | ||
6506 | ||
6507 | ||
6508 | ||
6509 | ||
6510 | extern char *ttyname (int __fd) __attribute__ ((__nothrow__)); | |
6511 | ||
6512 | ||
6513 | ||
6514 | extern int ttyname_r (int __fd, char *__buf, size_t __buflen) | |
6515 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2))) ; | |
6516 | ||
6517 | ||
6518 | ||
6519 | extern int isatty (int __fd) __attribute__ ((__nothrow__)); | |
6520 | ||
6521 | ||
6522 | ||
6523 | ||
6524 | ||
6525 | extern int ttyslot (void) __attribute__ ((__nothrow__)); | |
6526 | ||
6527 | ||
6528 | ||
6529 | ||
6530 | extern int link (__const char *__from, __const char *__to) | |
6531 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))) ; | |
6532 | # 769 "/usr/include/unistd.h" 3 4 | |
6533 | extern int symlink (__const char *__from, __const char *__to) | |
6534 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))) ; | |
6535 | ||
6536 | ||
6537 | ||
6538 | ||
6539 | extern ssize_t readlink (__const char *__restrict __path, | |
6540 | char *__restrict __buf, size_t __len) | |
6541 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))) ; | |
6542 | # 792 "/usr/include/unistd.h" 3 4 | |
6543 | extern int unlink (__const char *__name) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
6544 | # 801 "/usr/include/unistd.h" 3 4 | |
6545 | extern int rmdir (__const char *__path) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
6546 | ||
6547 | ||
6548 | ||
6549 | extern __pid_t tcgetpgrp (int __fd) __attribute__ ((__nothrow__)); | |
6550 | ||
6551 | ||
6552 | extern int tcsetpgrp (int __fd, __pid_t __pgrp_id) __attribute__ ((__nothrow__)); | |
6553 | ||
6554 | ||
6555 | ||
6556 | ||
6557 | ||
6558 | ||
6559 | extern char *getlogin (void); | |
6560 | ||
6561 | ||
6562 | ||
6563 | ||
6564 | ||
6565 | ||
6566 | ||
6567 | extern int getlogin_r (char *__name, size_t __name_len) __attribute__ ((__nonnull__ (1))); | |
6568 | ||
6569 | ||
6570 | ||
6571 | ||
6572 | extern int setlogin (__const char *__name) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
6573 | ||
6574 | ||
6575 | ||
6576 | ||
6577 | ||
6578 | ||
6579 | ||
6580 | #define __need_getopt | |
6581 | # 845 "/usr/include/unistd.h" 3 4 | |
6582 | extern int gethostname (char *__name, size_t __len) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
6583 | ||
6584 | ||
6585 | ||
6586 | ||
6587 | ||
6588 | ||
6589 | extern int sethostname (__const char *__name, size_t __len) | |
6590 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; | |
6591 | ||
6592 | ||
6593 | ||
6594 | extern int sethostid (long int __id) __attribute__ ((__nothrow__)) ; | |
6595 | ||
6596 | ||
6597 | ||
6598 | ||
6599 | ||
6600 | extern int getdomainname (char *__name, size_t __len) | |
6601 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; | |
6602 | extern int setdomainname (__const char *__name, size_t __len) | |
6603 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; | |
6604 | ||
6605 | ||
6606 | ||
6607 | ||
6608 | ||
6609 | extern int vhangup (void) __attribute__ ((__nothrow__)); | |
6610 | ||
6611 | ||
6612 | extern int revoke (__const char *__file) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; | |
6613 | ||
6614 | ||
6615 | ||
6616 | ||
6617 | ||
6618 | ||
6619 | ||
6620 | extern int profil (unsigned short int *__sample_buffer, size_t __size, | |
6621 | size_t __offset, unsigned int __scale) | |
6622 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
6623 | ||
6624 | ||
6625 | ||
6626 | ||
6627 | ||
6628 | extern int acct (__const char *__name) __attribute__ ((__nothrow__)); | |
6629 | ||
6630 | ||
6631 | ||
6632 | extern char *getusershell (void) __attribute__ ((__nothrow__)); | |
6633 | extern void endusershell (void) __attribute__ ((__nothrow__)); | |
6634 | extern void setusershell (void) __attribute__ ((__nothrow__)); | |
6635 | ||
6636 | ||
6637 | ||
6638 | ||
6639 | ||
6640 | extern int daemon (int __nochdir, int __noclose) __attribute__ ((__nothrow__)) ; | |
6641 | ||
6642 | ||
6643 | ||
6644 | ||
6645 | ||
6646 | ||
6647 | extern int chroot (__const char *__path) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; | |
6648 | ||
6649 | ||
6650 | ||
6651 | extern char *getpass (__const char *__prompt) __attribute__ ((__nonnull__ (1))); | |
6652 | # 923 "/usr/include/unistd.h" 3 4 | |
6653 | extern int fsync (int __fd); | |
6654 | ||
6655 | ||
6656 | ||
6657 | ||
6658 | ||
6659 | ||
6660 | extern long int gethostid (void); | |
6661 | ||
6662 | ||
6663 | extern void sync (void) __attribute__ ((__nothrow__)); | |
6664 | ||
6665 | ||
6666 | ||
6667 | ||
6668 | extern int getpagesize (void) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); | |
6669 | ||
6670 | ||
6671 | ||
6672 | ||
6673 | extern int getdtablesize (void) __attribute__ ((__nothrow__)); | |
6674 | ||
6675 | ||
6676 | ||
6677 | ||
6678 | extern int truncate (__const char *__file, __off_t __length) | |
6679 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; | |
6680 | # 970 "/usr/include/unistd.h" 3 4 | |
6681 | extern int ftruncate (int __fd, __off_t __length) __attribute__ ((__nothrow__)) ; | |
6682 | # 990 "/usr/include/unistd.h" 3 4 | |
6683 | extern int brk (void *__addr) __attribute__ ((__nothrow__)) ; | |
6684 | ||
6685 | ||
6686 | ||
6687 | ||
6688 | ||
6689 | extern void *sbrk (intptr_t __delta) __attribute__ ((__nothrow__)); | |
6690 | # 1011 "/usr/include/unistd.h" 3 4 | |
6691 | extern long int syscall (long int __sysno, ...) __attribute__ ((__nothrow__)); | |
6692 | # 1065 "/usr/include/unistd.h" 3 4 | |
6693 | extern int fdatasync (int __fildes); | |
6694 | # 1103 "/usr/include/unistd.h" 3 4 | |
6695 | ||
6696 | # 30 "unix.c" 2 | |
6697 | ||
6698 | # 1 "/usr/include/errno.h" 1 3 4 | |
6699 | # 28 "/usr/include/errno.h" 3 4 | |
6700 | #define _ERRNO_H 1 | |
6701 | ||
6702 | ||
6703 | ||
6704 | ||
6705 | ||
6706 | ||
6707 | ||
6708 | # 1 "/usr/include/bits/errno.h" 1 3 4 | |
6709 | # 22 "/usr/include/bits/errno.h" 3 4 | |
6710 | #undef EDOM | |
6711 | #undef EILSEQ | |
6712 | #undef ERANGE | |
6713 | # 1 "/usr/include/linux/errno.h" 1 3 4 | |
6714 | ||
6715 | #define _LINUX_ERRNO_H | |
6716 | ||
6717 | # 1 "/usr/include/asm/errno.h" 1 3 4 | |
6718 | ||
6719 | #define _I386_ERRNO_H | |
6720 | ||
6721 | # 1 "/usr/include/asm-generic/errno.h" 1 3 4 | |
6722 | ||
6723 | #define _ASM_GENERIC_ERRNO_H | |
6724 | ||
6725 | # 1 "/usr/include/asm-generic/errno-base.h" 1 3 4 | |
6726 | ||
6727 | #define _ASM_GENERIC_ERRNO_BASE_H | |
6728 | ||
6729 | #define EPERM 1 | |
6730 | #define ENOENT 2 | |
6731 | #define ESRCH 3 | |
6732 | #define EINTR 4 | |
6733 | #define EIO 5 | |
6734 | #define ENXIO 6 | |
6735 | #define E2BIG 7 | |
6736 | #define ENOEXEC 8 | |
6737 | #define EBADF 9 | |
6738 | #define ECHILD 10 | |
6739 | #define EAGAIN 11 | |
6740 | #define ENOMEM 12 | |
6741 | #define EACCES 13 | |
6742 | #define EFAULT 14 | |
6743 | #define ENOTBLK 15 | |
6744 | #define EBUSY 16 | |
6745 | #define EEXIST 17 | |
6746 | #define EXDEV 18 | |
6747 | #define ENODEV 19 | |
6748 | #define ENOTDIR 20 | |
6749 | #define EISDIR 21 | |
6750 | #define EINVAL 22 | |
6751 | #define ENFILE 23 | |
6752 | #define EMFILE 24 | |
6753 | #define ENOTTY 25 | |
6754 | #define ETXTBSY 26 | |
6755 | #define EFBIG 27 | |
6756 | #define ENOSPC 28 | |
6757 | #define ESPIPE 29 | |
6758 | #define EROFS 30 | |
6759 | #define EMLINK 31 | |
6760 | #define EPIPE 32 | |
6761 | #define EDOM 33 | |
6762 | #define ERANGE 34 | |
6763 | # 5 "/usr/include/asm-generic/errno.h" 2 3 4 | |
6764 | ||
6765 | #define EDEADLK 35 | |
6766 | #define ENAMETOOLONG 36 | |
6767 | #define ENOLCK 37 | |
6768 | #define ENOSYS 38 | |
6769 | #define ENOTEMPTY 39 | |
6770 | #define ELOOP 40 | |
6771 | #define EWOULDBLOCK EAGAIN | |
6772 | #define ENOMSG 42 | |
6773 | #define EIDRM 43 | |
6774 | #define ECHRNG 44 | |
6775 | #define EL2NSYNC 45 | |
6776 | #define EL3HLT 46 | |
6777 | #define EL3RST 47 | |
6778 | #define ELNRNG 48 | |
6779 | #define EUNATCH 49 | |
6780 | #define ENOCSI 50 | |
6781 | #define EL2HLT 51 | |
6782 | #define EBADE 52 | |
6783 | #define EBADR 53 | |
6784 | #define EXFULL 54 | |
6785 | #define ENOANO 55 | |
6786 | #define EBADRQC 56 | |
6787 | #define EBADSLT 57 | |
6788 | ||
6789 | #define EDEADLOCK EDEADLK | |
6790 | ||
6791 | #define EBFONT 59 | |
6792 | #define ENOSTR 60 | |
6793 | #define ENODATA 61 | |
6794 | #define ETIME 62 | |
6795 | #define ENOSR 63 | |
6796 | #define ENONET 64 | |
6797 | #define ENOPKG 65 | |
6798 | #define EREMOTE 66 | |
6799 | #define ENOLINK 67 | |
6800 | #define EADV 68 | |
6801 | #define ESRMNT 69 | |
6802 | #define ECOMM 70 | |
6803 | #define EPROTO 71 | |
6804 | #define EMULTIHOP 72 | |
6805 | #define EDOTDOT 73 | |
6806 | #define EBADMSG 74 | |
6807 | #define EOVERFLOW 75 | |
6808 | #define ENOTUNIQ 76 | |
6809 | #define EBADFD 77 | |
6810 | #define EREMCHG 78 | |
6811 | #define ELIBACC 79 | |
6812 | #define ELIBBAD 80 | |
6813 | #define ELIBSCN 81 | |
6814 | #define ELIBMAX 82 | |
6815 | #define ELIBEXEC 83 | |
6816 | #define EILSEQ 84 | |
6817 | #define ERESTART 85 | |
6818 | #define ESTRPIPE 86 | |
6819 | #define EUSERS 87 | |
6820 | #define ENOTSOCK 88 | |
6821 | #define EDESTADDRREQ 89 | |
6822 | #define EMSGSIZE 90 | |
6823 | #define EPROTOTYPE 91 | |
6824 | #define ENOPROTOOPT 92 | |
6825 | #define EPROTONOSUPPORT 93 | |
6826 | #define ESOCKTNOSUPPORT 94 | |
6827 | #define EOPNOTSUPP 95 | |
6828 | #define EPFNOSUPPORT 96 | |
6829 | #define EAFNOSUPPORT 97 | |
6830 | #define EADDRINUSE 98 | |
6831 | #define EADDRNOTAVAIL 99 | |
6832 | #define ENETDOWN 100 | |
6833 | #define ENETUNREACH 101 | |
6834 | #define ENETRESET 102 | |
6835 | #define ECONNABORTED 103 | |
6836 | #define ECONNRESET 104 | |
6837 | #define ENOBUFS 105 | |
6838 | #define EISCONN 106 | |
6839 | #define ENOTCONN 107 | |
6840 | #define ESHUTDOWN 108 | |
6841 | #define ETOOMANYREFS 109 | |
6842 | #define ETIMEDOUT 110 | |
6843 | #define ECONNREFUSED 111 | |
6844 | #define EHOSTDOWN 112 | |
6845 | #define EHOSTUNREACH 113 | |
6846 | #define EALREADY 114 | |
6847 | #define EINPROGRESS 115 | |
6848 | #define ESTALE 116 | |
6849 | #define EUCLEAN 117 | |
6850 | #define ENOTNAM 118 | |
6851 | #define ENAVAIL 119 | |
6852 | #define EISNAM 120 | |
6853 | #define EREMOTEIO 121 | |
6854 | #define EDQUOT 122 | |
6855 | ||
6856 | #define ENOMEDIUM 123 | |
6857 | #define EMEDIUMTYPE 124 | |
6858 | #define ECANCELED 125 | |
6859 | #define ENOKEY 126 | |
6860 | #define EKEYEXPIRED 127 | |
6861 | #define EKEYREVOKED 128 | |
6862 | #define EKEYREJECTED 129 | |
6863 | ||
6864 | ||
6865 | #define EOWNERDEAD 130 | |
6866 | #define ENOTRECOVERABLE 131 | |
6867 | # 5 "/usr/include/asm/errno.h" 2 3 4 | |
6868 | # 5 "/usr/include/linux/errno.h" 2 3 4 | |
6869 | # 26 "/usr/include/bits/errno.h" 2 3 4 | |
6870 | ||
6871 | ||
6872 | #define ENOTSUP EOPNOTSUPP | |
6873 | # 43 "/usr/include/bits/errno.h" 3 4 | |
6874 | extern int *__errno_location (void) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); | |
6875 | ||
6876 | ||
6877 | ||
6878 | #define errno (*__errno_location ()) | |
6879 | # 37 "/usr/include/errno.h" 2 3 4 | |
6880 | #undef __need_Emath | |
6881 | # 59 "/usr/include/errno.h" 3 4 | |
6882 | ||
6883 | # 32 "unix.c" 2 | |
6884 | ||
6885 | ||
6886 | # 1 "/usr/include/mntent.h" 1 3 4 | |
6887 | # 21 "/usr/include/mntent.h" 3 4 | |
6888 | #define _MNTENT_H 1 | |
6889 | ||
6890 | ||
6891 | #define __need_FILE | |
6892 | ||
6893 | # 1 "/usr/include/paths.h" 1 3 4 | |
6894 | # 33 "/usr/include/paths.h" 3 4 | |
6895 | #define _PATHS_H_ | |
6896 | ||
6897 | ||
6898 | #define _PATH_DEFPATH "/usr/bin:/bin" | |
6899 | ||
6900 | #define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin" | |
6901 | ||
6902 | ||
6903 | #define _PATH_BSHELL "/bin/sh" | |
6904 | #define _PATH_CONSOLE "/dev/console" | |
6905 | #define _PATH_CSHELL "/bin/csh" | |
6906 | #define _PATH_DEVDB "/var/run/dev.db" | |
6907 | #define _PATH_DEVNULL "/dev/null" | |
6908 | #define _PATH_DRUM "/dev/drum" | |
6909 | #define _PATH_KLOG "/proc/kmsg" | |
6910 | #define _PATH_KMEM "/dev/kmem" | |
6911 | #define _PATH_LASTLOG "/var/log/lastlog" | |
6912 | #define _PATH_MAILDIR "/var/mail" | |
6913 | #define _PATH_MAN "/usr/share/man" | |
6914 | #define _PATH_MEM "/dev/mem" | |
6915 | #define _PATH_MNTTAB "/etc/fstab" | |
6916 | #define _PATH_MOUNTED "/etc/mtab" | |
6917 | #define _PATH_NOLOGIN "/etc/nologin" | |
6918 | #define _PATH_PRESERVE "/var/lib" | |
6919 | #define _PATH_RWHODIR "/var/spool/rwho" | |
6920 | #define _PATH_SENDMAIL "/usr/sbin/sendmail" | |
6921 | #define _PATH_SHADOW "/etc/shadow" | |
6922 | #define _PATH_SHELLS "/etc/shells" | |
6923 | #define _PATH_TTY "/dev/tty" | |
6924 | #define _PATH_UNIX "/boot/vmlinux" | |
6925 | #define _PATH_UTMP "/var/run/utmp" | |
6926 | #define _PATH_VI "/usr/bin/vi" | |
6927 | #define _PATH_WTMP "/var/log/wtmp" | |
6928 | ||
6929 | ||
6930 | #define _PATH_DEV "/dev/" | |
6931 | #define _PATH_TMP "/tmp/" | |
6932 | #define _PATH_VARDB "/var/db/" | |
6933 | #define _PATH_VARRUN "/var/run/" | |
6934 | #define _PATH_VARTMP "/var/tmp/" | |
6935 | # 27 "/usr/include/mntent.h" 2 3 4 | |
6936 | ||
6937 | ||
6938 | ||
6939 | #define MNTTAB _PATH_MNTTAB | |
6940 | ||
6941 | ||
6942 | #define MOUNTED _PATH_MOUNTED | |
6943 | ||
6944 | ||
6945 | ||
6946 | #define MNTTYPE_IGNORE "ignore" | |
6947 | #define MNTTYPE_NFS "nfs" | |
6948 | #define MNTTYPE_SWAP "swap" | |
6949 | ||
6950 | ||
6951 | ||
6952 | #define MNTOPT_DEFAULTS "defaults" | |
6953 | #define MNTOPT_RO "ro" | |
6954 | #define MNTOPT_RW "rw" | |
6955 | #define MNTOPT_SUID "suid" | |
6956 | #define MNTOPT_NOSUID "nosuid" | |
6957 | #define MNTOPT_NOAUTO "noauto" | |
6958 | ||
6959 | ||
6960 | ||
6961 | ||
6962 | ||
6963 | struct mntent | |
6964 | { | |
6965 | char *mnt_fsname; | |
6966 | char *mnt_dir; | |
6967 | char *mnt_type; | |
6968 | char *mnt_opts; | |
6969 | int mnt_freq; | |
6970 | int mnt_passno; | |
6971 | }; | |
6972 | ||
6973 | ||
6974 | ||
6975 | ||
6976 | extern FILE *setmntent (__const char *__file, __const char *__mode) __attribute__ ((__nothrow__)); | |
6977 | ||
6978 | ||
6979 | ||
6980 | ||
6981 | extern struct mntent *getmntent (FILE *__stream) __attribute__ ((__nothrow__)); | |
6982 | ||
6983 | ||
6984 | ||
6985 | extern struct mntent *getmntent_r (FILE *__restrict __stream, | |
6986 | struct mntent *__restrict __result, | |
6987 | char *__restrict __buffer, | |
6988 | int __bufsize) __attribute__ ((__nothrow__)); | |
6989 | ||
6990 | ||
6991 | ||
6992 | ||
6993 | extern int addmntent (FILE *__restrict __stream, | |
6994 | __const struct mntent *__restrict __mnt) __attribute__ ((__nothrow__)); | |
6995 | ||
6996 | ||
6997 | extern int endmntent (FILE *__stream) __attribute__ ((__nothrow__)); | |
6998 | ||
6999 | ||
7000 | ||
7001 | extern char *hasmntopt (__const struct mntent *__mnt, | |
7002 | __const char *__opt) __attribute__ ((__nothrow__)); | |
7003 | ||
7004 | ||
7005 | ||
7006 | # 35 "unix.c" 2 | |
7007 | ||
7008 | ||
7009 | # 1 "/usr/include/sys/ioctl.h" 1 3 4 | |
7010 | # 20 "/usr/include/sys/ioctl.h" 3 4 | |
7011 | #define _SYS_IOCTL_H 1 | |
7012 | ||
7013 | ||
7014 | ||
7015 | ||
7016 | ||
7017 | ||
7018 | # 1 "/usr/include/bits/ioctls.h" 1 3 4 | |
7019 | # 24 "/usr/include/bits/ioctls.h" 3 4 | |
7020 | # 1 "/usr/include/asm/ioctls.h" 1 3 4 | |
7021 | ||
7022 | #define __ARCH_I386_IOCTLS_H__ | |
7023 | ||
7024 | # 1 "/usr/include/asm/ioctl.h" 1 3 4 | |
7025 | # 1 "/usr/include/asm-generic/ioctl.h" 1 3 4 | |
7026 | ||
7027 | #define _ASM_GENERIC_IOCTL_H | |
7028 | # 22 "/usr/include/asm-generic/ioctl.h" 3 4 | |
7029 | #define _IOC_NRBITS 8 | |
7030 | #define _IOC_TYPEBITS 8 | |
7031 | #define _IOC_SIZEBITS 14 | |
7032 | #define _IOC_DIRBITS 2 | |
7033 | ||
7034 | #define _IOC_NRMASK ((1 << _IOC_NRBITS)-1) | |
7035 | #define _IOC_TYPEMASK ((1 << _IOC_TYPEBITS)-1) | |
7036 | #define _IOC_SIZEMASK ((1 << _IOC_SIZEBITS)-1) | |
7037 | #define _IOC_DIRMASK ((1 << _IOC_DIRBITS)-1) | |
7038 | ||
7039 | #define _IOC_NRSHIFT 0 | |
7040 | #define _IOC_TYPESHIFT (_IOC_NRSHIFT+_IOC_NRBITS) | |
7041 | #define _IOC_SIZESHIFT (_IOC_TYPESHIFT+_IOC_TYPEBITS) | |
7042 | #define _IOC_DIRSHIFT (_IOC_SIZESHIFT+_IOC_SIZEBITS) | |
7043 | ||
7044 | ||
7045 | ||
7046 | ||
7047 | #define _IOC_NONE 0U | |
7048 | #define _IOC_WRITE 1U | |
7049 | #define _IOC_READ 2U | |
7050 | ||
7051 | #define _IOC(dir,type,nr,size) (((dir) << _IOC_DIRSHIFT) | ((type) << _IOC_TYPESHIFT) | ((nr) << _IOC_NRSHIFT) | ((size) << _IOC_SIZESHIFT)) | |
7052 | ||
7053 | ||
7054 | ||
7055 | ||
7056 | ||
7057 | ||
7058 | extern unsigned int __invalid_size_argument_for_IOC; | |
7059 | #define _IOC_TYPECHECK(t) ((sizeof(t) == sizeof(t[1]) && sizeof(t) < (1 << _IOC_SIZEBITS)) ? sizeof(t) : __invalid_size_argument_for_IOC) | |
7060 | ||
7061 | ||
7062 | ||
7063 | ||
7064 | ||
7065 | #define _IO(type,nr) _IOC(_IOC_NONE,(type),(nr),0) | |
7066 | #define _IOR(type,nr,size) _IOC(_IOC_READ,(type),(nr),(_IOC_TYPECHECK(size))) | |
7067 | #define _IOW(type,nr,size) _IOC(_IOC_WRITE,(type),(nr),(_IOC_TYPECHECK(size))) | |
7068 | #define _IOWR(type,nr,size) _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),(_IOC_TYPECHECK(size))) | |
7069 | #define _IOR_BAD(type,nr,size) _IOC(_IOC_READ,(type),(nr),sizeof(size)) | |
7070 | #define _IOW_BAD(type,nr,size) _IOC(_IOC_WRITE,(type),(nr),sizeof(size)) | |
7071 | #define _IOWR_BAD(type,nr,size) _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),sizeof(size)) | |
7072 | ||
7073 | ||
7074 | #define _IOC_DIR(nr) (((nr) >> _IOC_DIRSHIFT) & _IOC_DIRMASK) | |
7075 | #define _IOC_TYPE(nr) (((nr) >> _IOC_TYPESHIFT) & _IOC_TYPEMASK) | |
7076 | #define _IOC_NR(nr) (((nr) >> _IOC_NRSHIFT) & _IOC_NRMASK) | |
7077 | #define _IOC_SIZE(nr) (((nr) >> _IOC_SIZESHIFT) & _IOC_SIZEMASK) | |
7078 | ||
7079 | ||
7080 | ||
7081 | #define IOC_IN (_IOC_WRITE << _IOC_DIRSHIFT) | |
7082 | #define IOC_OUT (_IOC_READ << _IOC_DIRSHIFT) | |
7083 | #define IOC_INOUT ((_IOC_WRITE|_IOC_READ) << _IOC_DIRSHIFT) | |
7084 | #define IOCSIZE_MASK (_IOC_SIZEMASK << _IOC_SIZESHIFT) | |
7085 | #define IOCSIZE_SHIFT (_IOC_SIZESHIFT) | |
7086 | # 1 "/usr/include/asm/ioctl.h" 2 3 4 | |
7087 | # 5 "/usr/include/asm/ioctls.h" 2 3 4 | |
7088 | ||
7089 | ||
7090 | ||
7091 | #define TCGETS 0x5401 | |
7092 | #define TCSETS 0x5402 | |
7093 | #define TCSETSW 0x5403 | |
7094 | #define TCSETSF 0x5404 | |
7095 | #define TCGETA 0x5405 | |
7096 | #define TCSETA 0x5406 | |
7097 | #define TCSETAW 0x5407 | |
7098 | #define TCSETAF 0x5408 | |
7099 | #define TCSBRK 0x5409 | |
7100 | #define TCXONC 0x540A | |
7101 | #define TCFLSH 0x540B | |
7102 | #define TIOCEXCL 0x540C | |
7103 | #define TIOCNXCL 0x540D | |
7104 | #define TIOCSCTTY 0x540E | |
7105 | #define TIOCGPGRP 0x540F | |
7106 | #define TIOCSPGRP 0x5410 | |
7107 | #define TIOCOUTQ 0x5411 | |
7108 | #define TIOCSTI 0x5412 | |
7109 | #define TIOCGWINSZ 0x5413 | |
7110 | #define TIOCSWINSZ 0x5414 | |
7111 | #define TIOCMGET 0x5415 | |
7112 | #define TIOCMBIS 0x5416 | |
7113 | #define TIOCMBIC 0x5417 | |
7114 | #define TIOCMSET 0x5418 | |
7115 | #define TIOCGSOFTCAR 0x5419 | |
7116 | #define TIOCSSOFTCAR 0x541A | |
7117 | #define FIONREAD 0x541B | |
7118 | #define TIOCINQ FIONREAD | |
7119 | #define TIOCLINUX 0x541C | |
7120 | #define TIOCCONS 0x541D | |
7121 | #define TIOCGSERIAL 0x541E | |
7122 | #define TIOCSSERIAL 0x541F | |
7123 | #define TIOCPKT 0x5420 | |
7124 | #define FIONBIO 0x5421 | |
7125 | #define TIOCNOTTY 0x5422 | |
7126 | #define TIOCSETD 0x5423 | |
7127 | #define TIOCGETD 0x5424 | |
7128 | #define TCSBRKP 0x5425 | |
7129 | ||
7130 | #define TIOCSBRK 0x5427 | |
7131 | #define TIOCCBRK 0x5428 | |
7132 | #define TIOCGSID 0x5429 | |
7133 | #define TCGETS2 _IOR('T',0x2A, struct termios2) | |
7134 | #define TCSETS2 _IOW('T',0x2B, struct termios2) | |
7135 | #define TCSETSW2 _IOW('T',0x2C, struct termios2) | |
7136 | #define TCSETSF2 _IOW('T',0x2D, struct termios2) | |
7137 | #define TIOCGPTN _IOR('T',0x30, unsigned int) | |
7138 | #define TIOCSPTLCK _IOW('T',0x31, int) | |
7139 | ||
7140 | #define FIONCLEX 0x5450 | |
7141 | #define FIOCLEX 0x5451 | |
7142 | #define FIOASYNC 0x5452 | |
7143 | #define TIOCSERCONFIG 0x5453 | |
7144 | #define TIOCSERGWILD 0x5454 | |
7145 | #define TIOCSERSWILD 0x5455 | |
7146 | #define TIOCGLCKTRMIOS 0x5456 | |
7147 | #define TIOCSLCKTRMIOS 0x5457 | |
7148 | #define TIOCSERGSTRUCT 0x5458 | |
7149 | #define TIOCSERGETLSR 0x5459 | |
7150 | #define TIOCSERGETMULTI 0x545A | |
7151 | #define TIOCSERSETMULTI 0x545B | |
7152 | ||
7153 | #define TIOCMIWAIT 0x545C | |
7154 | #define TIOCGICOUNT 0x545D | |
7155 | #define TIOCGHAYESESP 0x545E | |
7156 | #define TIOCSHAYESESP 0x545F | |
7157 | #define FIOQSIZE 0x5460 | |
7158 | ||
7159 | ||
7160 | #define TIOCPKT_DATA 0 | |
7161 | #define TIOCPKT_FLUSHREAD 1 | |
7162 | #define TIOCPKT_FLUSHWRITE 2 | |
7163 | #define TIOCPKT_STOP 4 | |
7164 | #define TIOCPKT_START 8 | |
7165 | #define TIOCPKT_NOSTOP 16 | |
7166 | #define TIOCPKT_DOSTOP 32 | |
7167 | ||
7168 | #define TIOCSER_TEMT 0x01 | |
7169 | # 25 "/usr/include/bits/ioctls.h" 2 3 4 | |
7170 | ||
7171 | ||
7172 | #define SIOCADDRT 0x890B | |
7173 | #define SIOCDELRT 0x890C | |
7174 | #define SIOCRTMSG 0x890D | |
7175 | ||
7176 | ||
7177 | #define SIOCGIFNAME 0x8910 | |
7178 | #define SIOCSIFLINK 0x8911 | |
7179 | #define SIOCGIFCONF 0x8912 | |
7180 | #define SIOCGIFFLAGS 0x8913 | |
7181 | #define SIOCSIFFLAGS 0x8914 | |
7182 | #define SIOCGIFADDR 0x8915 | |
7183 | #define SIOCSIFADDR 0x8916 | |
7184 | #define SIOCGIFDSTADDR 0x8917 | |
7185 | #define SIOCSIFDSTADDR 0x8918 | |
7186 | #define SIOCGIFBRDADDR 0x8919 | |
7187 | #define SIOCSIFBRDADDR 0x891a | |
7188 | #define SIOCGIFNETMASK 0x891b | |
7189 | #define SIOCSIFNETMASK 0x891c | |
7190 | #define SIOCGIFMETRIC 0x891d | |
7191 | #define SIOCSIFMETRIC 0x891e | |
7192 | #define SIOCGIFMEM 0x891f | |
7193 | #define SIOCSIFMEM 0x8920 | |
7194 | #define SIOCGIFMTU 0x8921 | |
7195 | #define SIOCSIFMTU 0x8922 | |
7196 | #define SIOCSIFNAME 0x8923 | |
7197 | #define SIOCSIFHWADDR 0x8924 | |
7198 | #define SIOCGIFENCAP 0x8925 | |
7199 | #define SIOCSIFENCAP 0x8926 | |
7200 | #define SIOCGIFHWADDR 0x8927 | |
7201 | #define SIOCGIFSLAVE 0x8929 | |
7202 | #define SIOCSIFSLAVE 0x8930 | |
7203 | #define SIOCADDMULTI 0x8931 | |
7204 | #define SIOCDELMULTI 0x8932 | |
7205 | #define SIOCGIFINDEX 0x8933 | |
7206 | #define SIOGIFINDEX SIOCGIFINDEX | |
7207 | #define SIOCSIFPFLAGS 0x8934 | |
7208 | #define SIOCGIFPFLAGS 0x8935 | |
7209 | #define SIOCDIFADDR 0x8936 | |
7210 | #define SIOCSIFHWBROADCAST 0x8937 | |
7211 | #define SIOCGIFCOUNT 0x8938 | |
7212 | ||
7213 | #define SIOCGIFBR 0x8940 | |
7214 | #define SIOCSIFBR 0x8941 | |
7215 | ||
7216 | #define SIOCGIFTXQLEN 0x8942 | |
7217 | #define SIOCSIFTXQLEN 0x8943 | |
7218 | ||
7219 | ||
7220 | ||
7221 | ||
7222 | #define SIOCDARP 0x8953 | |
7223 | #define SIOCGARP 0x8954 | |
7224 | #define SIOCSARP 0x8955 | |
7225 | ||
7226 | ||
7227 | #define SIOCDRARP 0x8960 | |
7228 | #define SIOCGRARP 0x8961 | |
7229 | #define SIOCSRARP 0x8962 | |
7230 | ||
7231 | ||
7232 | ||
7233 | #define SIOCGIFMAP 0x8970 | |
7234 | #define SIOCSIFMAP 0x8971 | |
7235 | ||
7236 | ||
7237 | ||
7238 | #define SIOCADDDLCI 0x8980 | |
7239 | #define SIOCDELDLCI 0x8981 | |
7240 | # 103 "/usr/include/bits/ioctls.h" 3 4 | |
7241 | #define SIOCDEVPRIVATE 0x89F0 | |
7242 | ||
7243 | ||
7244 | ||
7245 | ||
7246 | ||
7247 | #define SIOCPROTOPRIVATE 0x89E0 | |
7248 | # 28 "/usr/include/sys/ioctl.h" 2 3 4 | |
7249 | ||
7250 | ||
7251 | # 1 "/usr/include/bits/ioctl-types.h" 1 3 4 | |
7252 | # 28 "/usr/include/bits/ioctl-types.h" 3 4 | |
7253 | struct winsize | |
7254 | { | |
7255 | unsigned short int ws_row; | |
7256 | unsigned short int ws_col; | |
7257 | unsigned short int ws_xpixel; | |
7258 | unsigned short int ws_ypixel; | |
7259 | }; | |
7260 | ||
7261 | #define NCC 8 | |
7262 | struct termio | |
7263 | { | |
7264 | unsigned short int c_iflag; | |
7265 | unsigned short int c_oflag; | |
7266 | unsigned short int c_cflag; | |
7267 | unsigned short int c_lflag; | |
7268 | unsigned char c_line; | |
7269 | unsigned char c_cc[8]; | |
7270 | }; | |
7271 | ||
7272 | ||
7273 | #define TIOCM_LE 0x001 | |
7274 | #define TIOCM_DTR 0x002 | |
7275 | #define TIOCM_RTS 0x004 | |
7276 | #define TIOCM_ST 0x008 | |
7277 | #define TIOCM_SR 0x010 | |
7278 | #define TIOCM_CTS 0x020 | |
7279 | #define TIOCM_CAR 0x040 | |
7280 | #define TIOCM_RNG 0x080 | |
7281 | #define TIOCM_DSR 0x100 | |
7282 | #define TIOCM_CD TIOCM_CAR | |
7283 | #define TIOCM_RI TIOCM_RNG | |
7284 | ||
7285 | ||
7286 | ||
7287 | ||
7288 | #define N_TTY 0 | |
7289 | #define N_SLIP 1 | |
7290 | #define N_MOUSE 2 | |
7291 | #define N_PPP 3 | |
7292 | #define N_STRIP 4 | |
7293 | #define N_AX25 5 | |
7294 | #define N_X25 6 | |
7295 | #define N_6PACK 7 | |
7296 | #define N_MASC 8 | |
7297 | #define N_R3964 9 | |
7298 | #define N_PROFIBUS_FDL 10 | |
7299 | #define N_IRDA 11 | |
7300 | #define N_SMSBLOCK 12 | |
7301 | #define N_HDLC 13 | |
7302 | #define N_SYNC_PPP 14 | |
7303 | #define N_HCI 15 | |
7304 | # 31 "/usr/include/sys/ioctl.h" 2 3 4 | |
7305 | ||
7306 | ||
7307 | ||
7308 | ||
7309 | ||
7310 | ||
7311 | # 1 "/usr/include/sys/ttydefaults.h" 1 3 4 | |
7312 | # 41 "/usr/include/sys/ttydefaults.h" 3 4 | |
7313 | #define _SYS_TTYDEFAULTS_H_ | |
7314 | ||
7315 | ||
7316 | ||
7317 | ||
7318 | #define TTYDEF_IFLAG (BRKINT | ISTRIP | ICRNL | IMAXBEL | IXON | IXANY) | |
7319 | #define TTYDEF_OFLAG (OPOST | ONLCR | XTABS) | |
7320 | #define TTYDEF_LFLAG (ECHO | ICANON | ISIG | IEXTEN | ECHOE|ECHOKE|ECHOCTL) | |
7321 | #define TTYDEF_CFLAG (CREAD | CS7 | PARENB | HUPCL) | |
7322 | #define TTYDEF_SPEED (B9600) | |
7323 | ||
7324 | ||
7325 | ||
7326 | ||
7327 | #define CTRL(x) (x&037) | |
7328 | #define CEOF CTRL('d') | |
7329 | ||
7330 | #define CEOL _POSIX_VDISABLE | |
7331 | ||
7332 | ||
7333 | ||
7334 | #define CERASE 0177 | |
7335 | #define CINTR CTRL('c') | |
7336 | ||
7337 | #define CSTATUS _POSIX_VDISABLE | |
7338 | ||
7339 | ||
7340 | ||
7341 | #define CKILL CTRL('u') | |
7342 | #define CMIN 1 | |
7343 | #define CQUIT 034 | |
7344 | #define CSUSP CTRL('z') | |
7345 | #define CTIME 0 | |
7346 | #define CDSUSP CTRL('y') | |
7347 | #define CSTART CTRL('q') | |
7348 | #define CSTOP CTRL('s') | |
7349 | #define CLNEXT CTRL('v') | |
7350 | #define CDISCARD CTRL('o') | |
7351 | #define CWERASE CTRL('w') | |
7352 | #define CREPRINT CTRL('r') | |
7353 | #define CEOT CEOF | |
7354 | ||
7355 | #define CBRK CEOL | |
7356 | #define CRPRNT CREPRINT | |
7357 | #define CFLUSH CDISCARD | |
7358 | # 38 "/usr/include/sys/ioctl.h" 2 3 4 | |
7359 | ||
7360 | ||
7361 | ||
7362 | ||
7363 | extern int ioctl (int __fd, unsigned long int __request, ...) __attribute__ ((__nothrow__)); | |
7364 | ||
7365 | ||
7366 | # 38 "unix.c" 2 | |
7367 | ||
7368 | ||
7369 | # 1 "/usr/include/malloc.h" 1 3 4 | |
7370 | # 21 "/usr/include/malloc.h" 3 4 | |
7371 | #define _MALLOC_H 1 | |
7372 | ||
7373 | ||
7374 | # 1 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/stddef.h" 1 3 4 | |
7375 | # 43 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/stddef.h" 3 4 | |
7376 | #define _STDDEF_H | |
7377 | #define _STDDEF_H_ | |
7378 | ||
7379 | #define _ANSI_STDDEF_H | |
7380 | ||
7381 | #define __STDDEF_H__ | |
7382 | # 141 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/stddef.h" 3 4 | |
7383 | #define _PTRDIFF_T | |
7384 | #define _T_PTRDIFF_ | |
7385 | #define _T_PTRDIFF | |
7386 | #define __PTRDIFF_T | |
7387 | #define _PTRDIFF_T_ | |
7388 | #define _BSD_PTRDIFF_T_ | |
7389 | #define ___int_ptrdiff_t_h | |
7390 | #define _GCC_PTRDIFF_T | |
7391 | ||
7392 | ||
7393 | ||
7394 | typedef int ptrdiff_t; | |
7395 | # 163 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/stddef.h" 3 4 | |
7396 | #undef __need_ptrdiff_t | |
7397 | # 236 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/stddef.h" 3 4 | |
7398 | #undef __need_size_t | |
7399 | # 345 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/stddef.h" 3 4 | |
7400 | #undef __need_wchar_t | |
7401 | # 398 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/stddef.h" 3 4 | |
7402 | #undef NULL | |
7403 | ||
7404 | ||
7405 | ||
7406 | ||
7407 | #define NULL ((void *)0) | |
7408 | ||
7409 | ||
7410 | ||
7411 | ||
7412 | ||
7413 | #undef __need_NULL | |
7414 | ||
7415 | ||
7416 | ||
7417 | ||
7418 | #define offsetof(TYPE,MEMBER) __builtin_offsetof (TYPE, MEMBER) | |
7419 | # 25 "/usr/include/malloc.h" 2 3 4 | |
7420 | #define __malloc_ptr_t void * | |
7421 | ||
7422 | ||
7423 | #define __malloc_size_t size_t | |
7424 | #define __malloc_ptrdiff_t ptrdiff_t | |
7425 | ||
7426 | ||
7427 | ||
7428 | #define __MALLOC_P(args) args __THROW | |
7429 | ||
7430 | ||
7431 | #define __MALLOC_PMT(args) args | |
7432 | # 46 "/usr/include/malloc.h" 3 4 | |
7433 | ||
7434 | ||
7435 | ||
7436 | extern void *malloc (size_t __size) __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) ; | |
7437 | ||
7438 | ||
7439 | extern void *calloc (size_t __nmemb, size_t __size) __attribute__ ((__nothrow__)) | |
7440 | __attribute__ ((__malloc__)) ; | |
7441 | ||
7442 | ||
7443 | ||
7444 | extern void *realloc (void *__ptr, size_t __size) __attribute__ ((__nothrow__)) | |
7445 | __attribute__ ((__malloc__)) __attribute__ ((__warn_unused_result__)); | |
7446 | ||
7447 | ||
7448 | extern void free (void *__ptr) __attribute__ ((__nothrow__)); | |
7449 | ||
7450 | ||
7451 | extern void cfree (void *__ptr) __attribute__ ((__nothrow__)); | |
7452 | ||
7453 | ||
7454 | extern void *memalign (size_t __alignment, size_t __size) __attribute__ ((__nothrow__)) | |
7455 | __attribute__ ((__malloc__)) ; | |
7456 | ||
7457 | ||
7458 | extern void *valloc (size_t __size) __attribute__ ((__nothrow__)) | |
7459 | __attribute__ ((__malloc__)) ; | |
7460 | ||
7461 | ||
7462 | ||
7463 | extern void * pvalloc (size_t __size) __attribute__ ((__nothrow__)) | |
7464 | __attribute__ ((__malloc__)) ; | |
7465 | ||
7466 | ||
7467 | ||
7468 | extern void *(*__morecore) (ptrdiff_t __size); | |
7469 | ||
7470 | ||
7471 | extern void *__default_morecore (ptrdiff_t __size) __attribute__ ((__nothrow__)) | |
7472 | __attribute__ ((__malloc__)); | |
7473 | ||
7474 | ||
7475 | ||
7476 | struct mallinfo { | |
7477 | int arena; | |
7478 | int ordblks; | |
7479 | int smblks; | |
7480 | int hblks; | |
7481 | int hblkhd; | |
7482 | int usmblks; | |
7483 | int fsmblks; | |
7484 | int uordblks; | |
7485 | int fordblks; | |
7486 | int keepcost; | |
7487 | }; | |
7488 | ||
7489 | ||
7490 | extern struct mallinfo mallinfo (void) __attribute__ ((__nothrow__)); | |
7491 | ||
7492 | ||
7493 | ||
7494 | #define M_MXFAST 1 | |
7495 | ||
7496 | ||
7497 | #define M_NLBLKS 2 | |
7498 | ||
7499 | ||
7500 | #define M_GRAIN 3 | |
7501 | ||
7502 | ||
7503 | #define M_KEEP 4 | |
7504 | ||
7505 | ||
7506 | ||
7507 | #define M_TRIM_THRESHOLD -1 | |
7508 | #define M_TOP_PAD -2 | |
7509 | #define M_MMAP_THRESHOLD -3 | |
7510 | #define M_MMAP_MAX -4 | |
7511 | #define M_CHECK_ACTION -5 | |
7512 | #define M_PERTURB -6 | |
7513 | ||
7514 | ||
7515 | extern int mallopt (int __param, int __val) __attribute__ ((__nothrow__)); | |
7516 | ||
7517 | ||
7518 | ||
7519 | extern int malloc_trim (size_t __pad) __attribute__ ((__nothrow__)); | |
7520 | ||
7521 | ||
7522 | ||
7523 | extern size_t malloc_usable_size (void *__ptr) __attribute__ ((__nothrow__)); | |
7524 | ||
7525 | ||
7526 | extern void malloc_stats (void) __attribute__ ((__nothrow__)); | |
7527 | ||
7528 | ||
7529 | extern void *malloc_get_state (void) __attribute__ ((__nothrow__)); | |
7530 | ||
7531 | ||
7532 | ||
7533 | extern int malloc_set_state (void *__ptr) __attribute__ ((__nothrow__)); | |
7534 | ||
7535 | ||
7536 | ||
7537 | ||
7538 | extern void (*__malloc_initialize_hook) (void); | |
7539 | ||
7540 | extern void (*__free_hook) (void *__ptr, __const void *); | |
7541 | ||
7542 | extern void *(*__malloc_hook) (size_t __size, __const void *); | |
7543 | ||
7544 | extern void *(*__realloc_hook) (void *__ptr, size_t __size, __const void *); | |
7545 | ||
7546 | extern void *(*__memalign_hook) (size_t __alignment, size_t __size, __const void *); | |
7547 | ||
7548 | ||
7549 | extern void (*__after_morecore_hook) (void); | |
7550 | ||
7551 | ||
7552 | extern void __malloc_check_init (void) __attribute__ ((__nothrow__)); | |
7553 | ||
7554 | ||
7555 | ||
7556 | # 41 "unix.c" 2 | |
7557 | ||
7558 | ||
7559 | ||
7560 | ||
7561 | ||
7562 | # 1 "/usr/include/dirent.h" 1 3 4 | |
7563 | # 24 "/usr/include/dirent.h" 3 4 | |
7564 | #define _DIRENT_H 1 | |
7565 | ||
7566 | ||
7567 | ||
7568 | ||
7569 | # 62 "/usr/include/dirent.h" 3 4 | |
7570 | # 1 "/usr/include/bits/dirent.h" 1 3 4 | |
7571 | # 23 "/usr/include/bits/dirent.h" 3 4 | |
7572 | struct dirent | |
7573 | { | |
7574 | ||
7575 | __ino_t d_ino; | |
7576 | __off_t d_off; | |
7577 | ||
7578 | ||
7579 | ||
7580 | ||
7581 | unsigned short int d_reclen; | |
7582 | unsigned char d_type; | |
7583 | char d_name[256]; | |
7584 | }; | |
7585 | # 48 "/usr/include/bits/dirent.h" 3 4 | |
7586 | #define d_fileno d_ino | |
7587 | ||
7588 | #undef _DIRENT_HAVE_D_NAMLEN | |
7589 | #define _DIRENT_HAVE_D_RECLEN | |
7590 | #define _DIRENT_HAVE_D_OFF | |
7591 | #define _DIRENT_HAVE_D_TYPE | |
7592 | # 63 "/usr/include/dirent.h" 2 3 4 | |
7593 | # 86 "/usr/include/dirent.h" 3 4 | |
7594 | #define _D_EXACT_NAMLEN(d) (strlen ((d)->d_name)) | |
7595 | ||
7596 | #define _D_ALLOC_NAMLEN(d) (((char *) (d) + (d)->d_reclen) - &(d)->d_name[0]) | |
7597 | # 98 "/usr/include/dirent.h" 3 4 | |
7598 | enum | |
7599 | { | |
7600 | DT_UNKNOWN = 0, | |
7601 | #define DT_UNKNOWN DT_UNKNOWN | |
7602 | DT_FIFO = 1, | |
7603 | #define DT_FIFO DT_FIFO | |
7604 | DT_CHR = 2, | |
7605 | #define DT_CHR DT_CHR | |
7606 | DT_DIR = 4, | |
7607 | #define DT_DIR DT_DIR | |
7608 | DT_BLK = 6, | |
7609 | #define DT_BLK DT_BLK | |
7610 | DT_REG = 8, | |
7611 | #define DT_REG DT_REG | |
7612 | DT_LNK = 10, | |
7613 | #define DT_LNK DT_LNK | |
7614 | DT_SOCK = 12, | |
7615 | #define DT_SOCK DT_SOCK | |
7616 | DT_WHT = 14 | |
7617 | #define DT_WHT DT_WHT | |
7618 | }; | |
7619 | ||
7620 | ||
7621 | #define IFTODT(mode) (((mode) & 0170000) >> 12) | |
7622 | #define DTTOIF(dirtype) ((dirtype) << 12) | |
7623 | ||
7624 | ||
7625 | ||
7626 | ||
7627 | ||
7628 | typedef struct __dirstream DIR; | |
7629 | ||
7630 | ||
7631 | ||
7632 | ||
7633 | ||
7634 | ||
7635 | extern DIR *opendir (__const char *__name) __attribute__ ((__nonnull__ (1))); | |
7636 | # 150 "/usr/include/dirent.h" 3 4 | |
7637 | extern int closedir (DIR *__dirp) __attribute__ ((__nonnull__ (1))); | |
7638 | # 163 "/usr/include/dirent.h" 3 4 | |
7639 | extern struct dirent *readdir (DIR *__dirp) __attribute__ ((__nonnull__ (1))); | |
7640 | # 184 "/usr/include/dirent.h" 3 4 | |
7641 | extern int readdir_r (DIR *__restrict __dirp, | |
7642 | struct dirent *__restrict __entry, | |
7643 | struct dirent **__restrict __result) | |
7644 | __attribute__ ((__nonnull__ (1, 2, 3))); | |
7645 | # 209 "/usr/include/dirent.h" 3 4 | |
7646 | extern void rewinddir (DIR *__dirp) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
7647 | ||
7648 | ||
7649 | ||
7650 | ||
7651 | ||
7652 | extern void seekdir (DIR *__dirp, long int __pos) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
7653 | ||
7654 | ||
7655 | extern long int telldir (DIR *__dirp) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
7656 | ||
7657 | ||
7658 | ||
7659 | ||
7660 | ||
7661 | extern int dirfd (DIR *__dirp) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
7662 | ||
7663 | ||
7664 | ||
7665 | ||
7666 | ||
7667 | ||
7668 | ||
7669 | # 1 "/usr/include/bits/posix1_lim.h" 1 3 4 | |
7670 | # 26 "/usr/include/bits/posix1_lim.h" 3 4 | |
7671 | #define _BITS_POSIX1_LIM_H 1 | |
7672 | ||
7673 | ||
7674 | ||
7675 | ||
7676 | ||
7677 | #define _POSIX_AIO_LISTIO_MAX 2 | |
7678 | ||
7679 | ||
7680 | #define _POSIX_AIO_MAX 1 | |
7681 | ||
7682 | ||
7683 | #define _POSIX_ARG_MAX 4096 | |
7684 | ||
7685 | ||
7686 | ||
7687 | #define _POSIX_CHILD_MAX 25 | |
7688 | ||
7689 | ||
7690 | ||
7691 | ||
7692 | ||
7693 | #define _POSIX_DELAYTIMER_MAX 32 | |
7694 | ||
7695 | ||
7696 | ||
7697 | #define _POSIX_HOST_NAME_MAX 255 | |
7698 | ||
7699 | ||
7700 | #define _POSIX_LINK_MAX 8 | |
7701 | ||
7702 | ||
7703 | #define _POSIX_LOGIN_NAME_MAX 9 | |
7704 | ||
7705 | ||
7706 | #define _POSIX_MAX_CANON 255 | |
7707 | ||
7708 | ||
7709 | ||
7710 | #define _POSIX_MAX_INPUT 255 | |
7711 | ||
7712 | ||
7713 | #define _POSIX_MQ_OPEN_MAX 8 | |
7714 | ||
7715 | ||
7716 | #define _POSIX_MQ_PRIO_MAX 32 | |
7717 | ||
7718 | ||
7719 | #define _POSIX_NAME_MAX 14 | |
7720 | ||
7721 | ||
7722 | ||
7723 | #define _POSIX_NGROUPS_MAX 8 | |
7724 | ||
7725 | ||
7726 | ||
7727 | ||
7728 | ||
7729 | ||
7730 | #define _POSIX_OPEN_MAX 20 | |
7731 | ||
7732 | ||
7733 | ||
7734 | ||
7735 | ||
7736 | ||
7737 | #define _POSIX_FD_SETSIZE _POSIX_OPEN_MAX | |
7738 | ||
7739 | ||
7740 | #define _POSIX_PATH_MAX 256 | |
7741 | ||
7742 | ||
7743 | #define _POSIX_PIPE_BUF 512 | |
7744 | ||
7745 | ||
7746 | ||
7747 | #define _POSIX_RE_DUP_MAX 255 | |
7748 | ||
7749 | ||
7750 | #define _POSIX_RTSIG_MAX 8 | |
7751 | ||
7752 | ||
7753 | #define _POSIX_SEM_NSEMS_MAX 256 | |
7754 | ||
7755 | ||
7756 | #define _POSIX_SEM_VALUE_MAX 32767 | |
7757 | ||
7758 | ||
7759 | #define _POSIX_SIGQUEUE_MAX 32 | |
7760 | ||
7761 | ||
7762 | #define _POSIX_SSIZE_MAX 32767 | |
7763 | ||
7764 | ||
7765 | #define _POSIX_STREAM_MAX 8 | |
7766 | ||
7767 | ||
7768 | #define _POSIX_SYMLINK_MAX 255 | |
7769 | ||
7770 | ||
7771 | ||
7772 | #define _POSIX_SYMLOOP_MAX 8 | |
7773 | ||
7774 | ||
7775 | #define _POSIX_TIMER_MAX 32 | |
7776 | ||
7777 | ||
7778 | #define _POSIX_TTY_NAME_MAX 9 | |
7779 | ||
7780 | ||
7781 | #define _POSIX_TZNAME_MAX 6 | |
7782 | ||
7783 | ||
7784 | #define _POSIX_QLIMIT 1 | |
7785 | ||
7786 | ||
7787 | ||
7788 | #define _POSIX_HIWAT _POSIX_PIPE_BUF | |
7789 | ||
7790 | ||
7791 | #define _POSIX_UIO_MAXIOV 16 | |
7792 | ||
7793 | ||
7794 | #define _POSIX_CLOCKRES_MIN 20000000 | |
7795 | ||
7796 | ||
7797 | ||
7798 | # 1 "/usr/include/bits/local_lim.h" 1 3 4 | |
7799 | # 26 "/usr/include/bits/local_lim.h" 3 4 | |
7800 | #define __undef_NR_OPEN | |
7801 | ||
7802 | ||
7803 | #define __undef_LINK_MAX | |
7804 | ||
7805 | ||
7806 | #define __undef_OPEN_MAX | |
7807 | ||
7808 | ||
7809 | ||
7810 | # 1 "/usr/include/linux/limits.h" 1 3 4 | |
7811 | ||
7812 | #define _LINUX_LIMITS_H | |
7813 | ||
7814 | #define NR_OPEN 1024 | |
7815 | ||
7816 | #define NGROUPS_MAX 65536 | |
7817 | #define ARG_MAX 131072 | |
7818 | #define LINK_MAX 127 | |
7819 | #define MAX_CANON 255 | |
7820 | #define MAX_INPUT 255 | |
7821 | #define NAME_MAX 255 | |
7822 | #define PATH_MAX 4096 | |
7823 | #define PIPE_BUF 4096 | |
7824 | #define XATTR_NAME_MAX 255 | |
7825 | #define XATTR_SIZE_MAX 65536 | |
7826 | #define XATTR_LIST_MAX 65536 | |
7827 | ||
7828 | #define RTSIG_MAX 32 | |
7829 | # 37 "/usr/include/bits/local_lim.h" 2 3 4 | |
7830 | ||
7831 | ||
7832 | ||
7833 | #undef NR_OPEN | |
7834 | #undef __undef_NR_OPEN | |
7835 | ||
7836 | ||
7837 | ||
7838 | #undef LINK_MAX | |
7839 | #undef __undef_LINK_MAX | |
7840 | ||
7841 | ||
7842 | ||
7843 | #undef OPEN_MAX | |
7844 | #undef __undef_OPEN_MAX | |
7845 | ||
7846 | ||
7847 | ||
7848 | #define _POSIX_THREAD_KEYS_MAX 128 | |
7849 | ||
7850 | #define PTHREAD_KEYS_MAX 1024 | |
7851 | ||
7852 | ||
7853 | #define _POSIX_THREAD_DESTRUCTOR_ITERATIONS 4 | |
7854 | ||
7855 | #define PTHREAD_DESTRUCTOR_ITERATIONS _POSIX_THREAD_DESTRUCTOR_ITERATIONS | |
7856 | ||
7857 | ||
7858 | #define _POSIX_THREAD_THREADS_MAX 64 | |
7859 | ||
7860 | #undef PTHREAD_THREADS_MAX | |
7861 | ||
7862 | ||
7863 | ||
7864 | #define AIO_PRIO_DELTA_MAX 20 | |
7865 | ||
7866 | ||
7867 | #define PTHREAD_STACK_MIN 16384 | |
7868 | ||
7869 | ||
7870 | #define DELAYTIMER_MAX 2147483647 | |
7871 | ||
7872 | ||
7873 | #define TTY_NAME_MAX 32 | |
7874 | ||
7875 | ||
7876 | #define LOGIN_NAME_MAX 256 | |
7877 | ||
7878 | ||
7879 | #define HOST_NAME_MAX 64 | |
7880 | ||
7881 | ||
7882 | #define MQ_PRIO_MAX 32768 | |
7883 | ||
7884 | ||
7885 | #define SEM_VALUE_MAX (2147483647) | |
7886 | # 154 "/usr/include/bits/posix1_lim.h" 2 3 4 | |
7887 | ||
7888 | ||
7889 | ||
7890 | #define SSIZE_MAX LONG_MAX | |
7891 | # 233 "/usr/include/dirent.h" 2 3 4 | |
7892 | ||
7893 | ||
7894 | ||
7895 | #define MAXNAMLEN NAME_MAX | |
7896 | ||
7897 | ||
7898 | ||
7899 | ||
7900 | ||
7901 | #define __need_size_t | |
7902 | # 1 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/stddef.h" 1 3 4 | |
7903 | # 163 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/stddef.h" 3 4 | |
7904 | #undef __need_ptrdiff_t | |
7905 | # 236 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/stddef.h" 3 4 | |
7906 | #undef __need_size_t | |
7907 | # 345 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/stddef.h" 3 4 | |
7908 | #undef __need_wchar_t | |
7909 | # 398 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/stddef.h" 3 4 | |
7910 | #undef NULL | |
7911 | ||
7912 | ||
7913 | ||
7914 | ||
7915 | #define NULL ((void *)0) | |
7916 | ||
7917 | ||
7918 | ||
7919 | ||
7920 | ||
7921 | #undef __need_NULL | |
7922 | ||
7923 | ||
7924 | ||
7925 | ||
7926 | #define offsetof(TYPE,MEMBER) __builtin_offsetof (TYPE, MEMBER) | |
7927 | # 244 "/usr/include/dirent.h" 2 3 4 | |
7928 | ||
7929 | ||
7930 | ||
7931 | ||
7932 | ||
7933 | ||
7934 | extern int scandir (__const char *__restrict __dir, | |
7935 | struct dirent ***__restrict __namelist, | |
7936 | int (*__selector) (__const struct dirent *), | |
7937 | int (*__cmp) (__const void *, __const void *)) | |
7938 | __attribute__ ((__nonnull__ (1, 2))); | |
7939 | # 280 "/usr/include/dirent.h" 3 4 | |
7940 | extern int alphasort (__const void *__e1, __const void *__e2) | |
7941 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); | |
7942 | # 324 "/usr/include/dirent.h" 3 4 | |
7943 | extern __ssize_t getdirentries (int __fd, char *__restrict __buf, | |
7944 | size_t __nbytes, | |
7945 | __off_t *__restrict __basep) | |
7946 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 4))); | |
7947 | # 349 "/usr/include/dirent.h" 3 4 | |
7948 | ||
7949 | # 47 "unix.c" 2 | |
7950 | ||
7951 | ||
7952 | # 1 "../lib/et/com_err.h" 1 | |
7953 | # 14 "../lib/et/com_err.h" | |
7954 | #define COM_ERR_ATTR(x) __attribute__(x) | |
7955 | ||
7956 | ||
7957 | ||
7958 | ||
7959 | # 1 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/stdarg.h" 1 3 4 | |
7960 | # 34 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/stdarg.h" 3 4 | |
7961 | #define _STDARG_H | |
7962 | #define _ANSI_STDARG_H_ | |
7963 | ||
7964 | #undef __need___va_list | |
7965 | # 50 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/stdarg.h" 3 4 | |
7966 | #define va_start(v,l) __builtin_va_start(v,l) | |
7967 | #define va_end(v) __builtin_va_end(v) | |
7968 | #define va_arg(v,l) __builtin_va_arg(v,l) | |
7969 | ||
7970 | #define va_copy(d,s) __builtin_va_copy(d,s) | |
7971 | ||
7972 | #define __va_copy(d,s) __builtin_va_copy(d,s) | |
7973 | # 105 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/stdarg.h" 3 4 | |
7974 | typedef __gnuc_va_list va_list; | |
7975 | ||
7976 | ||
7977 | ||
7978 | ||
7979 | ||
7980 | #define _VA_LIST_ | |
7981 | ||
7982 | ||
7983 | #define _VA_LIST | |
7984 | ||
7985 | ||
7986 | #define _VA_LIST_DEFINED | |
7987 | ||
7988 | ||
7989 | #define _VA_LIST_T_H | |
7990 | ||
7991 | ||
7992 | #define __va_list__ | |
7993 | # 20 "../lib/et/com_err.h" 2 | |
7994 | ||
7995 | typedef long errcode_t; | |
7996 | ||
7997 | struct error_table { | |
7998 | char const * const * msgs; | |
7999 | long base; | |
8000 | int n_msgs; | |
8001 | }; | |
8002 | struct et_list; | |
8003 | ||
8004 | extern void com_err (const char *, long, const char *, ...) | |
8005 | __attribute__((format(printf, 3, 4))); | |
8006 | ||
8007 | extern void com_err_va (const char *whoami, errcode_t code, const char *fmt, | |
8008 | va_list args) | |
8009 | __attribute__((format(printf, 3, 0))); | |
8010 | ||
8011 | extern char const *error_message (long); | |
8012 | extern void (*com_err_hook) (const char *, long, const char *, va_list); | |
8013 | extern void (*set_com_err_hook (void (*) (const char *, long, | |
8014 | const char *, va_list))) | |
8015 | (const char *, long, const char *, va_list); | |
8016 | extern void (*reset_com_err_hook (void)) (const char *, long, | |
8017 | const char *, va_list); | |
8018 | extern int init_error_table(const char * const *msgs, long base, int count); | |
8019 | ||
8020 | extern errcode_t add_error_table(const struct error_table * et); | |
8021 | extern errcode_t remove_error_table(const struct error_table * et); | |
8022 | extern void add_to_error_table(struct et_list *new_table); | |
8023 | ||
8024 | ||
8025 | extern const char *com_right(struct et_list *list, long code); | |
8026 | extern void initialize_error_table_r(struct et_list **list, | |
8027 | const char **messages, | |
8028 | int num_errors, | |
8029 | long base); | |
8030 | extern void free_error_table(struct et_list *et); | |
8031 | ||
8032 | #define __COM_ERR_H | |
8033 | #define __COM_ERR_H__ | |
8034 | # 50 "unix.c" 2 | |
8035 | # 1 "e2fsck.h" 1 | |
8036 | # 10 "e2fsck.h" | |
8037 | #define _E2FSCK_H | |
8038 | # 23 "e2fsck.h" | |
8039 | # 1 "/usr/include/sys/time.h" 1 3 4 | |
8040 | # 21 "/usr/include/sys/time.h" 3 4 | |
8041 | #define _SYS_TIME_H 1 | |
8042 | ||
8043 | ||
8044 | ||
8045 | ||
8046 | #define __need_time_t | |
8047 | ||
8048 | #define __need_timeval | |
8049 | # 1 "/usr/include/bits/time.h" 1 3 4 | |
8050 | # 62 "/usr/include/bits/time.h" 3 4 | |
8051 | #undef __need_timeval | |
8052 | # 30 "/usr/include/sys/time.h" 2 3 4 | |
8053 | # 39 "/usr/include/sys/time.h" 3 4 | |
8054 | ||
8055 | # 57 "/usr/include/sys/time.h" 3 4 | |
8056 | struct timezone | |
8057 | { | |
8058 | int tz_minuteswest; | |
8059 | int tz_dsttime; | |
8060 | }; | |
8061 | ||
8062 | typedef struct timezone *__restrict __timezone_ptr_t; | |
8063 | # 73 "/usr/include/sys/time.h" 3 4 | |
8064 | extern int gettimeofday (struct timeval *__restrict __tv, | |
8065 | __timezone_ptr_t __tz) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
8066 | ||
8067 | ||
8068 | ||
8069 | ||
8070 | extern int settimeofday (__const struct timeval *__tv, | |
8071 | __const struct timezone *__tz) | |
8072 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
8073 | ||
8074 | ||
8075 | ||
8076 | ||
8077 | ||
8078 | extern int adjtime (__const struct timeval *__delta, | |
8079 | struct timeval *__olddelta) __attribute__ ((__nothrow__)); | |
8080 | ||
8081 | ||
8082 | ||
8083 | ||
8084 | enum __itimer_which | |
8085 | { | |
8086 | ||
8087 | ITIMER_REAL = 0, | |
8088 | #define ITIMER_REAL ITIMER_REAL | |
8089 | ||
8090 | ITIMER_VIRTUAL = 1, | |
8091 | #define ITIMER_VIRTUAL ITIMER_VIRTUAL | |
8092 | ||
8093 | ||
8094 | ITIMER_PROF = 2 | |
8095 | #define ITIMER_PROF ITIMER_PROF | |
8096 | }; | |
8097 | ||
8098 | ||
8099 | ||
8100 | struct itimerval | |
8101 | { | |
8102 | ||
8103 | struct timeval it_interval; | |
8104 | ||
8105 | struct timeval it_value; | |
8106 | }; | |
8107 | ||
8108 | ||
8109 | ||
8110 | ||
8111 | ||
8112 | ||
8113 | typedef int __itimer_which_t; | |
8114 | ||
8115 | ||
8116 | ||
8117 | ||
8118 | extern int getitimer (__itimer_which_t __which, | |
8119 | struct itimerval *__value) __attribute__ ((__nothrow__)); | |
8120 | ||
8121 | ||
8122 | ||
8123 | ||
8124 | extern int setitimer (__itimer_which_t __which, | |
8125 | __const struct itimerval *__restrict __new, | |
8126 | struct itimerval *__restrict __old) __attribute__ ((__nothrow__)); | |
8127 | ||
8128 | ||
8129 | ||
8130 | ||
8131 | extern int utimes (__const char *__file, __const struct timeval __tvp[2]) | |
8132 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
8133 | ||
8134 | ||
8135 | ||
8136 | extern int lutimes (__const char *__file, __const struct timeval __tvp[2]) | |
8137 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
8138 | ||
8139 | ||
8140 | extern int futimes (int __fd, __const struct timeval __tvp[2]) __attribute__ ((__nothrow__)); | |
8141 | # 164 "/usr/include/sys/time.h" 3 4 | |
8142 | #define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec) | |
8143 | #define timerclear(tvp) ((tvp)->tv_sec = (tvp)->tv_usec = 0) | |
8144 | #define timercmp(a,b,CMP) (((a)->tv_sec == (b)->tv_sec) ? ((a)->tv_usec CMP (b)->tv_usec) : ((a)->tv_sec CMP (b)->tv_sec)) | |
8145 | ||
8146 | ||
8147 | ||
8148 | #define timeradd(a,b,result) do { (result)->tv_sec = (a)->tv_sec + (b)->tv_sec; (result)->tv_usec = (a)->tv_usec + (b)->tv_usec; if ((result)->tv_usec >= 1000000) { ++(result)->tv_sec; (result)->tv_usec -= 1000000; } } while (0) | |
8149 | # 180 "/usr/include/sys/time.h" 3 4 | |
8150 | #define timersub(a,b,result) do { (result)->tv_sec = (a)->tv_sec - (b)->tv_sec; (result)->tv_usec = (a)->tv_usec - (b)->tv_usec; if ((result)->tv_usec < 0) { --(result)->tv_sec; (result)->tv_usec += 1000000; } } while (0) | |
8151 | # 191 "/usr/include/sys/time.h" 3 4 | |
8152 | ||
8153 | # 24 "e2fsck.h" 2 | |
8154 | ||
8155 | ||
8156 | # 1 "/usr/include/setjmp.h" 1 3 4 | |
8157 | # 24 "/usr/include/setjmp.h" 3 4 | |
8158 | #define _SETJMP_H 1 | |
8159 | ||
8160 | ||
8161 | ||
8162 | ||
8163 | ||
8164 | # 1 "/usr/include/bits/setjmp.h" 1 3 4 | |
8165 | # 22 "/usr/include/bits/setjmp.h" 3 4 | |
8166 | #define _BITS_SETJMP_H 1 | |
8167 | ||
8168 | ||
8169 | ||
8170 | ||
8171 | ||
8172 | ||
8173 | typedef int __jmp_buf[6]; | |
8174 | # 31 "/usr/include/setjmp.h" 2 3 4 | |
8175 | # 1 "/usr/include/bits/sigset.h" 1 3 4 | |
8176 | # 32 "/usr/include/setjmp.h" 2 3 4 | |
8177 | ||
8178 | ||
8179 | ||
8180 | struct __jmp_buf_tag | |
8181 | { | |
8182 | ||
8183 | ||
8184 | ||
8185 | ||
8186 | __jmp_buf __jmpbuf; | |
8187 | int __mask_was_saved; | |
8188 | __sigset_t __saved_mask; | |
8189 | }; | |
8190 | ||
8191 | ||
8192 | ||
8193 | ||
8194 | typedef struct __jmp_buf_tag jmp_buf[1]; | |
8195 | ||
8196 | ||
8197 | ||
8198 | extern int setjmp (jmp_buf __env) __attribute__ ((__nothrow__)); | |
8199 | ||
8200 | ||
8201 | ||
8202 | ||
8203 | ||
8204 | ||
8205 | extern int __sigsetjmp (struct __jmp_buf_tag __env[1], int __savemask) __attribute__ ((__nothrow__)); | |
8206 | ||
8207 | ||
8208 | ||
8209 | ||
8210 | extern int _setjmp (struct __jmp_buf_tag __env[1]) __attribute__ ((__nothrow__)); | |
8211 | ||
8212 | ||
8213 | ||
8214 | #define setjmp(env) _setjmp (env) | |
8215 | # 78 "/usr/include/setjmp.h" 3 4 | |
8216 | ||
8217 | ||
8218 | ||
8219 | ||
8220 | extern void longjmp (struct __jmp_buf_tag __env[1], int __val) | |
8221 | __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__)); | |
8222 | ||
8223 | ||
8224 | ||
8225 | ||
8226 | ||
8227 | ||
8228 | ||
8229 | extern void _longjmp (struct __jmp_buf_tag __env[1], int __val) | |
8230 | __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__)); | |
8231 | ||
8232 | ||
8233 | ||
8234 | ||
8235 | ||
8236 | ||
8237 | ||
8238 | typedef struct __jmp_buf_tag sigjmp_buf[1]; | |
8239 | ||
8240 | ||
8241 | ||
8242 | #define sigsetjmp(env,savemask) __sigsetjmp (env, savemask) | |
8243 | ||
8244 | ||
8245 | ||
8246 | ||
8247 | ||
8248 | extern void siglongjmp (sigjmp_buf __env, int __val) | |
8249 | __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__)); | |
8250 | ||
8251 | ||
8252 | ||
8253 | # 27 "e2fsck.h" 2 | |
8254 | ||
8255 | ||
8256 | ||
8257 | ||
8258 | ||
8259 | ||
8260 | ||
8261 | # 1 "../lib/ext2fs/ext2_fs.h" 1 | |
8262 | # 17 "../lib/ext2fs/ext2_fs.h" | |
8263 | #define _LINUX_EXT2_FS_H | |
8264 | ||
8265 | # 1 "../lib/ext2fs/ext2_types.h" 1 | |
8266 | ||
8267 | ||
8268 | ||
8269 | ||
8270 | ||
8271 | ||
8272 | ||
8273 | #define _EXT2_TYPES_H | |
8274 | ||
8275 | #define __S8_TYPEDEF __signed__ char | |
8276 | #define __U8_TYPEDEF unsigned char | |
8277 | #define __S16_TYPEDEF __signed__ short | |
8278 | #define __U16_TYPEDEF unsigned short | |
8279 | #define __S32_TYPEDEF __signed__ int | |
8280 | #define __U32_TYPEDEF unsigned int | |
8281 | #define __S64_TYPEDEF __signed__ long long | |
8282 | #define __U64_TYPEDEF unsigned long long | |
8283 | ||
8284 | ||
8285 | typedef unsigned char __u8; | |
8286 | ||
8287 | ||
8288 | ||
8289 | ||
8290 | ||
8291 | typedef __signed__ char __s8; | |
8292 | ||
8293 | ||
8294 | ||
8295 | ||
8296 | ||
8297 | typedef unsigned short __u16; | |
8298 | # 46 "../lib/ext2fs/ext2_types.h" | |
8299 | typedef __signed__ short __s16; | |
8300 | # 61 "../lib/ext2fs/ext2_types.h" | |
8301 | typedef unsigned int __u32; | |
8302 | # 79 "../lib/ext2fs/ext2_types.h" | |
8303 | typedef __signed__ int __s32; | |
8304 | # 97 "../lib/ext2fs/ext2_types.h" | |
8305 | typedef unsigned long long __u64; | |
8306 | # 113 "../lib/ext2fs/ext2_types.h" | |
8307 | typedef __signed__ long long __s64; | |
8308 | # 132 "../lib/ext2fs/ext2_types.h" | |
8309 | #undef __S8_TYPEDEF | |
8310 | #undef __U8_TYPEDEF | |
8311 | #undef __S16_TYPEDEF | |
8312 | #undef __U16_TYPEDEF | |
8313 | #undef __S32_TYPEDEF | |
8314 | #undef __U32_TYPEDEF | |
8315 | #undef __S64_TYPEDEF | |
8316 | #undef __U64_TYPEDEF | |
8317 | # 20 "../lib/ext2fs/ext2_fs.h" 2 | |
8318 | # 28 "../lib/ext2fs/ext2_fs.h" | |
8319 | #undef EXT2FS_DEBUG | |
8320 | ||
8321 | ||
8322 | ||
8323 | ||
8324 | #define EXT2_PREALLOCATE | |
8325 | #define EXT2_DEFAULT_PREALLOC_BLOCKS 8 | |
8326 | ||
8327 | ||
8328 | ||
8329 | ||
8330 | #define EXT2FS_DATE "95/08/09" | |
8331 | #define EXT2FS_VERSION "0.5b" | |
8332 | ||
8333 | ||
8334 | ||
8335 | ||
8336 | #define EXT2_BAD_INO 1 | |
8337 | #define EXT2_ROOT_INO 2 | |
8338 | #define EXT2_ACL_IDX_INO 3 | |
8339 | #define EXT2_ACL_DATA_INO 4 | |
8340 | #define EXT2_BOOT_LOADER_INO 5 | |
8341 | #define EXT2_UNDEL_DIR_INO 6 | |
8342 | #define EXT2_RESIZE_INO 7 | |
8343 | #define EXT2_JOURNAL_INO 8 | |
8344 | ||
8345 | ||
8346 | #define EXT2_GOOD_OLD_FIRST_INO 11 | |
8347 | ||
8348 | ||
8349 | ||
8350 | ||
8351 | #define EXT2_SUPER_MAGIC 0xEF53 | |
8352 | ||
8353 | ||
8354 | ||
8355 | ||
8356 | ||
8357 | ||
8358 | ||
8359 | #define EXT2_SB(sb) (sb) | |
8360 | ||
8361 | ||
8362 | ||
8363 | ||
8364 | ||
8365 | #define EXT2_LINK_MAX 65000 | |
8366 | ||
8367 | ||
8368 | ||
8369 | ||
8370 | #define EXT2_MIN_BLOCK_LOG_SIZE 10 | |
8371 | #define EXT2_MAX_BLOCK_LOG_SIZE 16 | |
8372 | #define EXT2_MIN_BLOCK_SIZE (1 << EXT2_MIN_BLOCK_LOG_SIZE) | |
8373 | #define EXT2_MAX_BLOCK_SIZE (1 << EXT2_MAX_BLOCK_LOG_SIZE) | |
8374 | ||
8375 | ||
8376 | ||
8377 | ||
8378 | ||
8379 | ||
8380 | ||
8381 | #define EXT2_BLOCK_SIZE(s) (EXT2_MIN_BLOCK_SIZE << (s)->s_log_block_size) | |
8382 | #define EXT2_BLOCK_SIZE_BITS(s) ((s)->s_log_block_size + 10) | |
8383 | #define EXT2_INODE_SIZE(s) (((s)->s_rev_level == EXT2_GOOD_OLD_REV) ? EXT2_GOOD_OLD_INODE_SIZE : (s)->s_inode_size) | |
8384 | ||
8385 | #define EXT2_FIRST_INO(s) (((s)->s_rev_level == EXT2_GOOD_OLD_REV) ? EXT2_GOOD_OLD_FIRST_INO : (s)->s_first_ino) | |
8386 | ||
8387 | ||
8388 | #define EXT2_ADDR_PER_BLOCK(s) (EXT2_BLOCK_SIZE(s) / sizeof(__u32)) | |
8389 | ||
8390 | ||
8391 | ||
8392 | ||
8393 | #define EXT2_MIN_FRAG_SIZE EXT2_MIN_BLOCK_SIZE | |
8394 | #define EXT2_MAX_FRAG_SIZE EXT2_MAX_BLOCK_SIZE | |
8395 | #define EXT2_MIN_FRAG_LOG_SIZE EXT2_MIN_BLOCK_LOG_SIZE | |
8396 | ||
8397 | ||
8398 | ||
8399 | ||
8400 | #define EXT2_FRAG_SIZE(s) (EXT2_MIN_FRAG_SIZE << (s)->s_log_frag_size) | |
8401 | #define EXT2_FRAGS_PER_BLOCK(s) (EXT2_BLOCK_SIZE(s) / EXT2_FRAG_SIZE(s)) | |
8402 | ||
8403 | ||
8404 | ||
8405 | ||
8406 | ||
8407 | struct ext2_acl_header | |
8408 | { | |
8409 | __u32 aclh_size; | |
8410 | __u32 aclh_file_count; | |
8411 | __u32 aclh_acle_count; | |
8412 | __u32 aclh_first_acle; | |
8413 | }; | |
8414 | ||
8415 | struct ext2_acl_entry | |
8416 | { | |
8417 | __u32 acle_size; | |
8418 | __u16 acle_perms; | |
8419 | __u16 acle_type; | |
8420 | __u16 acle_tag; | |
8421 | __u16 acle_pad1; | |
8422 | __u32 acle_next; | |
8423 | ||
8424 | }; | |
8425 | ||
8426 | ||
8427 | ||
8428 | ||
8429 | struct ext2_group_desc | |
8430 | { | |
8431 | __u32 bg_block_bitmap; | |
8432 | __u32 bg_inode_bitmap; | |
8433 | __u32 bg_inode_table; | |
8434 | __u16 bg_free_blocks_count; | |
8435 | __u16 bg_free_inodes_count; | |
8436 | __u16 bg_used_dirs_count; | |
8437 | __u16 bg_flags; | |
8438 | __u32 bg_reserved[2]; | |
8439 | __u16 bg_itable_unused; | |
8440 | __u16 bg_checksum; | |
8441 | }; | |
8442 | ||
8443 | struct ext4_group_desc | |
8444 | { | |
8445 | __u32 bg_block_bitmap; | |
8446 | __u32 bg_inode_bitmap; | |
8447 | __u32 bg_inode_table; | |
8448 | __u16 bg_free_blocks_count; | |
8449 | __u16 bg_free_inodes_count; | |
8450 | __u16 bg_used_dirs_count; | |
8451 | __u16 bg_flags; | |
8452 | __u32 bg_reserved[2]; | |
8453 | __u16 bg_itable_unused; | |
8454 | __u16 bg_checksum; | |
8455 | __u32 bg_block_bitmap_hi; | |
8456 | __u32 bg_inode_bitmap_hi; | |
8457 | __u32 bg_inode_table_hi; | |
8458 | __u16 bg_free_blocks_count_hi; | |
8459 | __u16 bg_free_inodes_count_hi; | |
8460 | __u16 bg_used_dirs_count_hi; | |
8461 | __u16 bg_pad; | |
8462 | __u32 bg_reserved2[3]; | |
8463 | }; | |
8464 | ||
8465 | #define EXT2_BG_INODE_UNINIT 0x0001 | |
8466 | #define EXT2_BG_BLOCK_UNINIT 0x0002 | |
8467 | # 189 "../lib/ext2fs/ext2_fs.h" | |
8468 | struct ext2_dx_root_info { | |
8469 | __u32 reserved_zero; | |
8470 | __u8 hash_version; | |
8471 | __u8 info_length; | |
8472 | __u8 indirect_levels; | |
8473 | __u8 unused_flags; | |
8474 | }; | |
8475 | ||
8476 | #define EXT2_HASH_LEGACY 0 | |
8477 | #define EXT2_HASH_HALF_MD4 1 | |
8478 | #define EXT2_HASH_TEA 2 | |
8479 | #define EXT2_HASH_LEGACY_UNSIGNED 3 | |
8480 | #define EXT2_HASH_HALF_MD4_UNSIGNED 4 | |
8481 | #define EXT2_HASH_TEA_UNSIGNED 5 | |
8482 | ||
8483 | #define EXT2_HASH_FLAG_INCOMPAT 0x1 | |
8484 | ||
8485 | struct ext2_dx_entry { | |
8486 | __u32 hash; | |
8487 | __u32 block; | |
8488 | }; | |
8489 | ||
8490 | struct ext2_dx_countlimit { | |
8491 | __u16 limit; | |
8492 | __u16 count; | |
8493 | }; | |
8494 | ||
8495 | ||
8496 | ||
8497 | ||
8498 | ||
8499 | #define EXT2_BLOCKS_PER_GROUP(s) (EXT2_SB(s)->s_blocks_per_group) | |
8500 | #define EXT2_INODES_PER_GROUP(s) (EXT2_SB(s)->s_inodes_per_group) | |
8501 | #define EXT2_INODES_PER_BLOCK(s) (EXT2_BLOCK_SIZE(s)/EXT2_INODE_SIZE(s)) | |
8502 | ||
8503 | #define EXT2_MAX_BLOCKS_PER_GROUP(s) ((1 << 16) - 8) | |
8504 | #define EXT2_MAX_INODES_PER_GROUP(s) ((1 << 16) - EXT2_INODES_PER_BLOCK(s)) | |
8505 | ||
8506 | ||
8507 | ||
8508 | ||
8509 | #define EXT2_DESC_PER_BLOCK(s) (EXT2_BLOCK_SIZE(s) / sizeof (struct ext2_group_desc)) | |
8510 | ||
8511 | ||
8512 | ||
8513 | ||
8514 | ||
8515 | #define EXT2_NDIR_BLOCKS 12 | |
8516 | #define EXT2_IND_BLOCK EXT2_NDIR_BLOCKS | |
8517 | #define EXT2_DIND_BLOCK (EXT2_IND_BLOCK + 1) | |
8518 | #define EXT2_TIND_BLOCK (EXT2_DIND_BLOCK + 1) | |
8519 | #define EXT2_N_BLOCKS (EXT2_TIND_BLOCK + 1) | |
8520 | ||
8521 | ||
8522 | ||
8523 | ||
8524 | #define EXT2_SECRM_FL 0x00000001 | |
8525 | #define EXT2_UNRM_FL 0x00000002 | |
8526 | #define EXT2_COMPR_FL 0x00000004 | |
8527 | #define EXT2_SYNC_FL 0x00000008 | |
8528 | #define EXT2_IMMUTABLE_FL 0x00000010 | |
8529 | #define EXT2_APPEND_FL 0x00000020 | |
8530 | #define EXT2_NODUMP_FL 0x00000040 | |
8531 | #define EXT2_NOATIME_FL 0x00000080 | |
8532 | ||
8533 | #define EXT2_DIRTY_FL 0x00000100 | |
8534 | #define EXT2_COMPRBLK_FL 0x00000200 | |
8535 | #define EXT2_NOCOMPR_FL 0x00000400 | |
8536 | #define EXT2_ECOMPR_FL 0x00000800 | |
8537 | ||
8538 | #define EXT2_BTREE_FL 0x00001000 | |
8539 | #define EXT2_INDEX_FL 0x00001000 | |
8540 | #define EXT2_IMAGIC_FL 0x00002000 | |
8541 | #define EXT3_JOURNAL_DATA_FL 0x00004000 | |
8542 | #define EXT2_NOTAIL_FL 0x00008000 | |
8543 | #define EXT2_DIRSYNC_FL 0x00010000 | |
8544 | #define EXT2_TOPDIR_FL 0x00020000 | |
8545 | #define EXT4_EXTENTS_FL 0x00080000 | |
8546 | #define EXT2_RESERVED_FL 0x80000000 | |
8547 | ||
8548 | #define EXT2_FL_USER_VISIBLE 0x000BDFFF | |
8549 | #define EXT2_FL_USER_MODIFIABLE 0x000080FF | |
8550 | ||
8551 | ||
8552 | ||
8553 | ||
8554 | ||
8555 | ||
8556 | struct ext2_new_group_input { | |
8557 | __u32 group; | |
8558 | __u32 block_bitmap; | |
8559 | __u32 inode_bitmap; | |
8560 | __u32 inode_table; | |
8561 | __u32 blocks_count; | |
8562 | __u16 reserved_blocks; | |
8563 | __u16 unused; | |
8564 | }; | |
8565 | ||
8566 | ||
8567 | ||
8568 | ||
8569 | ||
8570 | #define EXT2_IOC_GETFLAGS _IOR('f', 1, long) | |
8571 | #define EXT2_IOC_SETFLAGS _IOW('f', 2, long) | |
8572 | #define EXT2_IOC_GETVERSION _IOR('v', 1, long) | |
8573 | #define EXT2_IOC_SETVERSION _IOW('v', 2, long) | |
8574 | #define EXT2_IOC_GETVERSION_NEW _IOR('f', 3, long) | |
8575 | #define EXT2_IOC_SETVERSION_NEW _IOW('f', 4, long) | |
8576 | #define EXT2_IOC_GROUP_EXTEND _IOW('f', 7, unsigned long) | |
8577 | #define EXT2_IOC_GROUP_ADD _IOW('f', 8,struct ext2_new_group_input) | |
8578 | ||
8579 | ||
8580 | ||
8581 | ||
8582 | struct ext2_inode { | |
8583 | __u16 i_mode; | |
8584 | __u16 i_uid; | |
8585 | __u32 i_size; | |
8586 | __u32 i_atime; | |
8587 | __u32 i_ctime; | |
8588 | __u32 i_mtime; | |
8589 | __u32 i_dtime; | |
8590 | __u16 i_gid; | |
8591 | __u16 i_links_count; | |
8592 | __u32 i_blocks; | |
8593 | __u32 i_flags; | |
8594 | union { | |
8595 | struct { | |
8596 | __u32 l_i_version; | |
8597 | } linux1; | |
8598 | struct { | |
8599 | __u32 h_i_translator; | |
8600 | } hurd1; | |
8601 | struct { | |
8602 | __u32 m_i_reserved1; | |
8603 | } masix1; | |
8604 | } osd1; | |
8605 | __u32 i_block[(((12 + 1) + 1) + 1)]; | |
8606 | __u32 i_generation; | |
8607 | __u32 i_file_acl; | |
8608 | __u32 i_dir_acl; | |
8609 | __u32 i_faddr; | |
8610 | union { | |
8611 | struct { | |
8612 | __u16 l_i_blocks_hi; | |
8613 | __u16 i_pad1; | |
8614 | __u16 l_i_uid_high; | |
8615 | __u16 l_i_gid_high; | |
8616 | __u32 l_i_reserved2; | |
8617 | } linux2; | |
8618 | struct { | |
8619 | __u8 h_i_frag; | |
8620 | __u8 h_i_fsize; | |
8621 | __u16 h_i_mode_high; | |
8622 | __u16 h_i_uid_high; | |
8623 | __u16 h_i_gid_high; | |
8624 | __u32 h_i_author; | |
8625 | } hurd2; | |
8626 | struct { | |
8627 | __u8 m_i_frag; | |
8628 | __u8 m_i_fsize; | |
8629 | __u16 m_pad1; | |
8630 | __u32 m_i_reserved2[2]; | |
8631 | } masix2; | |
8632 | } osd2; | |
8633 | }; | |
8634 | ||
8635 | ||
8636 | ||
8637 | ||
8638 | struct ext2_inode_large { | |
8639 | __u16 i_mode; | |
8640 | __u16 i_uid; | |
8641 | __u32 i_size; | |
8642 | __u32 i_atime; | |
8643 | __u32 i_ctime; | |
8644 | __u32 i_mtime; | |
8645 | __u32 i_dtime; | |
8646 | __u16 i_gid; | |
8647 | __u16 i_links_count; | |
8648 | __u32 i_blocks; | |
8649 | __u32 i_flags; | |
8650 | union { | |
8651 | struct { | |
8652 | __u32 l_i_version; | |
8653 | } linux1; | |
8654 | struct { | |
8655 | __u32 h_i_translator; | |
8656 | } hurd1; | |
8657 | struct { | |
8658 | __u32 m_i_reserved1; | |
8659 | } masix1; | |
8660 | } osd1; | |
8661 | __u32 i_block[(((12 + 1) + 1) + 1)]; | |
8662 | __u32 i_generation; | |
8663 | __u32 i_file_acl; | |
8664 | __u32 i_dir_acl; | |
8665 | __u32 i_faddr; | |
8666 | union { | |
8667 | struct { | |
8668 | __u16 l_i_blocks_hi; | |
8669 | __u16 i_pad1; | |
8670 | __u16 l_i_uid_high; | |
8671 | __u16 l_i_gid_high; | |
8672 | __u32 l_i_reserved2; | |
8673 | } linux2; | |
8674 | struct { | |
8675 | __u8 h_i_frag; | |
8676 | __u8 h_i_fsize; | |
8677 | __u16 h_i_mode_high; | |
8678 | __u16 h_i_uid_high; | |
8679 | __u16 h_i_gid_high; | |
8680 | __u32 h_i_author; | |
8681 | } hurd2; | |
8682 | struct { | |
8683 | __u8 m_i_frag; | |
8684 | __u8 m_i_fsize; | |
8685 | __u16 m_pad1; | |
8686 | __u32 m_i_reserved2[2]; | |
8687 | } masix2; | |
8688 | } osd2; | |
8689 | __u16 i_extra_isize; | |
8690 | __u16 i_pad1; | |
8691 | __u32 i_ctime_extra; | |
8692 | __u32 i_mtime_extra; | |
8693 | __u32 i_atime_extra; | |
8694 | __u32 i_crtime; | |
8695 | __u32 i_crtime_extra; | |
8696 | }; | |
8697 | ||
8698 | #define i_size_high i_dir_acl | |
8699 | ||
8700 | ||
8701 | #define i_reserved1 osd1.linux1.l_i_reserved1 | |
8702 | #define i_frag osd2.linux2.l_i_frag | |
8703 | #define i_fsize osd2.linux2.l_i_fsize | |
8704 | #define i_uid_low i_uid | |
8705 | #define i_gid_low i_gid | |
8706 | #define i_uid_high osd2.linux2.l_i_uid_high | |
8707 | #define i_gid_high osd2.linux2.l_i_gid_high | |
8708 | #define i_reserved2 osd2.linux2.l_i_reserved2 | |
8709 | # 456 "../lib/ext2fs/ext2_fs.h" | |
8710 | #define inode_uid(inode) ((inode).i_uid | (inode).i_uid_high << 16) | |
8711 | #define inode_gid(inode) ((inode).i_gid | (inode).i_gid_high << 16) | |
8712 | ||
8713 | ||
8714 | ||
8715 | ||
8716 | ||
8717 | #define EXT2_VALID_FS 0x0001 | |
8718 | #define EXT2_ERROR_FS 0x0002 | |
8719 | ||
8720 | ||
8721 | ||
8722 | ||
8723 | #define EXT2_FLAGS_SIGNED_HASH 0x0001 | |
8724 | #define EXT2_FLAGS_UNSIGNED_HASH 0x0002 | |
8725 | ||
8726 | ||
8727 | ||
8728 | ||
8729 | #define EXT2_MOUNT_CHECK 0x0001 | |
8730 | #define EXT2_MOUNT_GRPID 0x0004 | |
8731 | #define EXT2_MOUNT_DEBUG 0x0008 | |
8732 | #define EXT2_MOUNT_ERRORS_CONT 0x0010 | |
8733 | #define EXT2_MOUNT_ERRORS_RO 0x0020 | |
8734 | #define EXT2_MOUNT_ERRORS_PANIC 0x0040 | |
8735 | #define EXT2_MOUNT_MINIX_DF 0x0080 | |
8736 | #define EXT2_MOUNT_NO_UID32 0x0200 | |
8737 | ||
8738 | #define clear_opt(o,opt) o &= ~EXT2_MOUNT_ ##opt | |
8739 | #define set_opt(o,opt) o |= EXT2_MOUNT_ ##opt | |
8740 | #define test_opt(sb,opt) (EXT2_SB(sb)->s_mount_opt & EXT2_MOUNT_ ##opt) | |
8741 | ||
8742 | ||
8743 | ||
8744 | ||
8745 | #define EXT2_DFL_MAX_MNT_COUNT 20 | |
8746 | #define EXT2_DFL_CHECKINTERVAL 0 | |
8747 | ||
8748 | ||
8749 | ||
8750 | ||
8751 | #define EXT2_ERRORS_CONTINUE 1 | |
8752 | #define EXT2_ERRORS_RO 2 | |
8753 | #define EXT2_ERRORS_PANIC 3 | |
8754 | #define EXT2_ERRORS_DEFAULT EXT2_ERRORS_CONTINUE | |
8755 | ||
8756 | ||
8757 | ||
8758 | ||
8759 | struct ext2_super_block { | |
8760 | __u32 s_inodes_count; | |
8761 | __u32 s_blocks_count; | |
8762 | __u32 s_r_blocks_count; | |
8763 | __u32 s_free_blocks_count; | |
8764 | __u32 s_free_inodes_count; | |
8765 | __u32 s_first_data_block; | |
8766 | __u32 s_log_block_size; | |
8767 | __s32 s_log_frag_size; | |
8768 | __u32 s_blocks_per_group; | |
8769 | __u32 s_frags_per_group; | |
8770 | __u32 s_inodes_per_group; | |
8771 | __u32 s_mtime; | |
8772 | __u32 s_wtime; | |
8773 | __u16 s_mnt_count; | |
8774 | __s16 s_max_mnt_count; | |
8775 | __u16 s_magic; | |
8776 | __u16 s_state; | |
8777 | __u16 s_errors; | |
8778 | __u16 s_minor_rev_level; | |
8779 | __u32 s_lastcheck; | |
8780 | __u32 s_checkinterval; | |
8781 | __u32 s_creator_os; | |
8782 | __u32 s_rev_level; | |
8783 | __u16 s_def_resuid; | |
8784 | __u16 s_def_resgid; | |
8785 | # 544 "../lib/ext2fs/ext2_fs.h" | |
8786 | __u32 s_first_ino; | |
8787 | __u16 s_inode_size; | |
8788 | __u16 s_block_group_nr; | |
8789 | __u32 s_feature_compat; | |
8790 | __u32 s_feature_incompat; | |
8791 | __u32 s_feature_ro_compat; | |
8792 | __u8 s_uuid[16]; | |
8793 | char s_volume_name[16]; | |
8794 | char s_last_mounted[64]; | |
8795 | __u32 s_algorithm_usage_bitmap; | |
8796 | ||
8797 | ||
8798 | ||
8799 | ||
8800 | __u8 s_prealloc_blocks; | |
8801 | __u8 s_prealloc_dir_blocks; | |
8802 | __u16 s_reserved_gdt_blocks; | |
8803 | ||
8804 | ||
8805 | ||
8806 | __u8 s_journal_uuid[16]; | |
8807 | __u32 s_journal_inum; | |
8808 | __u32 s_journal_dev; | |
8809 | __u32 s_last_orphan; | |
8810 | __u32 s_hash_seed[4]; | |
8811 | __u8 s_def_hash_version; | |
8812 | __u8 s_jnl_backup_type; | |
8813 | __u16 s_desc_size; | |
8814 | __u32 s_default_mount_opts; | |
8815 | __u32 s_first_meta_bg; | |
8816 | __u32 s_mkfs_time; | |
8817 | __u32 s_jnl_blocks[17]; | |
8818 | __u32 s_blocks_count_hi; | |
8819 | __u32 s_r_blocks_count_hi; | |
8820 | __u32 s_free_blocks_hi; | |
8821 | __u16 s_min_extra_isize; | |
8822 | __u16 s_want_extra_isize; | |
8823 | __u32 s_flags; | |
8824 | __u16 s_raid_stride; | |
8825 | __u16 s_mmp_interval; | |
8826 | __u64 s_mmp_block; | |
8827 | __u32 s_raid_stripe_width; | |
8828 | __u32 s_reserved[163]; | |
8829 | }; | |
8830 | ||
8831 | ||
8832 | ||
8833 | ||
8834 | #define EXT2_OS_LINUX 0 | |
8835 | #define EXT2_OS_HURD 1 | |
8836 | #define EXT2_OS_MASIX 2 | |
8837 | #define EXT2_OS_FREEBSD 3 | |
8838 | #define EXT2_OS_LITES 4 | |
8839 | ||
8840 | ||
8841 | ||
8842 | ||
8843 | #define EXT2_GOOD_OLD_REV 0 | |
8844 | #define EXT2_DYNAMIC_REV 1 | |
8845 | ||
8846 | #define EXT2_CURRENT_REV EXT2_GOOD_OLD_REV | |
8847 | #define EXT2_MAX_SUPP_REV EXT2_DYNAMIC_REV | |
8848 | ||
8849 | #define EXT2_GOOD_OLD_INODE_SIZE 128 | |
8850 | ||
8851 | ||
8852 | ||
8853 | ||
8854 | #define EXT3_JNL_BACKUP_BLOCKS 1 | |
8855 | ||
8856 | ||
8857 | ||
8858 | ||
8859 | ||
8860 | #define EXT2_HAS_COMPAT_FEATURE(sb,mask) ( EXT2_SB(sb)->s_feature_compat & (mask) ) | |
8861 | ||
8862 | #define EXT2_HAS_RO_COMPAT_FEATURE(sb,mask) ( EXT2_SB(sb)->s_feature_ro_compat & (mask) ) | |
8863 | ||
8864 | #define EXT2_HAS_INCOMPAT_FEATURE(sb,mask) ( EXT2_SB(sb)->s_feature_incompat & (mask) ) | |
8865 | ||
8866 | ||
8867 | #define EXT2_FEATURE_COMPAT_DIR_PREALLOC 0x0001 | |
8868 | #define EXT2_FEATURE_COMPAT_IMAGIC_INODES 0x0002 | |
8869 | #define EXT3_FEATURE_COMPAT_HAS_JOURNAL 0x0004 | |
8870 | #define EXT2_FEATURE_COMPAT_EXT_ATTR 0x0008 | |
8871 | #define EXT2_FEATURE_COMPAT_RESIZE_INODE 0x0010 | |
8872 | #define EXT2_FEATURE_COMPAT_DIR_INDEX 0x0020 | |
8873 | #define EXT2_FEATURE_COMPAT_LAZY_BG 0x0040 | |
8874 | ||
8875 | #define EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER 0x0001 | |
8876 | #define EXT2_FEATURE_RO_COMPAT_LARGE_FILE 0x0002 | |
8877 | ||
8878 | #define EXT4_FEATURE_RO_COMPAT_HUGE_FILE 0x0008 | |
8879 | #define EXT4_FEATURE_RO_COMPAT_GDT_CSUM 0x0010 | |
8880 | #define EXT4_FEATURE_RO_COMPAT_DIR_NLINK 0x0020 | |
8881 | #define EXT4_FEATURE_RO_COMPAT_EXTRA_ISIZE 0x0040 | |
8882 | ||
8883 | #define EXT2_FEATURE_INCOMPAT_COMPRESSION 0x0001 | |
8884 | #define EXT2_FEATURE_INCOMPAT_FILETYPE 0x0002 | |
8885 | #define EXT3_FEATURE_INCOMPAT_RECOVER 0x0004 | |
8886 | #define EXT3_FEATURE_INCOMPAT_JOURNAL_DEV 0x0008 | |
8887 | #define EXT2_FEATURE_INCOMPAT_META_BG 0x0010 | |
8888 | #define EXT3_FEATURE_INCOMPAT_EXTENTS 0x0040 | |
8889 | #define EXT4_FEATURE_INCOMPAT_64BIT 0x0080 | |
8890 | #define EXT4_FEATURE_INCOMPAT_MMP 0x0100 | |
8891 | ||
8892 | ||
8893 | #define EXT2_FEATURE_COMPAT_SUPP 0 | |
8894 | #define EXT2_FEATURE_INCOMPAT_SUPP (EXT2_FEATURE_INCOMPAT_FILETYPE) | |
8895 | #define EXT2_FEATURE_RO_COMPAT_SUPP (EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER| EXT2_FEATURE_RO_COMPAT_LARGE_FILE| EXT2_FEATURE_RO_COMPAT_BTREE_DIR) | |
8896 | ||
8897 | ||
8898 | ||
8899 | ||
8900 | ||
8901 | ||
8902 | #define EXT2_DEF_RESUID 0 | |
8903 | #define EXT2_DEF_RESGID 0 | |
8904 | ||
8905 | ||
8906 | ||
8907 | ||
8908 | #define EXT2_DEFM_DEBUG 0x0001 | |
8909 | #define EXT2_DEFM_BSDGROUPS 0x0002 | |
8910 | #define EXT2_DEFM_XATTR_USER 0x0004 | |
8911 | #define EXT2_DEFM_ACL 0x0008 | |
8912 | #define EXT2_DEFM_UID16 0x0010 | |
8913 | #define EXT3_DEFM_JMODE 0x0060 | |
8914 | #define EXT3_DEFM_JMODE_DATA 0x0020 | |
8915 | #define EXT3_DEFM_JMODE_ORDERED 0x0040 | |
8916 | #define EXT3_DEFM_JMODE_WBACK 0x0060 | |
8917 | ||
8918 | ||
8919 | ||
8920 | ||
8921 | #define EXT2_NAME_LEN 255 | |
8922 | ||
8923 | struct ext2_dir_entry { | |
8924 | __u32 inode; | |
8925 | __u16 rec_len; | |
8926 | __u16 name_len; | |
8927 | char name[255]; | |
8928 | }; | |
8929 | ||
8930 | ||
8931 | ||
8932 | ||
8933 | ||
8934 | ||
8935 | ||
8936 | struct ext2_dir_entry_2 { | |
8937 | __u32 inode; | |
8938 | __u16 rec_len; | |
8939 | __u8 name_len; | |
8940 | __u8 file_type; | |
8941 | char name[255]; | |
8942 | }; | |
8943 | ||
8944 | ||
8945 | ||
8946 | ||
8947 | ||
8948 | #define EXT2_FT_UNKNOWN 0 | |
8949 | #define EXT2_FT_REG_FILE 1 | |
8950 | #define EXT2_FT_DIR 2 | |
8951 | #define EXT2_FT_CHRDEV 3 | |
8952 | #define EXT2_FT_BLKDEV 4 | |
8953 | #define EXT2_FT_FIFO 5 | |
8954 | #define EXT2_FT_SOCK 6 | |
8955 | #define EXT2_FT_SYMLINK 7 | |
8956 | ||
8957 | #define EXT2_FT_MAX 8 | |
8958 | ||
8959 | ||
8960 | ||
8961 | ||
8962 | ||
8963 | ||
8964 | #define EXT2_DIR_PAD 4 | |
8965 | #define EXT2_DIR_ROUND (EXT2_DIR_PAD - 1) | |
8966 | #define EXT2_DIR_REC_LEN(name_len) (((name_len) + 8 + EXT2_DIR_ROUND) & ~EXT2_DIR_ROUND) | |
8967 | ||
8968 | ||
8969 | ||
8970 | ||
8971 | ||
8972 | ||
8973 | ||
8974 | #define EXT2_MMP_MAGIC 0x004D4D50 | |
8975 | #define EXT2_MMP_CLEAN 0xFF4D4D50 | |
8976 | #define EXT2_MMP_FSCK_ON 0xE24D4D50 | |
8977 | ||
8978 | struct mmp_struct { | |
8979 | __u32 mmp_magic; | |
8980 | __u32 mmp_seq; | |
8981 | __u64 mmp_time; | |
8982 | char mmp_nodename[64]; | |
8983 | char mmp_bdevname[32]; | |
8984 | __u16 mmp_interval; | |
8985 | __u16 mmp_pad1; | |
8986 | __u32 mmp_pad2; | |
8987 | }; | |
8988 | ||
8989 | ||
8990 | ||
8991 | ||
8992 | #define EXT2_MMP_DEF_INTERVAL 5 | |
8993 | # 35 "e2fsck.h" 2 | |
8994 | # 1 "../lib/ext2fs/ext2fs.h" 1 | |
8995 | # 13 "../lib/ext2fs/ext2fs.h" | |
8996 | #define _EXT2FS_EXT2FS_H | |
8997 | ||
8998 | ||
8999 | #define EXT2FS_ATTR(x) __attribute__(x) | |
9000 | # 38 "../lib/ext2fs/ext2fs.h" | |
9001 | #define EXT2FS_ENABLE_SWAPFS | |
9002 | # 48 "../lib/ext2fs/ext2fs.h" | |
9003 | #define SUPERBLOCK_OFFSET 1024 | |
9004 | #define SUPERBLOCK_SIZE 1024 | |
9005 | ||
9006 | ||
9007 | ||
9008 | ||
9009 | ||
9010 | #define EXT2_LIB_CURRENT_REV EXT2_DYNAMIC_REV | |
9011 | # 70 "../lib/ext2fs/ext2fs.h" | |
9012 | # 1 "../lib/ext2fs/ext2_types.h" 1 | |
9013 | # 71 "../lib/ext2fs/ext2fs.h" 2 | |
9014 | # 1 "../lib/ext2fs/ext2_fs.h" 1 | |
9015 | # 72 "../lib/ext2fs/ext2fs.h" 2 | |
9016 | # 1 "../lib/ext2fs/ext3_extents.h" 1 | |
9017 | # 20 "../lib/ext2fs/ext3_extents.h" | |
9018 | #define _LINUX_EXT3_EXTENTS | |
9019 | ||
9020 | ||
9021 | ||
9022 | ||
9023 | ||
9024 | ||
9025 | ||
9026 | #define AGRESSIVE_TEST_ | |
9027 | ||
9028 | ||
9029 | ||
9030 | ||
9031 | ||
9032 | #define CHECK_BINSEARCH_ | |
9033 | # 48 "../lib/ext2fs/ext3_extents.h" | |
9034 | #define ext_debug(tree,fmt,a...) | |
9035 | ||
9036 | ||
9037 | ||
9038 | ||
9039 | ||
9040 | ||
9041 | #define EXT_STATS_ | |
9042 | ||
9043 | ||
9044 | #define EXT3_ALLOC_NEEDED 3 | |
9045 | # 71 "../lib/ext2fs/ext3_extents.h" | |
9046 | struct ext3_extent { | |
9047 | __u32 ee_block; | |
9048 | __u16 ee_len; | |
9049 | __u16 ee_start_hi; | |
9050 | __u32 ee_start; | |
9051 | }; | |
9052 | ||
9053 | ||
9054 | ||
9055 | ||
9056 | ||
9057 | struct ext3_extent_idx { | |
9058 | __u32 ei_block; | |
9059 | __u32 ei_leaf; | |
9060 | ||
9061 | __u16 ei_leaf_hi; | |
9062 | __u16 ei_unused; | |
9063 | }; | |
9064 | ||
9065 | ||
9066 | ||
9067 | ||
9068 | struct ext3_extent_header { | |
9069 | __u16 eh_magic; | |
9070 | __u16 eh_entries; | |
9071 | __u16 eh_max; | |
9072 | __u16 eh_depth; | |
9073 | __u32 eh_generation; | |
9074 | }; | |
9075 | ||
9076 | #define EXT3_EXT_MAGIC 0xf30a | |
9077 | ||
9078 | ||
9079 | ||
9080 | ||
9081 | ||
9082 | ||
9083 | struct ext3_ext_path { | |
9084 | __u32 p_block; | |
9085 | __u16 p_depth; | |
9086 | struct ext3_extent *p_ext; | |
9087 | struct ext3_extent_idx *p_idx; | |
9088 | struct ext3_extent_header *p_hdr; | |
9089 | struct buffer_head *p_bh; | |
9090 | }; | |
9091 | ||
9092 | ||
9093 | ||
9094 | ||
9095 | ||
9096 | #define EXT_CONTINUE 0 | |
9097 | #define EXT_BREAK 1 | |
9098 | #define EXT_REPEAT 2 | |
9099 | ||
9100 | ||
9101 | #define EXT_MAX_BLOCK 0xffffffff | |
9102 | #define EXT_CACHE_MARK 0xffff | |
9103 | ||
9104 | ||
9105 | #define EXT_FIRST_EXTENT(__hdr__) ((struct ext3_extent *) (((char *) (__hdr__)) + sizeof(struct ext3_extent_header))) | |
9106 | ||
9107 | ||
9108 | #define EXT_FIRST_INDEX(__hdr__) ((struct ext3_extent_idx *) (((char *) (__hdr__)) + sizeof(struct ext3_extent_header))) | |
9109 | ||
9110 | ||
9111 | #define EXT_HAS_FREE_INDEX(__path__) ((__path__)->p_hdr->eh_entries < (__path__)->p_hdr->eh_max) | |
9112 | ||
9113 | #define EXT_LAST_EXTENT(__hdr__) (EXT_FIRST_EXTENT((__hdr__)) + (__hdr__)->eh_entries - 1) | |
9114 | ||
9115 | #define EXT_LAST_INDEX(__hdr__) (EXT_FIRST_INDEX((__hdr__)) + (__hdr__)->eh_entries - 1) | |
9116 | ||
9117 | #define EXT_MAX_EXTENT(__hdr__) (EXT_FIRST_EXTENT((__hdr__)) + (__hdr__)->eh_max - 1) | |
9118 | ||
9119 | #define EXT_MAX_INDEX(__hdr__) (EXT_FIRST_INDEX((__hdr__)) + (__hdr__)->eh_max - 1) | |
9120 | ||
9121 | ||
9122 | #define EXT_ROOT_HDR(tree) ((struct ext3_extent_header *) (tree)->root) | |
9123 | ||
9124 | #define EXT_BLOCK_HDR(bh) ((struct ext3_extent_header *) (bh)->b_data) | |
9125 | ||
9126 | #define EXT_DEPTH(_t_) (((struct ext3_extent_header *)((_t_)->root))->eh_depth) | |
9127 | ||
9128 | #define EXT_GENERATION(_t_) (((struct ext3_extent_header *)((_t_)->root))->eh_generation) | |
9129 | ||
9130 | ||
9131 | ||
9132 | #define EXT_ASSERT(__x__) if (!(__x__)) BUG(); | |
9133 | ||
9134 | ||
9135 | ||
9136 | ||
9137 | ||
9138 | struct ext3_extent_buf { | |
9139 | unsigned long start; | |
9140 | int buflen; | |
9141 | void *buffer; | |
9142 | void *cur; | |
9143 | int err; | |
9144 | }; | |
9145 | ||
9146 | ||
9147 | ||
9148 | ||
9149 | struct ext3_extent_tree_stats { | |
9150 | int depth; | |
9151 | int extents_num; | |
9152 | int leaf_num; | |
9153 | }; | |
9154 | # 73 "../lib/ext2fs/ext2fs.h" 2 | |
9155 | ||
9156 | ||
9157 | typedef __u32 ext2_ino_t; | |
9158 | typedef __u32 blk_t; | |
9159 | typedef __u32 dgrp_t; | |
9160 | typedef __u32 ext2_off_t; | |
9161 | typedef __s64 e2_blkcnt_t; | |
9162 | typedef __u32 ext2_dirhash_t; | |
9163 | ||
9164 | ||
9165 | ||
9166 | ||
9167 | ||
9168 | ||
9169 | # 1 "../lib/et/com_err.h" 1 | |
9170 | # 88 "../lib/ext2fs/ext2fs.h" 2 | |
9171 | # 1 "../lib/ext2fs/ext2_io.h" 1 | |
9172 | # 13 "../lib/ext2fs/ext2_io.h" | |
9173 | #define _EXT2FS_EXT2_IO_H | |
9174 | ||
9175 | ||
9176 | ||
9177 | ||
9178 | ||
9179 | typedef long long ext2_loff_t; | |
9180 | ||
9181 | ||
9182 | ||
9183 | ||
9184 | ||
9185 | ext2_loff_t ext2fs_llseek (int, ext2_loff_t, int); | |
9186 | ||
9187 | typedef struct struct_io_manager *io_manager; | |
9188 | typedef struct struct_io_channel *io_channel; | |
9189 | ||
9190 | #define CHANNEL_FLAGS_WRITETHROUGH 0x01 | |
9191 | ||
9192 | struct struct_io_channel { | |
9193 | errcode_t magic; | |
9194 | io_manager manager; | |
9195 | char *name; | |
9196 | int block_size; | |
9197 | errcode_t (*read_error)(io_channel channel, | |
9198 | unsigned long block, | |
9199 | int count, | |
9200 | void *data, | |
9201 | size_t size, | |
9202 | int actual_bytes_read, | |
9203 | errcode_t error); | |
9204 | errcode_t (*write_error)(io_channel channel, | |
9205 | unsigned long block, | |
9206 | int count, | |
9207 | const void *data, | |
9208 | size_t size, | |
9209 | int actual_bytes_written, | |
9210 | errcode_t error); | |
9211 | int refcount; | |
9212 | int flags; | |
9213 | int reserved[14]; | |
9214 | void *private_data; | |
9215 | void *app_data; | |
9216 | }; | |
9217 | ||
9218 | struct struct_io_manager { | |
9219 | errcode_t magic; | |
9220 | const char *name; | |
9221 | errcode_t (*open)(const char *name, int flags, io_channel *channel); | |
9222 | errcode_t (*close)(io_channel channel); | |
9223 | errcode_t (*set_blksize)(io_channel channel, int blksize); | |
9224 | errcode_t (*read_blk)(io_channel channel, unsigned long block, | |
9225 | int count, void *data); | |
9226 | errcode_t (*write_blk)(io_channel channel, unsigned long block, | |
9227 | int count, const void *data); | |
9228 | errcode_t (*flush)(io_channel channel); | |
9229 | errcode_t (*write_byte)(io_channel channel, unsigned long offset, | |
9230 | int count, const void *data); | |
9231 | errcode_t (*set_option)(io_channel channel, const char *option, | |
9232 | const char *arg); | |
9233 | int reserved[14]; | |
9234 | }; | |
9235 | ||
9236 | #define IO_FLAG_RW 0x0001 | |
9237 | #define IO_FLAG_EXCLUSIVE 0x0002 | |
9238 | ||
9239 | ||
9240 | ||
9241 | ||
9242 | #define io_channel_close(c) ((c)->manager->close((c))) | |
9243 | #define io_channel_set_blksize(c,s) ((c)->manager->set_blksize((c),s)) | |
9244 | #define io_channel_read_blk(c,b,n,d) ((c)->manager->read_blk((c),b,n,d)) | |
9245 | #define io_channel_write_blk(c,b,n,d) ((c)->manager->write_blk((c),b,n,d)) | |
9246 | #define io_channel_flush(c) ((c)->manager->flush((c))) | |
9247 | #define io_channel_bumpcount(c) ((c)->refcount++) | |
9248 | ||
9249 | ||
9250 | extern errcode_t io_channel_set_options(io_channel channel, | |
9251 | const char *options); | |
9252 | extern errcode_t io_channel_write_byte(io_channel channel, | |
9253 | unsigned long offset, | |
9254 | int count, const void *data); | |
9255 | ||
9256 | ||
9257 | extern io_manager unix_io_manager; | |
9258 | ||
9259 | ||
9260 | extern io_manager test_io_manager, test_io_backing_manager; | |
9261 | extern void (*test_io_cb_read_blk) | |
9262 | (unsigned long block, int count, errcode_t err); | |
9263 | extern void (*test_io_cb_write_blk) | |
9264 | (unsigned long block, int count, errcode_t err); | |
9265 | extern void (*test_io_cb_set_blksize) | |
9266 | (int blksize, errcode_t err); | |
9267 | # 89 "../lib/ext2fs/ext2fs.h" 2 | |
9268 | # 1 "../lib/ext2fs/ext2_err.h" 1 | |
9269 | ||
9270 | ||
9271 | ||
9272 | ||
9273 | #define EXT2_ET_BASE (2133571328L) | |
9274 | #define EXT2_ET_MAGIC_EXT2FS_FILSYS (2133571329L) | |
9275 | #define EXT2_ET_MAGIC_BADBLOCKS_LIST (2133571330L) | |
9276 | #define EXT2_ET_MAGIC_BADBLOCKS_ITERATE (2133571331L) | |
9277 | #define EXT2_ET_MAGIC_INODE_SCAN (2133571332L) | |
9278 | #define EXT2_ET_MAGIC_IO_CHANNEL (2133571333L) | |
9279 | #define EXT2_ET_MAGIC_UNIX_IO_CHANNEL (2133571334L) | |
9280 | #define EXT2_ET_MAGIC_IO_MANAGER (2133571335L) | |
9281 | #define EXT2_ET_MAGIC_BLOCK_BITMAP (2133571336L) | |
9282 | #define EXT2_ET_MAGIC_INODE_BITMAP (2133571337L) | |
9283 | #define EXT2_ET_MAGIC_GENERIC_BITMAP (2133571338L) | |
9284 | #define EXT2_ET_MAGIC_TEST_IO_CHANNEL (2133571339L) | |
9285 | #define EXT2_ET_MAGIC_DBLIST (2133571340L) | |
9286 | #define EXT2_ET_MAGIC_ICOUNT (2133571341L) | |
9287 | #define EXT2_ET_MAGIC_PQ_IO_CHANNEL (2133571342L) | |
9288 | #define EXT2_ET_MAGIC_EXT2_FILE (2133571343L) | |
9289 | #define EXT2_ET_MAGIC_E2IMAGE (2133571344L) | |
9290 | #define EXT2_ET_MAGIC_INODE_IO_CHANNEL (2133571345L) | |
9291 | #define EXT2_ET_MAGIC_RESERVED_9 (2133571346L) | |
9292 | #define EXT2_ET_BAD_MAGIC (2133571347L) | |
9293 | #define EXT2_ET_REV_TOO_HIGH (2133571348L) | |
9294 | #define EXT2_ET_RO_FILSYS (2133571349L) | |
9295 | #define EXT2_ET_GDESC_READ (2133571350L) | |
9296 | #define EXT2_ET_GDESC_WRITE (2133571351L) | |
9297 | #define EXT2_ET_GDESC_BAD_BLOCK_MAP (2133571352L) | |
9298 | #define EXT2_ET_GDESC_BAD_INODE_MAP (2133571353L) | |
9299 | #define EXT2_ET_GDESC_BAD_INODE_TABLE (2133571354L) | |
9300 | #define EXT2_ET_INODE_BITMAP_WRITE (2133571355L) | |
9301 | #define EXT2_ET_INODE_BITMAP_READ (2133571356L) | |
9302 | #define EXT2_ET_BLOCK_BITMAP_WRITE (2133571357L) | |
9303 | #define EXT2_ET_BLOCK_BITMAP_READ (2133571358L) | |
9304 | #define EXT2_ET_INODE_TABLE_WRITE (2133571359L) | |
9305 | #define EXT2_ET_INODE_TABLE_READ (2133571360L) | |
9306 | #define EXT2_ET_NEXT_INODE_READ (2133571361L) | |
9307 | #define EXT2_ET_UNEXPECTED_BLOCK_SIZE (2133571362L) | |
9308 | #define EXT2_ET_DIR_CORRUPTED (2133571363L) | |
9309 | #define EXT2_ET_SHORT_READ (2133571364L) | |
9310 | #define EXT2_ET_SHORT_WRITE (2133571365L) | |
9311 | #define EXT2_ET_DIR_NO_SPACE (2133571366L) | |
9312 | #define EXT2_ET_NO_INODE_BITMAP (2133571367L) | |
9313 | #define EXT2_ET_NO_BLOCK_BITMAP (2133571368L) | |
9314 | #define EXT2_ET_BAD_INODE_NUM (2133571369L) | |
9315 | #define EXT2_ET_BAD_BLOCK_NUM (2133571370L) | |
9316 | #define EXT2_ET_EXPAND_DIR_ERR (2133571371L) | |
9317 | #define EXT2_ET_TOOSMALL (2133571372L) | |
9318 | #define EXT2_ET_BAD_BLOCK_MARK (2133571373L) | |
9319 | #define EXT2_ET_BAD_BLOCK_UNMARK (2133571374L) | |
9320 | #define EXT2_ET_BAD_BLOCK_TEST (2133571375L) | |
9321 | #define EXT2_ET_BAD_INODE_MARK (2133571376L) | |
9322 | #define EXT2_ET_BAD_INODE_UNMARK (2133571377L) | |
9323 | #define EXT2_ET_BAD_INODE_TEST (2133571378L) | |
9324 | #define EXT2_ET_FUDGE_BLOCK_BITMAP_END (2133571379L) | |
9325 | #define EXT2_ET_FUDGE_INODE_BITMAP_END (2133571380L) | |
9326 | #define EXT2_ET_BAD_IND_BLOCK (2133571381L) | |
9327 | #define EXT2_ET_BAD_DIND_BLOCK (2133571382L) | |
9328 | #define EXT2_ET_BAD_TIND_BLOCK (2133571383L) | |
9329 | #define EXT2_ET_NEQ_BLOCK_BITMAP (2133571384L) | |
9330 | #define EXT2_ET_NEQ_INODE_BITMAP (2133571385L) | |
9331 | #define EXT2_ET_BAD_DEVICE_NAME (2133571386L) | |
9332 | #define EXT2_ET_MISSING_INODE_TABLE (2133571387L) | |
9333 | #define EXT2_ET_CORRUPT_SUPERBLOCK (2133571388L) | |
9334 | #define EXT2_ET_BAD_GENERIC_MARK (2133571389L) | |
9335 | #define EXT2_ET_BAD_GENERIC_UNMARK (2133571390L) | |
9336 | #define EXT2_ET_BAD_GENERIC_TEST (2133571391L) | |
9337 | #define EXT2_ET_SYMLINK_LOOP (2133571392L) | |
9338 | #define EXT2_ET_CALLBACK_NOTHANDLED (2133571393L) | |
9339 | #define EXT2_ET_BAD_BLOCK_IN_INODE_TABLE (2133571394L) | |
9340 | #define EXT2_ET_UNSUPP_FEATURE (2133571395L) | |
9341 | #define EXT2_ET_RO_UNSUPP_FEATURE (2133571396L) | |
9342 | #define EXT2_ET_LLSEEK_FAILED (2133571397L) | |
9343 | #define EXT2_ET_NO_MEMORY (2133571398L) | |
9344 | #define EXT2_ET_INVALID_ARGUMENT (2133571399L) | |
9345 | #define EXT2_ET_BLOCK_ALLOC_FAIL (2133571400L) | |
9346 | #define EXT2_ET_INODE_ALLOC_FAIL (2133571401L) | |
9347 | #define EXT2_ET_NO_DIRECTORY (2133571402L) | |
9348 | #define EXT2_ET_TOO_MANY_REFS (2133571403L) | |
9349 | #define EXT2_ET_FILE_NOT_FOUND (2133571404L) | |
9350 | #define EXT2_ET_FILE_RO (2133571405L) | |
9351 | #define EXT2_ET_DB_NOT_FOUND (2133571406L) | |
9352 | #define EXT2_ET_DIR_EXISTS (2133571407L) | |
9353 | #define EXT2_ET_UNIMPLEMENTED (2133571408L) | |
9354 | #define EXT2_ET_CANCEL_REQUESTED (2133571409L) | |
9355 | #define EXT2_ET_FILE_TOO_BIG (2133571410L) | |
9356 | #define EXT2_ET_JOURNAL_NOT_BLOCK (2133571411L) | |
9357 | #define EXT2_ET_NO_JOURNAL_SB (2133571412L) | |
9358 | #define EXT2_ET_JOURNAL_TOO_SMALL (2133571413L) | |
9359 | #define EXT2_ET_JOURNAL_UNSUPP_VERSION (2133571414L) | |
9360 | #define EXT2_ET_LOAD_EXT_JOURNAL (2133571415L) | |
9361 | #define EXT2_ET_NO_JOURNAL (2133571416L) | |
9362 | #define EXT2_ET_DIRHASH_UNSUPP (2133571417L) | |
9363 | #define EXT2_ET_BAD_EA_BLOCK_NUM (2133571418L) | |
9364 | #define EXT2_ET_TOO_MANY_INODES (2133571419L) | |
9365 | #define EXT2_ET_NOT_IMAGE_FILE (2133571420L) | |
9366 | #define EXT2_ET_RES_GDT_BLOCKS (2133571421L) | |
9367 | #define EXT2_ET_RESIZE_INODE_CORRUPT (2133571422L) | |
9368 | #define EXT2_ET_SET_BMAP_NO_IND (2133571423L) | |
9369 | #define EXT2_ET_TDB_SUCCESS (2133571424L) | |
9370 | #define EXT2_ET_TDB_ERR_CORRUPT (2133571425L) | |
9371 | #define EXT2_ET_TDB_ERR_IO (2133571426L) | |
9372 | #define EXT2_ET_TDB_ERR_LOCK (2133571427L) | |
9373 | #define EXT2_ET_TDB_ERR_OOM (2133571428L) | |
9374 | #define EXT2_ET_TDB_ERR_EXISTS (2133571429L) | |
9375 | #define EXT2_ET_TDB_ERR_NOLOCK (2133571430L) | |
9376 | #define EXT2_ET_TDB_ERR_EINVAL (2133571431L) | |
9377 | #define EXT2_ET_TDB_ERR_NOEXIST (2133571432L) | |
9378 | #define EXT2_ET_TDB_ERR_RDONLY (2133571433L) | |
9379 | extern void initialize_ext2_error_table(void); | |
9380 | #define ERROR_TABLE_BASE_ext2 (2133571328L) | |
9381 | ||
9382 | ||
9383 | #define init_ext2_err_tbl initialize_ext2_error_table | |
9384 | #define ext2_err_base ERROR_TABLE_BASE_ext2 | |
9385 | ||
9386 | ||
9387 | #define ERROR_TABLE_BASE_ext2 (2133571328L) | |
9388 | #define init_ext2_err_tbl initialize_ext2_error_table | |
9389 | #define initialize_ext2_error_table initialize_ext2_error_table | |
9390 | #define ext2_err_base ERROR_TABLE_BASE_ext2 | |
9391 | # 90 "../lib/ext2fs/ext2fs.h" 2 | |
9392 | # 98 "../lib/ext2fs/ext2fs.h" | |
9393 | #define EXT2_QSORT_TYPE int | |
9394 | ||
9395 | ||
9396 | typedef struct struct_ext2_filsys *ext2_filsys; | |
9397 | ||
9398 | struct ext2fs_struct_generic_bitmap { | |
9399 | errcode_t magic; | |
9400 | ext2_filsys fs; | |
9401 | __u32 start, end; | |
9402 | __u32 real_end; | |
9403 | char * description; | |
9404 | char * bitmap; | |
9405 | errcode_t base_error_code; | |
9406 | __u32 reserved[7]; | |
9407 | }; | |
9408 | ||
9409 | #define EXT2FS_MARK_ERROR 0 | |
9410 | #define EXT2FS_UNMARK_ERROR 1 | |
9411 | #define EXT2FS_TEST_ERROR 2 | |
9412 | ||
9413 | typedef struct ext2fs_struct_generic_bitmap *ext2fs_generic_bitmap; | |
9414 | typedef struct ext2fs_struct_generic_bitmap *ext2fs_inode_bitmap; | |
9415 | typedef struct ext2fs_struct_generic_bitmap *ext2fs_block_bitmap; | |
9416 | ||
9417 | #define EXT2_FIRST_INODE(s) EXT2_FIRST_INO(s) | |
9418 | ||
9419 | ||
9420 | ||
9421 | ||
9422 | ||
9423 | ||
9424 | typedef struct ext2_struct_u32_list *ext2_badblocks_list; | |
9425 | typedef struct ext2_struct_u32_iterate *ext2_badblocks_iterate; | |
9426 | ||
9427 | typedef struct ext2_struct_u32_list *ext2_u32_list; | |
9428 | typedef struct ext2_struct_u32_iterate *ext2_u32_iterate; | |
9429 | ||
9430 | ||
9431 | typedef struct ext2_struct_u32_list *badblocks_list; | |
9432 | typedef struct ext2_struct_u32_iterate *badblocks_iterate; | |
9433 | ||
9434 | #define BADBLOCKS_FLAG_DIRTY 1 | |
9435 | ||
9436 | ||
9437 | ||
9438 | ||
9439 | struct ext2_db_entry { | |
9440 | ext2_ino_t ino; | |
9441 | blk_t blk; | |
9442 | int blockcnt; | |
9443 | }; | |
9444 | ||
9445 | typedef struct ext2_struct_dblist *ext2_dblist; | |
9446 | ||
9447 | #define DBLIST_ABORT 1 | |
9448 | ||
9449 | ||
9450 | ||
9451 | ||
9452 | ||
9453 | #define EXT2_FILE_WRITE 0x0001 | |
9454 | #define EXT2_FILE_CREATE 0x0002 | |
9455 | ||
9456 | #define EXT2_FILE_MASK 0x00FF | |
9457 | ||
9458 | #define EXT2_FILE_BUF_DIRTY 0x4000 | |
9459 | #define EXT2_FILE_BUF_VALID 0x2000 | |
9460 | ||
9461 | typedef struct ext2_file *ext2_file_t; | |
9462 | ||
9463 | #define EXT2_SEEK_SET 0 | |
9464 | #define EXT2_SEEK_CUR 1 | |
9465 | #define EXT2_SEEK_END 2 | |
9466 | ||
9467 | ||
9468 | ||
9469 | ||
9470 | #define EXT2_FLAG_RW 0x01 | |
9471 | #define EXT2_FLAG_CHANGED 0x02 | |
9472 | #define EXT2_FLAG_DIRTY 0x04 | |
9473 | #define EXT2_FLAG_VALID 0x08 | |
9474 | #define EXT2_FLAG_IB_DIRTY 0x10 | |
9475 | #define EXT2_FLAG_BB_DIRTY 0x20 | |
9476 | #define EXT2_FLAG_SWAP_BYTES 0x40 | |
9477 | #define EXT2_FLAG_SWAP_BYTES_READ 0x80 | |
9478 | #define EXT2_FLAG_SWAP_BYTES_WRITE 0x100 | |
9479 | #define EXT2_FLAG_MASTER_SB_ONLY 0x200 | |
9480 | #define EXT2_FLAG_FORCE 0x400 | |
9481 | #define EXT2_FLAG_SUPER_ONLY 0x800 | |
9482 | #define EXT2_FLAG_JOURNAL_DEV_OK 0x1000 | |
9483 | #define EXT2_FLAG_IMAGE_FILE 0x2000 | |
9484 | #define EXT2_FLAG_EXCLUSIVE 0x4000 | |
9485 | #define EXT2_FLAG_SOFTSUPP_FEATURES 0x8000 | |
9486 | ||
9487 | ||
9488 | ||
9489 | ||
9490 | ||
9491 | #define EXT2_NEW_INODE_FL 0x80000000 | |
9492 | ||
9493 | ||
9494 | ||
9495 | ||
9496 | ||
9497 | ||
9498 | #define EXT2_MKJOURNAL_V1_SUPER 0x0000001 | |
9499 | ||
9500 | struct struct_ext2_filsys { | |
9501 | errcode_t magic; | |
9502 | io_channel io; | |
9503 | int flags; | |
9504 | char * device_name; | |
9505 | struct ext2_super_block * super; | |
9506 | unsigned int blocksize; | |
9507 | int fragsize; | |
9508 | dgrp_t group_desc_count; | |
9509 | unsigned long desc_blocks; | |
9510 | struct ext2_group_desc * group_desc; | |
9511 | int inode_blocks_per_group; | |
9512 | ext2fs_inode_bitmap inode_map; | |
9513 | ext2fs_block_bitmap block_map; | |
9514 | errcode_t (*get_blocks)(ext2_filsys fs, ext2_ino_t ino, blk_t *blocks); | |
9515 | errcode_t (*check_directory)(ext2_filsys fs, ext2_ino_t ino); | |
9516 | errcode_t (*write_bitmaps)(ext2_filsys fs); | |
9517 | errcode_t (*read_inode)(ext2_filsys fs, ext2_ino_t ino, | |
9518 | struct ext2_inode *inode); | |
9519 | errcode_t (*write_inode)(ext2_filsys fs, ext2_ino_t ino, | |
9520 | struct ext2_inode *inode); | |
9521 | ext2_badblocks_list badblocks; | |
9522 | ext2_dblist dblist; | |
9523 | __u32 stride; | |
9524 | struct ext2_super_block * orig_super; | |
9525 | struct ext2_image_hdr * image_header; | |
9526 | __u32 umask; | |
9527 | time_t now; | |
9528 | ||
9529 | ||
9530 | ||
9531 | __u32 reserved[7]; | |
9532 | ||
9533 | ||
9534 | ||
9535 | ||
9536 | void * priv_data; | |
9537 | ||
9538 | ||
9539 | ||
9540 | ||
9541 | struct ext2_inode_cache *icache; | |
9542 | io_channel image_io; | |
9543 | }; | |
9544 | ||
9545 | ||
9546 | ||
9547 | ||
9548 | # 1 "../lib/ext2fs/bitops.h" 1 | |
9549 | # 17 "../lib/ext2fs/bitops.h" | |
9550 | extern int ext2fs_set_bit(unsigned int nr,void * addr); | |
9551 | extern int ext2fs_clear_bit(unsigned int nr, void * addr); | |
9552 | extern int ext2fs_test_bit(unsigned int nr, const void * addr); | |
9553 | extern void ext2fs_fast_set_bit(unsigned int nr,void * addr); | |
9554 | extern void ext2fs_fast_clear_bit(unsigned int nr, void * addr); | |
9555 | extern __u16 ext2fs_swab16(__u16 val); | |
9556 | extern __u32 ext2fs_swab32(__u32 val); | |
9557 | extern __u64 ext2fs_swab64(__u64 val); | |
9558 | # 38 "../lib/ext2fs/bitops.h" | |
9559 | #define ext2fs_cpu_to_le64(x) ((__u64)(x)) | |
9560 | #define ext2fs_le64_to_cpu(x) ((__u64)(x)) | |
9561 | #define ext2fs_cpu_to_le32(x) ((__u32)(x)) | |
9562 | #define ext2fs_le32_to_cpu(x) ((__u32)(x)) | |
9563 | #define ext2fs_cpu_to_le16(x) ((__u16)(x)) | |
9564 | #define ext2fs_le16_to_cpu(x) ((__u16)(x)) | |
9565 | #define ext2fs_cpu_to_be32(x) ext2fs_swab32((x)) | |
9566 | #define ext2fs_be32_to_cpu(x) ext2fs_swab32((x)) | |
9567 | #define ext2fs_cpu_to_be16(x) ext2fs_swab16((x)) | |
9568 | #define ext2fs_be16_to_cpu(x) ext2fs_swab16((x)) | |
9569 | ||
9570 | ||
9571 | ||
9572 | ||
9573 | ||
9574 | ||
9575 | ||
9576 | extern const char *ext2fs_block_string; | |
9577 | extern const char *ext2fs_inode_string; | |
9578 | extern const char *ext2fs_mark_string; | |
9579 | extern const char *ext2fs_unmark_string; | |
9580 | extern const char *ext2fs_test_string; | |
9581 | extern void ext2fs_warn_bitmap(errcode_t errcode, unsigned long arg, | |
9582 | const char *description); | |
9583 | extern void ext2fs_warn_bitmap2(ext2fs_generic_bitmap bitmap, | |
9584 | int code, unsigned long arg); | |
9585 | ||
9586 | extern int ext2fs_mark_block_bitmap(ext2fs_block_bitmap bitmap, blk_t block); | |
9587 | extern int ext2fs_unmark_block_bitmap(ext2fs_block_bitmap bitmap, | |
9588 | blk_t block); | |
9589 | extern int ext2fs_test_block_bitmap(ext2fs_block_bitmap bitmap, blk_t block); | |
9590 | ||
9591 | extern int ext2fs_mark_inode_bitmap(ext2fs_inode_bitmap bitmap, ext2_ino_t inode); | |
9592 | extern int ext2fs_unmark_inode_bitmap(ext2fs_inode_bitmap bitmap, | |
9593 | ext2_ino_t inode); | |
9594 | extern int ext2fs_test_inode_bitmap(ext2fs_inode_bitmap bitmap, ext2_ino_t inode); | |
9595 | ||
9596 | extern void ext2fs_fast_mark_block_bitmap(ext2fs_block_bitmap bitmap, | |
9597 | blk_t block); | |
9598 | extern void ext2fs_fast_unmark_block_bitmap(ext2fs_block_bitmap bitmap, | |
9599 | blk_t block); | |
9600 | extern int ext2fs_fast_test_block_bitmap(ext2fs_block_bitmap bitmap, | |
9601 | blk_t block); | |
9602 | ||
9603 | extern void ext2fs_fast_mark_inode_bitmap(ext2fs_inode_bitmap bitmap, | |
9604 | ext2_ino_t inode); | |
9605 | extern void ext2fs_fast_unmark_inode_bitmap(ext2fs_inode_bitmap bitmap, | |
9606 | ext2_ino_t inode); | |
9607 | extern int ext2fs_fast_test_inode_bitmap(ext2fs_inode_bitmap bitmap, | |
9608 | ext2_ino_t inode); | |
9609 | extern blk_t ext2fs_get_block_bitmap_start(ext2fs_block_bitmap bitmap); | |
9610 | extern ext2_ino_t ext2fs_get_inode_bitmap_start(ext2fs_inode_bitmap bitmap); | |
9611 | extern blk_t ext2fs_get_block_bitmap_end(ext2fs_block_bitmap bitmap); | |
9612 | extern ext2_ino_t ext2fs_get_inode_bitmap_end(ext2fs_inode_bitmap bitmap); | |
9613 | ||
9614 | extern void ext2fs_mark_block_bitmap_range(ext2fs_block_bitmap bitmap, | |
9615 | blk_t block, int num); | |
9616 | extern void ext2fs_unmark_block_bitmap_range(ext2fs_block_bitmap bitmap, | |
9617 | blk_t block, int num); | |
9618 | extern int ext2fs_test_block_bitmap_range(ext2fs_block_bitmap bitmap, | |
9619 | blk_t block, int num); | |
9620 | extern void ext2fs_fast_mark_block_bitmap_range(ext2fs_block_bitmap bitmap, | |
9621 | blk_t block, int num); | |
9622 | extern void ext2fs_fast_unmark_block_bitmap_range(ext2fs_block_bitmap bitmap, | |
9623 | blk_t block, int num); | |
9624 | extern int ext2fs_fast_test_block_bitmap_range(ext2fs_block_bitmap bitmap, | |
9625 | blk_t block, int num); | |
9626 | extern void ext2fs_set_bitmap_padding(ext2fs_generic_bitmap map); | |
9627 | ||
9628 | ||
9629 | extern int ext2fs_mark_generic_bitmap(ext2fs_generic_bitmap bitmap, | |
9630 | __u32 bitno); | |
9631 | extern int ext2fs_unmark_generic_bitmap(ext2fs_generic_bitmap bitmap, | |
9632 | blk_t bitno); | |
9633 | # 133 "../lib/ext2fs/bitops.h" | |
9634 | #define _INLINE_ extern __inline__ | |
9635 | # 144 "../lib/ext2fs/bitops.h" | |
9636 | extern __inline__ void ext2fs_fast_set_bit(unsigned int nr,void * addr) | |
9637 | { | |
9638 | unsigned char *ADDR = (unsigned char *) addr; | |
9639 | ||
9640 | ADDR += nr >> 3; | |
9641 | *ADDR |= (1 << (nr & 0x07)); | |
9642 | } | |
9643 | ||
9644 | extern __inline__ void ext2fs_fast_clear_bit(unsigned int nr, void * addr) | |
9645 | { | |
9646 | unsigned char *ADDR = (unsigned char *) addr; | |
9647 | ||
9648 | ADDR += nr >> 3; | |
9649 | *ADDR &= ~(1 << (nr & 0x07)); | |
9650 | } | |
9651 | ||
9652 | ||
9653 | ||
9654 | ||
9655 | ||
9656 | #define _EXT2_HAVE_ASM_BITOPS_ | |
9657 | #define _EXT2_HAVE_ASM_SWAB_ | |
9658 | #define _EXT2_HAVE_ASM_FINDBIT_ | |
9659 | # 179 "../lib/ext2fs/bitops.h" | |
9660 | struct __dummy_h { unsigned long a[100]; }; | |
9661 | #define EXT2FS_ADDR (*(struct __dummy_h *) addr) | |
9662 | #define EXT2FS_CONST_ADDR (*(const struct __dummy_h *) addr) | |
9663 | ||
9664 | extern __inline__ int ext2fs_set_bit(unsigned int nr, void * addr) | |
9665 | { | |
9666 | int oldbit; | |
9667 | ||
9668 | addr = (void *) (((unsigned char *) addr) + (nr >> 3)); | |
9669 | __asm__ __volatile__("btsl %2,%1\n\tsbbl %0,%0" | |
9670 | :"=r" (oldbit),"+m" ((*(struct __dummy_h *) addr)) | |
9671 | :"r" (nr & 7)); | |
9672 | return oldbit; | |
9673 | } | |
9674 | ||
9675 | extern __inline__ int ext2fs_clear_bit(unsigned int nr, void * addr) | |
9676 | { | |
9677 | int oldbit; | |
9678 | ||
9679 | addr = (void *) (((unsigned char *) addr) + (nr >> 3)); | |
9680 | __asm__ __volatile__("btrl %2,%1\n\tsbbl %0,%0" | |
9681 | :"=r" (oldbit),"+m" ((*(struct __dummy_h *) addr)) | |
9682 | :"r" (nr & 7)); | |
9683 | return oldbit; | |
9684 | } | |
9685 | ||
9686 | extern __inline__ int ext2fs_test_bit(unsigned int nr, const void * addr) | |
9687 | { | |
9688 | int oldbit; | |
9689 | ||
9690 | addr = (const void *) (((const unsigned char *) addr) + (nr >> 3)); | |
9691 | __asm__ __volatile__("btl %2,%1\n\tsbbl %0,%0" | |
9692 | :"=r" (oldbit) | |
9693 | :"m" ((*(const struct __dummy_h *) addr)),"r" (nr & 7)); | |
9694 | return oldbit; | |
9695 | } | |
9696 | # 271 "../lib/ext2fs/bitops.h" | |
9697 | extern __inline__ __u32 ext2fs_swab32(__u32 val) | |
9698 | { | |
9699 | ||
9700 | ||
9701 | ||
9702 | __asm__("xchgb %b0,%h0\n\t" | |
9703 | "rorl $16,%0\n\t" | |
9704 | "xchgb %b0,%h0" | |
9705 | :"=q" (val) | |
9706 | : "0" (val)); | |
9707 | ||
9708 | return val; | |
9709 | } | |
9710 | ||
9711 | extern __inline__ __u16 ext2fs_swab16(__u16 val) | |
9712 | { | |
9713 | __asm__("xchgb %b0,%h0" : "=q" (val) : "0" (val)); return val; | |
9714 | ||
9715 | ||
9716 | ||
9717 | } | |
9718 | ||
9719 | extern __inline__ __u64 ext2fs_swab64(__u64 val) | |
9720 | { | |
9721 | return (ext2fs_swab32(val >> 32) | | |
9722 | (((__u64)ext2fs_swab32(val & 0xFFFFFFFFUL)) << 32)); | |
9723 | } | |
9724 | ||
9725 | ||
9726 | #undef EXT2FS_ADDR | |
9727 | # 404 "../lib/ext2fs/bitops.h" | |
9728 | extern __inline__ int ext2fs_test_generic_bitmap(ext2fs_generic_bitmap bitmap, | |
9729 | blk_t bitno); | |
9730 | ||
9731 | extern __inline__ int ext2fs_test_generic_bitmap(ext2fs_generic_bitmap bitmap, | |
9732 | blk_t bitno) | |
9733 | { | |
9734 | if ((bitno < bitmap->start) || (bitno > bitmap->end)) { | |
9735 | ext2fs_warn_bitmap2(bitmap, 2, bitno); | |
9736 | return 0; | |
9737 | } | |
9738 | return ext2fs_test_bit(bitno - bitmap->start, bitmap->bitmap); | |
9739 | } | |
9740 | ||
9741 | extern __inline__ int ext2fs_mark_block_bitmap(ext2fs_block_bitmap bitmap, | |
9742 | blk_t block) | |
9743 | { | |
9744 | return ext2fs_mark_generic_bitmap((ext2fs_generic_bitmap) | |
9745 | bitmap, | |
9746 | block); | |
9747 | } | |
9748 | ||
9749 | extern __inline__ int ext2fs_unmark_block_bitmap(ext2fs_block_bitmap bitmap, | |
9750 | blk_t block) | |
9751 | { | |
9752 | return ext2fs_unmark_generic_bitmap((ext2fs_generic_bitmap) bitmap, | |
9753 | block); | |
9754 | } | |
9755 | ||
9756 | extern __inline__ int ext2fs_test_block_bitmap(ext2fs_block_bitmap bitmap, | |
9757 | blk_t block) | |
9758 | { | |
9759 | return ext2fs_test_generic_bitmap((ext2fs_generic_bitmap) bitmap, | |
9760 | block); | |
9761 | } | |
9762 | ||
9763 | extern __inline__ int ext2fs_mark_inode_bitmap(ext2fs_inode_bitmap bitmap, | |
9764 | ext2_ino_t inode) | |
9765 | { | |
9766 | return ext2fs_mark_generic_bitmap((ext2fs_generic_bitmap) bitmap, | |
9767 | inode); | |
9768 | } | |
9769 | ||
9770 | extern __inline__ int ext2fs_unmark_inode_bitmap(ext2fs_inode_bitmap bitmap, | |
9771 | ext2_ino_t inode) | |
9772 | { | |
9773 | return ext2fs_unmark_generic_bitmap((ext2fs_generic_bitmap) bitmap, | |
9774 | inode); | |
9775 | } | |
9776 | ||
9777 | extern __inline__ int ext2fs_test_inode_bitmap(ext2fs_inode_bitmap bitmap, | |
9778 | ext2_ino_t inode) | |
9779 | { | |
9780 | return ext2fs_test_generic_bitmap((ext2fs_generic_bitmap) bitmap, | |
9781 | inode); | |
9782 | } | |
9783 | ||
9784 | extern __inline__ void ext2fs_fast_mark_block_bitmap(ext2fs_block_bitmap bitmap, | |
9785 | blk_t block) | |
9786 | { | |
9787 | ||
9788 | ||
9789 | ||
9790 | ||
9791 | ||
9792 | ||
9793 | ||
9794 | ext2fs_fast_set_bit(block - bitmap->start, bitmap->bitmap); | |
9795 | } | |
9796 | ||
9797 | extern __inline__ void ext2fs_fast_unmark_block_bitmap(ext2fs_block_bitmap bitmap, | |
9798 | blk_t block) | |
9799 | { | |
9800 | ||
9801 | ||
9802 | ||
9803 | ||
9804 | ||
9805 | ||
9806 | ||
9807 | ext2fs_fast_clear_bit(block - bitmap->start, bitmap->bitmap); | |
9808 | } | |
9809 | ||
9810 | extern __inline__ int ext2fs_fast_test_block_bitmap(ext2fs_block_bitmap bitmap, | |
9811 | blk_t block) | |
9812 | { | |
9813 | ||
9814 | ||
9815 | ||
9816 | ||
9817 | ||
9818 | ||
9819 | ||
9820 | return ext2fs_test_bit(block - bitmap->start, bitmap->bitmap); | |
9821 | } | |
9822 | ||
9823 | extern __inline__ void ext2fs_fast_mark_inode_bitmap(ext2fs_inode_bitmap bitmap, | |
9824 | ext2_ino_t inode) | |
9825 | { | |
9826 | ||
9827 | ||
9828 | ||
9829 | ||
9830 | ||
9831 | ||
9832 | ||
9833 | ext2fs_fast_set_bit(inode - bitmap->start, bitmap->bitmap); | |
9834 | } | |
9835 | ||
9836 | extern __inline__ void ext2fs_fast_unmark_inode_bitmap(ext2fs_inode_bitmap bitmap, | |
9837 | ext2_ino_t inode) | |
9838 | { | |
9839 | ||
9840 | ||
9841 | ||
9842 | ||
9843 | ||
9844 | ||
9845 | ||
9846 | ext2fs_fast_clear_bit(inode - bitmap->start, bitmap->bitmap); | |
9847 | } | |
9848 | ||
9849 | extern __inline__ int ext2fs_fast_test_inode_bitmap(ext2fs_inode_bitmap bitmap, | |
9850 | ext2_ino_t inode) | |
9851 | { | |
9852 | ||
9853 | ||
9854 | ||
9855 | ||
9856 | ||
9857 | ||
9858 | ||
9859 | return ext2fs_test_bit(inode - bitmap->start, bitmap->bitmap); | |
9860 | } | |
9861 | ||
9862 | extern __inline__ blk_t ext2fs_get_block_bitmap_start(ext2fs_block_bitmap bitmap) | |
9863 | { | |
9864 | return bitmap->start; | |
9865 | } | |
9866 | ||
9867 | extern __inline__ ext2_ino_t ext2fs_get_inode_bitmap_start(ext2fs_inode_bitmap bitmap) | |
9868 | { | |
9869 | return bitmap->start; | |
9870 | } | |
9871 | ||
9872 | extern __inline__ blk_t ext2fs_get_block_bitmap_end(ext2fs_block_bitmap bitmap) | |
9873 | { | |
9874 | return bitmap->end; | |
9875 | } | |
9876 | ||
9877 | extern __inline__ ext2_ino_t ext2fs_get_inode_bitmap_end(ext2fs_inode_bitmap bitmap) | |
9878 | { | |
9879 | return bitmap->end; | |
9880 | } | |
9881 | ||
9882 | extern __inline__ int ext2fs_test_block_bitmap_range(ext2fs_block_bitmap bitmap, | |
9883 | blk_t block, int num) | |
9884 | { | |
9885 | int i; | |
9886 | ||
9887 | if ((block < bitmap->start) || (block+num-1 > bitmap->end)) { | |
9888 | ext2fs_warn_bitmap((2133571375L), | |
9889 | block, bitmap->description); | |
9890 | return 0; | |
9891 | } | |
9892 | for (i=0; i < num; i++) { | |
9893 | if (ext2fs_fast_test_block_bitmap(bitmap, block+i)) | |
9894 | return 0; | |
9895 | } | |
9896 | return 1; | |
9897 | } | |
9898 | ||
9899 | extern __inline__ int ext2fs_fast_test_block_bitmap_range(ext2fs_block_bitmap bitmap, | |
9900 | blk_t block, int num) | |
9901 | { | |
9902 | int i; | |
9903 | # 587 "../lib/ext2fs/bitops.h" | |
9904 | for (i=0; i < num; i++) { | |
9905 | if (ext2fs_fast_test_block_bitmap(bitmap, block+i)) | |
9906 | return 0; | |
9907 | } | |
9908 | return 1; | |
9909 | } | |
9910 | ||
9911 | extern __inline__ void ext2fs_mark_block_bitmap_range(ext2fs_block_bitmap bitmap, | |
9912 | blk_t block, int num) | |
9913 | { | |
9914 | int i; | |
9915 | ||
9916 | if ((block < bitmap->start) || (block+num-1 > bitmap->end)) { | |
9917 | ext2fs_warn_bitmap((2133571373L), block, | |
9918 | bitmap->description); | |
9919 | return; | |
9920 | } | |
9921 | for (i=0; i < num; i++) | |
9922 | ext2fs_fast_set_bit(block + i - bitmap->start, bitmap->bitmap); | |
9923 | } | |
9924 | ||
9925 | extern __inline__ void ext2fs_fast_mark_block_bitmap_range(ext2fs_block_bitmap bitmap, | |
9926 | blk_t block, int num) | |
9927 | { | |
9928 | int i; | |
9929 | # 620 "../lib/ext2fs/bitops.h" | |
9930 | for (i=0; i < num; i++) | |
9931 | ext2fs_fast_set_bit(block + i - bitmap->start, bitmap->bitmap); | |
9932 | } | |
9933 | ||
9934 | extern __inline__ void ext2fs_unmark_block_bitmap_range(ext2fs_block_bitmap bitmap, | |
9935 | blk_t block, int num) | |
9936 | { | |
9937 | int i; | |
9938 | ||
9939 | if ((block < bitmap->start) || (block+num-1 > bitmap->end)) { | |
9940 | ext2fs_warn_bitmap((2133571374L), block, | |
9941 | bitmap->description); | |
9942 | return; | |
9943 | } | |
9944 | for (i=0; i < num; i++) | |
9945 | ext2fs_fast_clear_bit(block + i - bitmap->start, | |
9946 | bitmap->bitmap); | |
9947 | } | |
9948 | ||
9949 | extern __inline__ void ext2fs_fast_unmark_block_bitmap_range(ext2fs_block_bitmap bitmap, | |
9950 | blk_t block, int num) | |
9951 | { | |
9952 | int i; | |
9953 | # 651 "../lib/ext2fs/bitops.h" | |
9954 | for (i=0; i < num; i++) | |
9955 | ext2fs_fast_clear_bit(block + i - bitmap->start, | |
9956 | bitmap->bitmap); | |
9957 | } | |
9958 | #undef _INLINE_ | |
9959 | # 254 "../lib/ext2fs/ext2fs.h" 2 | |
9960 | ||
9961 | ||
9962 | ||
9963 | ||
9964 | ||
9965 | #define BLOCK_CHANGED 1 | |
9966 | #define BLOCK_ABORT 2 | |
9967 | #define BLOCK_ERROR 4 | |
9968 | # 284 "../lib/ext2fs/ext2fs.h" | |
9969 | #define BLOCK_FLAG_APPEND 1 | |
9970 | #define BLOCK_FLAG_HOLE 1 | |
9971 | #define BLOCK_FLAG_DEPTH_TRAVERSE 2 | |
9972 | #define BLOCK_FLAG_DATA_ONLY 4 | |
9973 | ||
9974 | #define BLOCK_FLAG_NO_LARGE 0x1000 | |
9975 | ||
9976 | ||
9977 | ||
9978 | ||
9979 | #define BLOCK_COUNT_IND (-1) | |
9980 | #define BLOCK_COUNT_DIND (-2) | |
9981 | #define BLOCK_COUNT_TIND (-3) | |
9982 | #define BLOCK_COUNT_TRANSLATOR (-4) | |
9983 | # 310 "../lib/ext2fs/ext2fs.h" | |
9984 | #define EXT2_DIRBLOCK_V2_STRUCT 0x0001 | |
9985 | ||
9986 | ||
9987 | ||
9988 | ||
9989 | #define DIRENT_CHANGED 1 | |
9990 | #define DIRENT_ABORT 2 | |
9991 | #define DIRENT_ERROR 3 | |
9992 | ||
9993 | ||
9994 | ||
9995 | ||
9996 | ||
9997 | #define DIRENT_FLAG_INCLUDE_EMPTY 1 | |
9998 | #define DIRENT_FLAG_INCLUDE_REMOVED 2 | |
9999 | ||
10000 | #define DIRENT_DOT_FILE 1 | |
10001 | #define DIRENT_DOT_DOT_FILE 2 | |
10002 | #define DIRENT_OTHER_FILE 3 | |
10003 | #define DIRENT_DELETED_FILE 4 | |
10004 | ||
10005 | ||
10006 | ||
10007 | ||
10008 | typedef struct ext2_struct_inode_scan *ext2_inode_scan; | |
10009 | ||
10010 | ||
10011 | ||
10012 | ||
10013 | #define EXT2_SF_CHK_BADBLOCKS 0x0001 | |
10014 | #define EXT2_SF_BAD_INODE_BLK 0x0002 | |
10015 | #define EXT2_SF_BAD_EXTRA_BYTES 0x0004 | |
10016 | #define EXT2_SF_SKIP_MISSING_ITABLE 0x0008 | |
10017 | #define EXT2_SF_DO_LAZY 0x0010 | |
10018 | ||
10019 | ||
10020 | ||
10021 | ||
10022 | #define EXT2_MF_MOUNTED 1 | |
10023 | #define EXT2_MF_ISROOT 2 | |
10024 | #define EXT2_MF_READONLY 4 | |
10025 | #define EXT2_MF_SWAP 8 | |
10026 | #define EXT2_MF_BUSY 16 | |
10027 | ||
10028 | ||
10029 | ||
10030 | ||
10031 | ||
10032 | ||
10033 | #define LINUX_S_IFMT 00170000 | |
10034 | #define LINUX_S_IFSOCK 0140000 | |
10035 | #define LINUX_S_IFLNK 0120000 | |
10036 | #define LINUX_S_IFREG 0100000 | |
10037 | #define LINUX_S_IFBLK 0060000 | |
10038 | #define LINUX_S_IFDIR 0040000 | |
10039 | #define LINUX_S_IFCHR 0020000 | |
10040 | #define LINUX_S_IFIFO 0010000 | |
10041 | #define LINUX_S_ISUID 0004000 | |
10042 | #define LINUX_S_ISGID 0002000 | |
10043 | #define LINUX_S_ISVTX 0001000 | |
10044 | ||
10045 | #define LINUX_S_IRWXU 00700 | |
10046 | #define LINUX_S_IRUSR 00400 | |
10047 | #define LINUX_S_IWUSR 00200 | |
10048 | #define LINUX_S_IXUSR 00100 | |
10049 | ||
10050 | #define LINUX_S_IRWXG 00070 | |
10051 | #define LINUX_S_IRGRP 00040 | |
10052 | #define LINUX_S_IWGRP 00020 | |
10053 | #define LINUX_S_IXGRP 00010 | |
10054 | ||
10055 | #define LINUX_S_IRWXO 00007 | |
10056 | #define LINUX_S_IROTH 00004 | |
10057 | #define LINUX_S_IWOTH 00002 | |
10058 | #define LINUX_S_IXOTH 00001 | |
10059 | ||
10060 | #define LINUX_S_ISLNK(m) (((m) & LINUX_S_IFMT) == LINUX_S_IFLNK) | |
10061 | #define LINUX_S_ISREG(m) (((m) & LINUX_S_IFMT) == LINUX_S_IFREG) | |
10062 | #define LINUX_S_ISDIR(m) (((m) & LINUX_S_IFMT) == LINUX_S_IFDIR) | |
10063 | #define LINUX_S_ISCHR(m) (((m) & LINUX_S_IFMT) == LINUX_S_IFCHR) | |
10064 | #define LINUX_S_ISBLK(m) (((m) & LINUX_S_IFMT) == LINUX_S_IFBLK) | |
10065 | #define LINUX_S_ISFIFO(m) (((m) & LINUX_S_IFMT) == LINUX_S_IFIFO) | |
10066 | #define LINUX_S_ISSOCK(m) (((m) & LINUX_S_IFMT) == LINUX_S_IFSOCK) | |
10067 | ||
10068 | ||
10069 | ||
10070 | ||
10071 | #define EXT2_I_SIZE(i) ((i)->i_size | ((__u64) (i)->i_size_high << 32)) | |
10072 | ||
10073 | ||
10074 | ||
10075 | ||
10076 | #define EXT2_ICOUNT_OPT_INCREMENT 0x01 | |
10077 | ||
10078 | typedef struct ext2_icount *ext2_icount_t; | |
10079 | ||
10080 | ||
10081 | ||
10082 | ||
10083 | #define BMAP_ALLOC 0x0001 | |
10084 | #define BMAP_SET 0x0002 | |
10085 | ||
10086 | ||
10087 | ||
10088 | ||
10089 | #define IMAGER_FLAG_INODEMAP 1 | |
10090 | #define IMAGER_FLAG_SPARSEWRITE 2 | |
10091 | ||
10092 | ||
10093 | ||
10094 | ||
10095 | ||
10096 | #define EXT2_CHECK_MAGIC(struct,code) if ((struct)->magic != (code)) return (code) | |
10097 | ||
10098 | ||
10099 | ||
10100 | ||
10101 | ||
10102 | ||
10103 | #define EXT2FS_COMPRESSED_BLKADDR ((blk_t) 0xffffffff) | |
10104 | #define HOLE_BLKADDR(_b) ((_b) == 0 || (_b) == EXT2FS_COMPRESSED_BLKADDR) | |
10105 | ||
10106 | ||
10107 | ||
10108 | ||
10109 | #define EXT2_LIB_FEATURE_COMPAT_SUPP (EXT2_FEATURE_COMPAT_DIR_PREALLOC| EXT2_FEATURE_COMPAT_IMAGIC_INODES| EXT3_FEATURE_COMPAT_HAS_JOURNAL| EXT2_FEATURE_COMPAT_RESIZE_INODE| EXT2_FEATURE_COMPAT_DIR_INDEX| EXT2_FEATURE_COMPAT_LAZY_BG| EXT2_FEATURE_COMPAT_EXT_ATTR) | |
10110 | # 457 "../lib/ext2fs/ext2fs.h" | |
10111 | #define EXT2_LIB_FEATURE_INCOMPAT_SUPP (EXT2_FEATURE_INCOMPAT_FILETYPE| EXT3_FEATURE_INCOMPAT_JOURNAL_DEV| EXT2_FEATURE_INCOMPAT_META_BG| EXT3_FEATURE_INCOMPAT_RECOVER) | |
10112 | ||
10113 | ||
10114 | ||
10115 | ||
10116 | #define EXT2_LIB_FEATURE_RO_COMPAT_SUPP (EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER| EXT2_FEATURE_RO_COMPAT_LARGE_FILE) | |
10117 | ||
10118 | ||
10119 | ||
10120 | ||
10121 | ||
10122 | ||
10123 | #define EXT2_LIB_SOFTSUPP_INCOMPAT (EXT3_FEATURE_INCOMPAT_EXTENTS) | |
10124 | #define EXT2_LIB_SOFTSUPP_RO_COMPAT (EXT4_FEATURE_RO_COMPAT_HUGE_FILE| EXT4_FEATURE_RO_COMPAT_GDT_CSUM| EXT4_FEATURE_RO_COMPAT_DIR_NLINK| EXT4_FEATURE_RO_COMPAT_EXTRA_ISIZE) | |
10125 | # 480 "../lib/ext2fs/ext2fs.h" | |
10126 | extern errcode_t ext2fs_new_inode(ext2_filsys fs, ext2_ino_t dir, int mode, | |
10127 | ext2fs_inode_bitmap map, ext2_ino_t *ret); | |
10128 | extern errcode_t ext2fs_new_block(ext2_filsys fs, blk_t goal, | |
10129 | ext2fs_block_bitmap map, blk_t *ret); | |
10130 | extern errcode_t ext2fs_get_free_blocks(ext2_filsys fs, blk_t start, | |
10131 | blk_t finish, int num, | |
10132 | ext2fs_block_bitmap map, | |
10133 | blk_t *ret); | |
10134 | extern errcode_t ext2fs_alloc_block(ext2_filsys fs, blk_t goal, | |
10135 | char *block_buf, blk_t *ret); | |
10136 | ||
10137 | ||
10138 | extern int ext2fs_reserve_super_and_bgd(ext2_filsys fs, | |
10139 | dgrp_t group, | |
10140 | ext2fs_block_bitmap bmap); | |
10141 | ||
10142 | ||
10143 | void ext2fs_inode_alloc_stats(ext2_filsys fs, ext2_ino_t ino, int inuse); | |
10144 | void ext2fs_inode_alloc_stats2(ext2_filsys fs, ext2_ino_t ino, | |
10145 | int inuse, int isdir); | |
10146 | void ext2fs_block_alloc_stats(ext2_filsys fs, blk_t blk, int inuse); | |
10147 | ||
10148 | ||
10149 | extern errcode_t ext2fs_allocate_tables(ext2_filsys fs); | |
10150 | extern errcode_t ext2fs_allocate_group_table(ext2_filsys fs, dgrp_t group, | |
10151 | ext2fs_block_bitmap bmap); | |
10152 | ||
10153 | ||
10154 | extern errcode_t ext2fs_u32_list_create(ext2_u32_list *ret, int size); | |
10155 | extern errcode_t ext2fs_u32_list_add(ext2_u32_list bb, __u32 blk); | |
10156 | extern int ext2fs_u32_list_find(ext2_u32_list bb, __u32 blk); | |
10157 | extern int ext2fs_u32_list_test(ext2_u32_list bb, blk_t blk); | |
10158 | extern errcode_t ext2fs_u32_list_iterate_begin(ext2_u32_list bb, | |
10159 | ext2_u32_iterate *ret); | |
10160 | extern int ext2fs_u32_list_iterate(ext2_u32_iterate iter, blk_t *blk); | |
10161 | extern void ext2fs_u32_list_iterate_end(ext2_u32_iterate iter); | |
10162 | extern errcode_t ext2fs_u32_copy(ext2_u32_list src, ext2_u32_list *dest); | |
10163 | extern int ext2fs_u32_list_equal(ext2_u32_list bb1, ext2_u32_list bb2); | |
10164 | ||
10165 | extern errcode_t ext2fs_badblocks_list_create(ext2_badblocks_list *ret, | |
10166 | int size); | |
10167 | extern errcode_t ext2fs_badblocks_list_add(ext2_badblocks_list bb, | |
10168 | blk_t blk); | |
10169 | extern int ext2fs_badblocks_list_test(ext2_badblocks_list bb, | |
10170 | blk_t blk); | |
10171 | extern int ext2fs_u32_list_del(ext2_u32_list bb, __u32 blk); | |
10172 | extern void ext2fs_badblocks_list_del(ext2_u32_list bb, __u32 blk); | |
10173 | extern errcode_t | |
10174 | ext2fs_badblocks_list_iterate_begin(ext2_badblocks_list bb, | |
10175 | ext2_badblocks_iterate *ret); | |
10176 | extern int ext2fs_badblocks_list_iterate(ext2_badblocks_iterate iter, | |
10177 | blk_t *blk); | |
10178 | extern void ext2fs_badblocks_list_iterate_end(ext2_badblocks_iterate iter); | |
10179 | extern errcode_t ext2fs_badblocks_copy(ext2_badblocks_list src, | |
10180 | ext2_badblocks_list *dest); | |
10181 | extern int ext2fs_badblocks_equal(ext2_badblocks_list bb1, | |
10182 | ext2_badblocks_list bb2); | |
10183 | extern int ext2fs_u32_list_count(ext2_u32_list bb); | |
10184 | ||
10185 | ||
10186 | extern errcode_t badblocks_list_create(badblocks_list *ret, int size); | |
10187 | extern errcode_t badblocks_list_add(badblocks_list bb, blk_t blk); | |
10188 | extern int badblocks_list_test(badblocks_list bb, blk_t blk); | |
10189 | extern errcode_t badblocks_list_iterate_begin(badblocks_list bb, | |
10190 | badblocks_iterate *ret); | |
10191 | extern int badblocks_list_iterate(badblocks_iterate iter, blk_t *blk); | |
10192 | extern void badblocks_list_iterate_end(badblocks_iterate iter); | |
10193 | extern void badblocks_list_free(badblocks_list bb); | |
10194 | ||
10195 | ||
10196 | extern errcode_t ext2fs_update_bb_inode(ext2_filsys fs, | |
10197 | ext2_badblocks_list bb_list); | |
10198 | ||
10199 | ||
10200 | extern errcode_t ext2fs_write_inode_bitmap(ext2_filsys fs); | |
10201 | extern errcode_t ext2fs_write_block_bitmap (ext2_filsys fs); | |
10202 | extern errcode_t ext2fs_read_inode_bitmap (ext2_filsys fs); | |
10203 | extern errcode_t ext2fs_read_block_bitmap(ext2_filsys fs); | |
10204 | extern errcode_t ext2fs_allocate_generic_bitmap(__u32 start, | |
10205 | __u32 end, | |
10206 | __u32 real_end, | |
10207 | const char *descr, | |
10208 | ext2fs_generic_bitmap *ret); | |
10209 | extern errcode_t ext2fs_allocate_block_bitmap(ext2_filsys fs, | |
10210 | const char *descr, | |
10211 | ext2fs_block_bitmap *ret); | |
10212 | extern errcode_t ext2fs_allocate_inode_bitmap(ext2_filsys fs, | |
10213 | const char *descr, | |
10214 | ext2fs_inode_bitmap *ret); | |
10215 | extern errcode_t ext2fs_fudge_inode_bitmap_end(ext2fs_inode_bitmap bitmap, | |
10216 | ext2_ino_t end, ext2_ino_t *oend); | |
10217 | extern errcode_t ext2fs_fudge_block_bitmap_end(ext2fs_block_bitmap bitmap, | |
10218 | blk_t end, blk_t *oend); | |
10219 | extern void ext2fs_clear_inode_bitmap(ext2fs_inode_bitmap bitmap); | |
10220 | extern void ext2fs_clear_block_bitmap(ext2fs_block_bitmap bitmap); | |
10221 | extern errcode_t ext2fs_read_bitmaps(ext2_filsys fs); | |
10222 | extern errcode_t ext2fs_write_bitmaps(ext2_filsys fs); | |
10223 | ||
10224 | ||
10225 | extern errcode_t ext2fs_block_iterate(ext2_filsys fs, | |
10226 | ext2_ino_t ino, | |
10227 | int flags, | |
10228 | char *block_buf, | |
10229 | int (*func)(ext2_filsys fs, | |
10230 | blk_t *blocknr, | |
10231 | int blockcnt, | |
10232 | void *priv_data), | |
10233 | void *priv_data); | |
10234 | errcode_t ext2fs_block_iterate2(ext2_filsys fs, | |
10235 | ext2_ino_t ino, | |
10236 | int flags, | |
10237 | char *block_buf, | |
10238 | int (*func)(ext2_filsys fs, | |
10239 | blk_t *blocknr, | |
10240 | e2_blkcnt_t blockcnt, | |
10241 | blk_t ref_blk, | |
10242 | int ref_offset, | |
10243 | void *priv_data), | |
10244 | void *priv_data); | |
10245 | ||
10246 | ||
10247 | extern errcode_t ext2fs_bmap(ext2_filsys fs, ext2_ino_t ino, | |
10248 | struct ext2_inode *inode, | |
10249 | char *block_buf, int bmap_flags, | |
10250 | blk_t block, blk_t *phys_blk); | |
10251 | # 616 "../lib/ext2fs/ext2fs.h" | |
10252 | extern errcode_t ext2fs_check_desc(ext2_filsys fs); | |
10253 | ||
10254 | ||
10255 | extern errcode_t ext2fs_close(ext2_filsys fs); | |
10256 | extern errcode_t ext2fs_flush(ext2_filsys fs); | |
10257 | extern int ext2fs_bg_has_super(ext2_filsys fs, int group_block); | |
10258 | extern int ext2fs_super_and_bgd_loc(ext2_filsys fs, | |
10259 | dgrp_t group, | |
10260 | blk_t *ret_super_blk, | |
10261 | blk_t *ret_old_desc_blk, | |
10262 | blk_t *ret_new_desc_blk, | |
10263 | int *ret_meta_bg); | |
10264 | extern void ext2fs_update_dynamic_rev(ext2_filsys fs); | |
10265 | ||
10266 | ||
10267 | extern errcode_t ext2fs_compare_block_bitmap(ext2fs_block_bitmap bm1, | |
10268 | ext2fs_block_bitmap bm2); | |
10269 | extern errcode_t ext2fs_compare_inode_bitmap(ext2fs_inode_bitmap bm1, | |
10270 | ext2fs_inode_bitmap bm2); | |
10271 | ||
10272 | ||
10273 | ||
10274 | extern errcode_t ext2fs_get_num_dirs(ext2_filsys fs, ext2_ino_t *ret_num_dirs); | |
10275 | extern errcode_t ext2fs_init_dblist(ext2_filsys fs, ext2_dblist *ret_dblist); | |
10276 | extern errcode_t ext2fs_add_dir_block(ext2_dblist dblist, ext2_ino_t ino, | |
10277 | blk_t blk, int blockcnt); | |
10278 | extern void ext2fs_dblist_sort(ext2_dblist dblist, | |
10279 | int (*sortfunc)(const void *, | |
10280 | const void *)); | |
10281 | extern errcode_t ext2fs_dblist_iterate(ext2_dblist dblist, | |
10282 | int (*func)(ext2_filsys fs, struct ext2_db_entry *db_info, | |
10283 | void *priv_data), | |
10284 | void *priv_data); | |
10285 | extern errcode_t ext2fs_set_dir_block(ext2_dblist dblist, ext2_ino_t ino, | |
10286 | blk_t blk, int blockcnt); | |
10287 | extern errcode_t ext2fs_copy_dblist(ext2_dblist src, | |
10288 | ext2_dblist *dest); | |
10289 | extern int ext2fs_dblist_count(ext2_dblist dblist); | |
10290 | ||
10291 | ||
10292 | extern errcode_t | |
10293 | ext2fs_dblist_dir_iterate(ext2_dblist dblist, | |
10294 | int flags, | |
10295 | char *block_buf, | |
10296 | int (*func)(ext2_ino_t dir, | |
10297 | int entry, | |
10298 | struct ext2_dir_entry *dirent, | |
10299 | int offset, | |
10300 | int blocksize, | |
10301 | char *buf, | |
10302 | void *priv_data), | |
10303 | void *priv_data); | |
10304 | ||
10305 | ||
10306 | extern errcode_t ext2fs_read_dir_block(ext2_filsys fs, blk_t block, | |
10307 | void *buf); | |
10308 | extern errcode_t ext2fs_read_dir_block2(ext2_filsys fs, blk_t block, | |
10309 | void *buf, int flags); | |
10310 | extern errcode_t ext2fs_write_dir_block(ext2_filsys fs, blk_t block, | |
10311 | void *buf); | |
10312 | extern errcode_t ext2fs_write_dir_block2(ext2_filsys fs, blk_t block, | |
10313 | void *buf, int flags); | |
10314 | ||
10315 | ||
10316 | extern errcode_t ext2fs_dirhash(int version, const char *name, int len, | |
10317 | const __u32 *seed, | |
10318 | ext2_dirhash_t *ret_hash, | |
10319 | ext2_dirhash_t *ret_minor_hash); | |
10320 | ||
10321 | ||
10322 | ||
10323 | extern errcode_t ext2fs_dir_iterate(ext2_filsys fs, | |
10324 | ext2_ino_t dir, | |
10325 | int flags, | |
10326 | char *block_buf, | |
10327 | int (*func)(struct ext2_dir_entry *dirent, | |
10328 | int offset, | |
10329 | int blocksize, | |
10330 | char *buf, | |
10331 | void *priv_data), | |
10332 | void *priv_data); | |
10333 | extern errcode_t ext2fs_dir_iterate2(ext2_filsys fs, | |
10334 | ext2_ino_t dir, | |
10335 | int flags, | |
10336 | char *block_buf, | |
10337 | int (*func)(ext2_ino_t dir, | |
10338 | int entry, | |
10339 | struct ext2_dir_entry *dirent, | |
10340 | int offset, | |
10341 | int blocksize, | |
10342 | char *buf, | |
10343 | void *priv_data), | |
10344 | void *priv_data); | |
10345 | ||
10346 | ||
10347 | extern errcode_t ext2fs_dup_handle(ext2_filsys src, ext2_filsys *dest); | |
10348 | ||
10349 | ||
10350 | extern errcode_t ext2fs_expand_dir(ext2_filsys fs, ext2_ino_t dir); | |
10351 | ||
10352 | ||
10353 | extern errcode_t ext2fs_read_ext_attr(ext2_filsys fs, blk_t block, void *buf); | |
10354 | extern errcode_t ext2fs_write_ext_attr(ext2_filsys fs, blk_t block, | |
10355 | void *buf); | |
10356 | extern errcode_t ext2fs_adjust_ea_refcount(ext2_filsys fs, blk_t blk, | |
10357 | char *block_buf, | |
10358 | int adjust, __u32 *newcount); | |
10359 | ||
10360 | ||
10361 | extern errcode_t ext2fs_file_open2(ext2_filsys fs, ext2_ino_t ino, | |
10362 | struct ext2_inode *inode, | |
10363 | int flags, ext2_file_t *ret); | |
10364 | extern errcode_t ext2fs_file_open(ext2_filsys fs, ext2_ino_t ino, | |
10365 | int flags, ext2_file_t *ret); | |
10366 | extern ext2_filsys ext2fs_file_get_fs(ext2_file_t file); | |
10367 | extern errcode_t ext2fs_file_close(ext2_file_t file); | |
10368 | extern errcode_t ext2fs_file_flush(ext2_file_t file); | |
10369 | extern errcode_t ext2fs_file_read(ext2_file_t file, void *buf, | |
10370 | unsigned int wanted, unsigned int *got); | |
10371 | extern errcode_t ext2fs_file_write(ext2_file_t file, const void *buf, | |
10372 | unsigned int nbytes, unsigned int *written); | |
10373 | extern errcode_t ext2fs_file_llseek(ext2_file_t file, __u64 offset, | |
10374 | int whence, __u64 *ret_pos); | |
10375 | extern errcode_t ext2fs_file_lseek(ext2_file_t file, ext2_off_t offset, | |
10376 | int whence, ext2_off_t *ret_pos); | |
10377 | errcode_t ext2fs_file_get_lsize(ext2_file_t file, __u64 *ret_size); | |
10378 | extern ext2_off_t ext2fs_file_get_size(ext2_file_t file); | |
10379 | extern errcode_t ext2fs_file_set_size(ext2_file_t file, ext2_off_t size); | |
10380 | ||
10381 | ||
10382 | extern char *ext2fs_find_block_device(dev_t device); | |
10383 | ||
10384 | ||
10385 | extern errcode_t ext2fs_sync_device(int fd, int flushb); | |
10386 | ||
10387 | ||
10388 | extern void ext2fs_free(ext2_filsys fs); | |
10389 | extern void ext2fs_free_generic_bitmap(ext2fs_inode_bitmap bitmap); | |
10390 | extern void ext2fs_free_block_bitmap(ext2fs_block_bitmap bitmap); | |
10391 | extern void ext2fs_free_inode_bitmap(ext2fs_inode_bitmap bitmap); | |
10392 | extern void ext2fs_free_dblist(ext2_dblist dblist); | |
10393 | extern void ext2fs_badblocks_list_free(ext2_badblocks_list bb); | |
10394 | extern void ext2fs_u32_list_free(ext2_u32_list bb); | |
10395 | ||
10396 | ||
10397 | extern errcode_t ext2fs_get_device_size(const char *file, int blocksize, | |
10398 | blk_t *retblocks); | |
10399 | ||
10400 | ||
10401 | errcode_t ext2fs_get_device_sectsize(const char *file, int *sectsize); | |
10402 | ||
10403 | ||
10404 | extern errcode_t ext2fs_image_inode_write(ext2_filsys fs, int fd, int flags); | |
10405 | extern errcode_t ext2fs_image_inode_read(ext2_filsys fs, int fd, int flags); | |
10406 | extern errcode_t ext2fs_image_super_write(ext2_filsys fs, int fd, int flags); | |
10407 | extern errcode_t ext2fs_image_super_read(ext2_filsys fs, int fd, int flags); | |
10408 | extern errcode_t ext2fs_image_bitmap_write(ext2_filsys fs, int fd, int flags); | |
10409 | extern errcode_t ext2fs_image_bitmap_read(ext2_filsys fs, int fd, int flags); | |
10410 | ||
10411 | ||
10412 | errcode_t ext2fs_read_ind_block(ext2_filsys fs, blk_t blk, void *buf); | |
10413 | errcode_t ext2fs_write_ind_block(ext2_filsys fs, blk_t blk, void *buf); | |
10414 | ||
10415 | ||
10416 | extern errcode_t ext2fs_initialize(const char *name, int flags, | |
10417 | struct ext2_super_block *param, | |
10418 | io_manager manager, ext2_filsys *ret_fs); | |
10419 | ||
10420 | ||
10421 | extern void ext2fs_free_icount(ext2_icount_t icount); | |
10422 | extern errcode_t ext2fs_create_icount_tdb(ext2_filsys fs, char *tdb_dir, | |
10423 | int flags, ext2_icount_t *ret); | |
10424 | extern errcode_t ext2fs_create_icount2(ext2_filsys fs, int flags, | |
10425 | unsigned int size, | |
10426 | ext2_icount_t hint, ext2_icount_t *ret); | |
10427 | extern errcode_t ext2fs_create_icount(ext2_filsys fs, int flags, | |
10428 | unsigned int size, | |
10429 | ext2_icount_t *ret); | |
10430 | extern errcode_t ext2fs_icount_fetch(ext2_icount_t icount, ext2_ino_t ino, | |
10431 | __u16 *ret); | |
10432 | extern errcode_t ext2fs_icount_increment(ext2_icount_t icount, ext2_ino_t ino, | |
10433 | __u16 *ret); | |
10434 | extern errcode_t ext2fs_icount_decrement(ext2_icount_t icount, ext2_ino_t ino, | |
10435 | __u16 *ret); | |
10436 | extern errcode_t ext2fs_icount_store(ext2_icount_t icount, ext2_ino_t ino, | |
10437 | __u16 count); | |
10438 | extern ext2_ino_t ext2fs_get_icount_size(ext2_icount_t icount); | |
10439 | errcode_t ext2fs_icount_validate(ext2_icount_t icount, FILE *); | |
10440 | ||
10441 | ||
10442 | extern errcode_t ext2fs_flush_icache(ext2_filsys fs); | |
10443 | extern errcode_t ext2fs_get_next_inode_full(ext2_inode_scan scan, | |
10444 | ext2_ino_t *ino, | |
10445 | struct ext2_inode *inode, | |
10446 | int bufsize); | |
10447 | extern errcode_t ext2fs_open_inode_scan(ext2_filsys fs, int buffer_blocks, | |
10448 | ext2_inode_scan *ret_scan); | |
10449 | extern void ext2fs_close_inode_scan(ext2_inode_scan scan); | |
10450 | extern errcode_t ext2fs_get_next_inode(ext2_inode_scan scan, ext2_ino_t *ino, | |
10451 | struct ext2_inode *inode); | |
10452 | extern errcode_t ext2fs_inode_scan_goto_blockgroup(ext2_inode_scan scan, | |
10453 | int group); | |
10454 | extern void ext2fs_set_inode_callback | |
10455 | (ext2_inode_scan scan, | |
10456 | errcode_t (*done_group)(ext2_filsys fs, | |
10457 | ext2_inode_scan scan, | |
10458 | dgrp_t group, | |
10459 | void * priv_data), | |
10460 | void *done_group_data); | |
10461 | extern int ext2fs_inode_scan_flags(ext2_inode_scan scan, int set_flags, | |
10462 | int clear_flags); | |
10463 | extern errcode_t ext2fs_read_inode_full(ext2_filsys fs, ext2_ino_t ino, | |
10464 | struct ext2_inode * inode, | |
10465 | int bufsize); | |
10466 | extern errcode_t ext2fs_read_inode (ext2_filsys fs, ext2_ino_t ino, | |
10467 | struct ext2_inode * inode); | |
10468 | extern errcode_t ext2fs_write_inode_full(ext2_filsys fs, ext2_ino_t ino, | |
10469 | struct ext2_inode * inode, | |
10470 | int bufsize); | |
10471 | extern errcode_t ext2fs_write_inode(ext2_filsys fs, ext2_ino_t ino, | |
10472 | struct ext2_inode * inode); | |
10473 | extern errcode_t ext2fs_write_new_inode(ext2_filsys fs, ext2_ino_t ino, | |
10474 | struct ext2_inode * inode); | |
10475 | extern errcode_t ext2fs_get_blocks(ext2_filsys fs, ext2_ino_t ino, blk_t *blocks); | |
10476 | extern errcode_t ext2fs_check_directory(ext2_filsys fs, ext2_ino_t ino); | |
10477 | ||
10478 | ||
10479 | extern io_manager inode_io_manager; | |
10480 | extern errcode_t ext2fs_inode_io_intern(ext2_filsys fs, ext2_ino_t ino, | |
10481 | char **name); | |
10482 | extern errcode_t ext2fs_inode_io_intern2(ext2_filsys fs, ext2_ino_t ino, | |
10483 | struct ext2_inode *inode, | |
10484 | char **name); | |
10485 | ||
10486 | ||
10487 | extern errcode_t ext2fs_check_if_mounted(const char *file, int *mount_flags); | |
10488 | extern errcode_t ext2fs_check_mount_point(const char *device, int *mount_flags, | |
10489 | char *mtpt, int mtlen); | |
10490 | ||
10491 | ||
10492 | extern errcode_t ext2fs_lookup(ext2_filsys fs, ext2_ino_t dir, const char *name, | |
10493 | int namelen, char *buf, ext2_ino_t *inode); | |
10494 | extern errcode_t ext2fs_namei(ext2_filsys fs, ext2_ino_t root, ext2_ino_t cwd, | |
10495 | const char *name, ext2_ino_t *inode); | |
10496 | errcode_t ext2fs_namei_follow(ext2_filsys fs, ext2_ino_t root, ext2_ino_t cwd, | |
10497 | const char *name, ext2_ino_t *inode); | |
10498 | extern errcode_t ext2fs_follow_link(ext2_filsys fs, ext2_ino_t root, ext2_ino_t cwd, | |
10499 | ext2_ino_t inode, ext2_ino_t *res_inode); | |
10500 | ||
10501 | ||
10502 | int ext2fs_native_flag(void); | |
10503 | ||
10504 | ||
10505 | extern errcode_t ext2fs_new_dir_block(ext2_filsys fs, ext2_ino_t dir_ino, | |
10506 | ext2_ino_t parent_ino, char **block); | |
10507 | ||
10508 | ||
10509 | extern errcode_t ext2fs_mkdir(ext2_filsys fs, ext2_ino_t parent, ext2_ino_t inum, | |
10510 | const char *name); | |
10511 | ||
10512 | ||
10513 | extern errcode_t ext2fs_create_journal_superblock(ext2_filsys fs, | |
10514 | __u32 size, int flags, | |
10515 | char **ret_jsb); | |
10516 | extern errcode_t ext2fs_add_journal_device(ext2_filsys fs, | |
10517 | ext2_filsys journal_dev); | |
10518 | extern errcode_t ext2fs_add_journal_inode(ext2_filsys fs, blk_t size, | |
10519 | int flags); | |
10520 | extern int ext2fs_default_journal_size(__u64 blocks); | |
10521 | ||
10522 | ||
10523 | extern errcode_t ext2fs_open(const char *name, int flags, int superblock, | |
10524 | unsigned int block_size, io_manager manager, | |
10525 | ext2_filsys *ret_fs); | |
10526 | extern errcode_t ext2fs_open2(const char *name, const char *io_options, | |
10527 | int flags, int superblock, | |
10528 | unsigned int block_size, io_manager manager, | |
10529 | ext2_filsys *ret_fs); | |
10530 | extern blk_t ext2fs_descriptor_block_loc(ext2_filsys fs, blk_t group_block, | |
10531 | dgrp_t i); | |
10532 | errcode_t ext2fs_get_data_io(ext2_filsys fs, io_channel *old_io); | |
10533 | errcode_t ext2fs_set_data_io(ext2_filsys fs, io_channel new_io); | |
10534 | errcode_t ext2fs_rewrite_to_io(ext2_filsys fs, io_channel new_io); | |
10535 | ||
10536 | ||
10537 | extern errcode_t ext2fs_get_pathname(ext2_filsys fs, ext2_ino_t dir, ext2_ino_t ino, | |
10538 | char **name); | |
10539 | ||
10540 | ||
10541 | errcode_t ext2fs_link(ext2_filsys fs, ext2_ino_t dir, const char *name, | |
10542 | ext2_ino_t ino, int flags); | |
10543 | errcode_t ext2fs_unlink(ext2_filsys fs, ext2_ino_t dir, const char *name, | |
10544 | ext2_ino_t ino, int flags); | |
10545 | ||
10546 | ||
10547 | extern errcode_t ext2fs_read_bb_inode(ext2_filsys fs, | |
10548 | ext2_badblocks_list *bb_list); | |
10549 | ||
10550 | ||
10551 | extern errcode_t ext2fs_read_bb_FILE2(ext2_filsys fs, FILE *f, | |
10552 | ext2_badblocks_list *bb_list, | |
10553 | void *priv_data, | |
10554 | void (*invalid)(ext2_filsys fs, | |
10555 | blk_t blk, | |
10556 | char *badstr, | |
10557 | void *priv_data)); | |
10558 | extern errcode_t ext2fs_read_bb_FILE(ext2_filsys fs, FILE *f, | |
10559 | ext2_badblocks_list *bb_list, | |
10560 | void (*invalid)(ext2_filsys fs, | |
10561 | blk_t blk)); | |
10562 | ||
10563 | ||
10564 | extern errcode_t ext2fs_create_resize_inode(ext2_filsys fs); | |
10565 | ||
10566 | ||
10567 | extern errcode_t ext2fs_resize_generic_bitmap(__u32 new_end, | |
10568 | __u32 new_real_end, | |
10569 | ext2fs_generic_bitmap bmap); | |
10570 | extern errcode_t ext2fs_resize_inode_bitmap(__u32 new_end, __u32 new_real_end, | |
10571 | ext2fs_inode_bitmap bmap); | |
10572 | extern errcode_t ext2fs_resize_block_bitmap(__u32 new_end, __u32 new_real_end, | |
10573 | ext2fs_block_bitmap bmap); | |
10574 | extern errcode_t ext2fs_copy_bitmap(ext2fs_generic_bitmap src, | |
10575 | ext2fs_generic_bitmap *dest); | |
10576 | ||
10577 | ||
10578 | extern void ext2fs_swap_ext_attr(char *to, char *from, int bufsize, | |
10579 | int has_header); | |
10580 | extern void ext2fs_swap_super(struct ext2_super_block * super); | |
10581 | extern void ext2fs_swap_group_desc(struct ext2_group_desc *gdp); | |
10582 | extern void ext2fs_swap_inode_full(ext2_filsys fs, struct ext2_inode_large *t, | |
10583 | struct ext2_inode_large *f, int hostorder, | |
10584 | int bufsize); | |
10585 | extern void ext2fs_swap_inode(ext2_filsys fs,struct ext2_inode *t, | |
10586 | struct ext2_inode *f, int hostorder); | |
10587 | ||
10588 | ||
10589 | extern int ext2fs_inode_has_valid_blocks(struct ext2_inode *inode); | |
10590 | ||
10591 | ||
10592 | extern int ext2fs_parse_version_string(const char *ver_string); | |
10593 | extern int ext2fs_get_library_version(const char **ver_string, | |
10594 | const char **date_string); | |
10595 | ||
10596 | ||
10597 | extern errcode_t ext2fs_write_bb_FILE(ext2_badblocks_list bb_list, | |
10598 | unsigned int flags, | |
10599 | FILE *f); | |
10600 | ||
10601 | ||
10602 | ||
10603 | extern errcode_t ext2fs_get_mem(unsigned long size, void *ptr); | |
10604 | extern errcode_t ext2fs_get_array(unsigned long count, unsigned long size, void *ptr); | |
10605 | extern errcode_t ext2fs_free_mem(void *ptr); | |
10606 | extern errcode_t ext2fs_resize_mem(unsigned long old_size, | |
10607 | unsigned long size, void *ptr); | |
10608 | extern void ext2fs_mark_super_dirty(ext2_filsys fs); | |
10609 | extern void ext2fs_mark_changed(ext2_filsys fs); | |
10610 | extern int ext2fs_test_changed(ext2_filsys fs); | |
10611 | extern void ext2fs_mark_valid(ext2_filsys fs); | |
10612 | extern void ext2fs_unmark_valid(ext2_filsys fs); | |
10613 | extern int ext2fs_test_valid(ext2_filsys fs); | |
10614 | extern void ext2fs_mark_ib_dirty(ext2_filsys fs); | |
10615 | extern void ext2fs_mark_bb_dirty(ext2_filsys fs); | |
10616 | extern int ext2fs_test_ib_dirty(ext2_filsys fs); | |
10617 | extern int ext2fs_test_bb_dirty(ext2_filsys fs); | |
10618 | extern int ext2fs_group_of_blk(ext2_filsys fs, blk_t blk); | |
10619 | extern int ext2fs_group_of_ino(ext2_filsys fs, ext2_ino_t ino); | |
10620 | extern blk_t ext2fs_group_first_block(ext2_filsys fs, dgrp_t group); | |
10621 | extern blk_t ext2fs_group_last_block(ext2_filsys fs, dgrp_t group); | |
10622 | extern blk_t ext2fs_inode_data_blocks(ext2_filsys fs, | |
10623 | struct ext2_inode *inode); | |
10624 | extern unsigned int ext2fs_div_ceil(unsigned int a, unsigned int b); | |
10625 | # 1001 "../lib/ext2fs/ext2fs.h" | |
10626 | #define _INLINE_ extern __inline__ | |
10627 | # 1012 "../lib/ext2fs/ext2fs.h" | |
10628 | extern __inline__ errcode_t ext2fs_get_mem(unsigned long size, void *ptr) | |
10629 | { | |
10630 | void *pp; | |
10631 | ||
10632 | pp = malloc(size); | |
10633 | if (!pp) | |
10634 | return (2133571398L); | |
10635 | memcpy(ptr, &pp, sizeof (pp)); | |
10636 | return 0; | |
10637 | } | |
10638 | ||
10639 | extern __inline__ errcode_t ext2fs_get_array(unsigned long count, unsigned long size, void *ptr) | |
10640 | { | |
10641 | if (count && (-1UL)/count<size) | |
10642 | return (2133571398L); | |
10643 | return ext2fs_get_mem(count*size, ptr); | |
10644 | } | |
10645 | ||
10646 | ||
10647 | ||
10648 | ||
10649 | extern __inline__ errcode_t ext2fs_free_mem(void *ptr) | |
10650 | { | |
10651 | void *p; | |
10652 | ||
10653 | memcpy(&p, ptr, sizeof(p)); | |
10654 | free(p); | |
10655 | p = 0; | |
10656 | memcpy(ptr, &p, sizeof(p)); | |
10657 | return 0; | |
10658 | } | |
10659 | ||
10660 | ||
10661 | ||
10662 | ||
10663 | extern __inline__ errcode_t ext2fs_resize_mem(unsigned long __attribute__((unused)) old_size, | |
10664 | unsigned long size, void *ptr) | |
10665 | { | |
10666 | void *p; | |
10667 | ||
10668 | ||
10669 | ||
10670 | memcpy(&p, ptr, sizeof(p)); | |
10671 | p = realloc(p, size); | |
10672 | if (!p) | |
10673 | return (2133571398L); | |
10674 | memcpy(ptr, &p, sizeof(p)); | |
10675 | return 0; | |
10676 | } | |
10677 | ||
10678 | ||
10679 | ||
10680 | ||
10681 | ||
10682 | extern __inline__ void ext2fs_mark_super_dirty(ext2_filsys fs) | |
10683 | { | |
10684 | fs->flags |= 0x04 | 0x02; | |
10685 | } | |
10686 | ||
10687 | ||
10688 | ||
10689 | ||
10690 | extern __inline__ void ext2fs_mark_changed(ext2_filsys fs) | |
10691 | { | |
10692 | fs->flags |= 0x02; | |
10693 | } | |
10694 | ||
10695 | ||
10696 | ||
10697 | ||
10698 | extern __inline__ int ext2fs_test_changed(ext2_filsys fs) | |
10699 | { | |
10700 | return (fs->flags & 0x02); | |
10701 | } | |
10702 | ||
10703 | ||
10704 | ||
10705 | ||
10706 | extern __inline__ void ext2fs_mark_valid(ext2_filsys fs) | |
10707 | { | |
10708 | fs->flags |= 0x08; | |
10709 | } | |
10710 | ||
10711 | ||
10712 | ||
10713 | ||
10714 | extern __inline__ void ext2fs_unmark_valid(ext2_filsys fs) | |
10715 | { | |
10716 | fs->flags &= ~0x08; | |
10717 | } | |
10718 | ||
10719 | ||
10720 | ||
10721 | ||
10722 | extern __inline__ int ext2fs_test_valid(ext2_filsys fs) | |
10723 | { | |
10724 | return (fs->flags & 0x08); | |
10725 | } | |
10726 | ||
10727 | ||
10728 | ||
10729 | ||
10730 | extern __inline__ void ext2fs_mark_ib_dirty(ext2_filsys fs) | |
10731 | { | |
10732 | fs->flags |= 0x10 | 0x02; | |
10733 | } | |
10734 | ||
10735 | ||
10736 | ||
10737 | ||
10738 | extern __inline__ void ext2fs_mark_bb_dirty(ext2_filsys fs) | |
10739 | { | |
10740 | fs->flags |= 0x20 | 0x02; | |
10741 | } | |
10742 | ||
10743 | ||
10744 | ||
10745 | ||
10746 | extern __inline__ int ext2fs_test_ib_dirty(ext2_filsys fs) | |
10747 | { | |
10748 | return (fs->flags & 0x10); | |
10749 | } | |
10750 | ||
10751 | ||
10752 | ||
10753 | ||
10754 | extern __inline__ int ext2fs_test_bb_dirty(ext2_filsys fs) | |
10755 | { | |
10756 | return (fs->flags & 0x20); | |
10757 | } | |
10758 | ||
10759 | ||
10760 | ||
10761 | ||
10762 | extern __inline__ int ext2fs_group_of_blk(ext2_filsys fs, blk_t blk) | |
10763 | { | |
10764 | return (blk - fs->super->s_first_data_block) / | |
10765 | fs->super->s_blocks_per_group; | |
10766 | } | |
10767 | ||
10768 | ||
10769 | ||
10770 | ||
10771 | extern __inline__ int ext2fs_group_of_ino(ext2_filsys fs, ext2_ino_t ino) | |
10772 | { | |
10773 | return (ino - 1) / fs->super->s_inodes_per_group; | |
10774 | } | |
10775 | ||
10776 | ||
10777 | ||
10778 | ||
10779 | extern __inline__ blk_t ext2fs_group_first_block(ext2_filsys fs, dgrp_t group) | |
10780 | { | |
10781 | return fs->super->s_first_data_block + | |
10782 | (group * fs->super->s_blocks_per_group); | |
10783 | } | |
10784 | ||
10785 | ||
10786 | ||
10787 | ||
10788 | extern __inline__ blk_t ext2fs_group_last_block(ext2_filsys fs, dgrp_t group) | |
10789 | { | |
10790 | return (group == fs->group_desc_count - 1 ? | |
10791 | fs->super->s_blocks_count - 1 : | |
10792 | ext2fs_group_first_block(fs, group) + | |
10793 | (fs->super->s_blocks_per_group - 1)); | |
10794 | } | |
10795 | ||
10796 | extern __inline__ blk_t ext2fs_inode_data_blocks(ext2_filsys fs, | |
10797 | struct ext2_inode *inode) | |
10798 | { | |
10799 | return inode->i_blocks - | |
10800 | (inode->i_file_acl ? fs->blocksize >> 9 : 0); | |
10801 | } | |
10802 | ||
10803 | ||
10804 | ||
10805 | ||
10806 | extern __inline__ unsigned int ext2fs_div_ceil(unsigned int a, unsigned int b) | |
10807 | { | |
10808 | if (!a) | |
10809 | return 0; | |
10810 | return ((a - 1) / b) + 1; | |
10811 | } | |
10812 | #undef _INLINE_ | |
10813 | # 36 "e2fsck.h" 2 | |
10814 | # 1 "../lib/blkid/blkid.h" 1 | |
10815 | # 14 "../lib/blkid/blkid.h" | |
10816 | #define _BLKID_BLKID_H | |
10817 | ||
10818 | ||
10819 | # 1 "../lib/blkid/blkid_types.h" 1 | |
10820 | # 18 "../lib/blkid/blkid.h" 2 | |
10821 | ||
10822 | ||
10823 | ||
10824 | ||
10825 | ||
10826 | #define BLKID_VERSION "1.0.0" | |
10827 | #define BLKID_DATE "12-Feb-2003" | |
10828 | ||
10829 | typedef struct blkid_struct_dev *blkid_dev; | |
10830 | typedef struct blkid_struct_cache *blkid_cache; | |
10831 | typedef __s64 blkid_loff_t; | |
10832 | ||
10833 | typedef struct blkid_struct_tag_iterate *blkid_tag_iterate; | |
10834 | typedef struct blkid_struct_dev_iterate *blkid_dev_iterate; | |
10835 | # 45 "../lib/blkid/blkid.h" | |
10836 | #define BLKID_DEV_FIND 0x0000 | |
10837 | #define BLKID_DEV_CREATE 0x0001 | |
10838 | #define BLKID_DEV_VERIFY 0x0002 | |
10839 | #define BLKID_DEV_NORMAL (BLKID_DEV_CREATE | BLKID_DEV_VERIFY) | |
10840 | ||
10841 | ||
10842 | extern void blkid_put_cache(blkid_cache cache); | |
10843 | extern int blkid_get_cache(blkid_cache *cache, const char *filename); | |
10844 | extern void blkid_gc_cache(blkid_cache cache); | |
10845 | ||
10846 | ||
10847 | extern const char *blkid_dev_devname(blkid_dev dev); | |
10848 | ||
10849 | extern blkid_dev_iterate blkid_dev_iterate_begin(blkid_cache cache); | |
10850 | extern int blkid_dev_set_search(blkid_dev_iterate iter, | |
10851 | char *search_type, char *search_value); | |
10852 | extern int blkid_dev_next(blkid_dev_iterate iterate, blkid_dev *dev); | |
10853 | extern void blkid_dev_iterate_end(blkid_dev_iterate iterate); | |
10854 | ||
10855 | ||
10856 | extern char *blkid_devno_to_devname(dev_t devno); | |
10857 | ||
10858 | ||
10859 | extern int blkid_probe_all(blkid_cache cache); | |
10860 | extern int blkid_probe_all_new(blkid_cache cache); | |
10861 | extern blkid_dev blkid_get_dev(blkid_cache cache, const char *devname, | |
10862 | int flags); | |
10863 | ||
10864 | ||
10865 | extern blkid_loff_t blkid_get_dev_size(int fd); | |
10866 | ||
10867 | ||
10868 | int blkid_known_fstype(const char *fstype); | |
10869 | extern blkid_dev blkid_verify(blkid_cache cache, blkid_dev dev); | |
10870 | ||
10871 | ||
10872 | ||
10873 | ||
10874 | extern char *blkid_get_tag_value(blkid_cache cache, const char *tagname, | |
10875 | const char *devname); | |
10876 | extern char *blkid_get_devname(blkid_cache cache, const char *token, | |
10877 | const char *value); | |
10878 | ||
10879 | ||
10880 | extern blkid_tag_iterate blkid_tag_iterate_begin(blkid_dev dev); | |
10881 | extern int blkid_tag_next(blkid_tag_iterate iterate, | |
10882 | const char **type, const char **value); | |
10883 | extern void blkid_tag_iterate_end(blkid_tag_iterate iterate); | |
10884 | extern int blkid_dev_has_tag(blkid_dev dev, const char *type, | |
10885 | const char *value); | |
10886 | extern blkid_dev blkid_find_dev_with_tag(blkid_cache cache, | |
10887 | const char *type, | |
10888 | const char *value); | |
10889 | extern int blkid_parse_tag_string(const char *token, char **ret_type, | |
10890 | char **ret_val); | |
10891 | ||
10892 | ||
10893 | extern int blkid_parse_version_string(const char *ver_string); | |
10894 | extern int blkid_get_library_version(const char **ver_string, | |
10895 | const char **date_string); | |
10896 | # 37 "e2fsck.h" 2 | |
10897 | ||
10898 | ||
10899 | # 1 "profile.h" 1 | |
10900 | # 40 "profile.h" | |
10901 | #define _PROFILE_H | |
10902 | ||
10903 | typedef struct _profile_t *profile_t; | |
10904 | ||
10905 | typedef void (*profile_syntax_err_cb_t)(const char *file, long err, | |
10906 | int line_num); | |
10907 | ||
10908 | ||
10909 | ||
10910 | ||
10911 | #define PROFILE_ITER_LIST_SECTION 0x0001 | |
10912 | #define PROFILE_ITER_SECTIONS_ONLY 0x0002 | |
10913 | #define PROFILE_ITER_RELATIONS_ONLY 0x0004 | |
10914 | ||
10915 | ||
10916 | ||
10917 | ||
10918 | ||
10919 | long profile_init | |
10920 | (const char * *files, profile_t *ret_profile); | |
10921 | ||
10922 | void profile_release | |
10923 | (profile_t profile); | |
10924 | ||
10925 | long profile_set_default | |
10926 | (profile_t profile, const char *def_string); | |
10927 | ||
10928 | long profile_get_string | |
10929 | (profile_t profile, const char *name, const char *subname, | |
10930 | const char *subsubname, const char *def_val, | |
10931 | char **ret_string); | |
10932 | long profile_get_integer | |
10933 | (profile_t profile, const char *name, const char *subname, | |
10934 | const char *subsubname, int def_val, | |
10935 | int *ret_default); | |
10936 | ||
10937 | long profile_get_uint | |
10938 | (profile_t profile, const char *name, const char *subname, | |
10939 | const char *subsubname, unsigned int def_val, | |
10940 | unsigned int *ret_int); | |
10941 | ||
10942 | long profile_get_boolean | |
10943 | (profile_t profile, const char *name, const char *subname, | |
10944 | const char *subsubname, int def_val, | |
10945 | int *ret_default); | |
10946 | ||
10947 | long profile_iterator_create | |
10948 | (profile_t profile, const char *const *names, | |
10949 | int flags, void **ret_iter); | |
10950 | ||
10951 | void profile_iterator_free | |
10952 | (void **iter_p); | |
10953 | ||
10954 | long profile_iterator | |
10955 | (void **iter_p, char **ret_name, char **ret_value); | |
10956 | ||
10957 | profile_syntax_err_cb_t profile_set_syntax_err_cb(profile_syntax_err_cb_t hook); | |
10958 | # 40 "e2fsck.h" 2 | |
10959 | # 1 "prof_err.h" 1 | |
10960 | ||
10961 | ||
10962 | ||
10963 | ||
10964 | #define PROF_VERSION (-1429577728L) | |
10965 | #define PROF_MAGIC_NODE (-1429577727L) | |
10966 | #define PROF_NO_SECTION (-1429577726L) | |
10967 | #define PROF_NO_RELATION (-1429577725L) | |
10968 | #define PROF_ADD_NOT_SECTION (-1429577724L) | |
10969 | #define PROF_SECTION_WITH_VALUE (-1429577723L) | |
10970 | #define PROF_BAD_LINK_LIST (-1429577722L) | |
10971 | #define PROF_BAD_GROUP_LVL (-1429577721L) | |
10972 | #define PROF_BAD_PARENT_PTR (-1429577720L) | |
10973 | #define PROF_MAGIC_ITERATOR (-1429577719L) | |
10974 | #define PROF_SET_SECTION_VALUE (-1429577718L) | |
10975 | #define PROF_EINVAL (-1429577717L) | |
10976 | #define PROF_READ_ONLY (-1429577716L) | |
10977 | #define PROF_SECTION_NOTOP (-1429577715L) | |
10978 | #define PROF_SECTION_SYNTAX (-1429577714L) | |
10979 | #define PROF_RELATION_SYNTAX (-1429577713L) | |
10980 | #define PROF_EXTRA_CBRACE (-1429577712L) | |
10981 | #define PROF_MISSING_OBRACE (-1429577711L) | |
10982 | #define PROF_MAGIC_PROFILE (-1429577710L) | |
10983 | #define PROF_MAGIC_SECTION (-1429577709L) | |
10984 | #define PROF_TOPSECTION_ITER_NOSUPP (-1429577708L) | |
10985 | #define PROF_INVALID_SECTION (-1429577707L) | |
10986 | #define PROF_END_OF_SECTIONS (-1429577706L) | |
10987 | #define PROF_BAD_NAMESET (-1429577705L) | |
10988 | #define PROF_NO_PROFILE (-1429577704L) | |
10989 | #define PROF_MAGIC_FILE (-1429577703L) | |
10990 | #define PROF_FAIL_OPEN (-1429577702L) | |
10991 | #define PROF_EXISTS (-1429577701L) | |
10992 | #define PROF_BAD_BOOLEAN (-1429577700L) | |
10993 | #define PROF_BAD_INTEGER (-1429577699L) | |
10994 | #define PROF_MAGIC_FILE_DATA (-1429577698L) | |
10995 | extern void initialize_prof_error_table(void); | |
10996 | #define ERROR_TABLE_BASE_prof (-1429577728L) | |
10997 | ||
10998 | ||
10999 | #define init_prof_err_tbl initialize_prof_error_table | |
11000 | #define prof_err_base ERROR_TABLE_BASE_prof | |
11001 | ||
11002 | ||
11003 | #define ERROR_TABLE_BASE_prof (-1429577728L) | |
11004 | #define init_prof_err_tbl initialize_prof_error_table | |
11005 | #define initialize_prof_error_table initialize_prof_error_table | |
11006 | #define prof_err_base ERROR_TABLE_BASE_prof | |
11007 | # 41 "e2fsck.h" 2 | |
11008 | ||
11009 | ||
11010 | # 1 "/usr/include/libintl.h" 1 3 4 | |
11011 | # 22 "/usr/include/libintl.h" 3 4 | |
11012 | #define _LIBINTL_H 1 | |
11013 | ||
11014 | ||
11015 | ||
11016 | ||
11017 | ||
11018 | #define __USE_GNU_GETTEXT 1 | |
11019 | ||
11020 | ||
11021 | ||
11022 | #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 1 : -1) | |
11023 | ||
11024 | ||
11025 | ||
11026 | ||
11027 | ||
11028 | ||
11029 | ||
11030 | extern char *gettext (__const char *__msgid) | |
11031 | __attribute__ ((__nothrow__)) __attribute__ ((__format_arg__ (1))); | |
11032 | ||
11033 | ||
11034 | ||
11035 | extern char *dgettext (__const char *__domainname, __const char *__msgid) | |
11036 | __attribute__ ((__nothrow__)) __attribute__ ((__format_arg__ (2))); | |
11037 | extern char *__dgettext (__const char *__domainname, __const char *__msgid) | |
11038 | __attribute__ ((__nothrow__)) __attribute__ ((__format_arg__ (2))); | |
11039 | ||
11040 | ||
11041 | ||
11042 | extern char *dcgettext (__const char *__domainname, | |
11043 | __const char *__msgid, int __category) | |
11044 | __attribute__ ((__nothrow__)) __attribute__ ((__format_arg__ (2))); | |
11045 | extern char *__dcgettext (__const char *__domainname, | |
11046 | __const char *__msgid, int __category) | |
11047 | __attribute__ ((__nothrow__)) __attribute__ ((__format_arg__ (2))); | |
11048 | ||
11049 | ||
11050 | ||
11051 | ||
11052 | extern char *ngettext (__const char *__msgid1, __const char *__msgid2, | |
11053 | unsigned long int __n) | |
11054 | __attribute__ ((__nothrow__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2))); | |
11055 | ||
11056 | ||
11057 | ||
11058 | extern char *dngettext (__const char *__domainname, __const char *__msgid1, | |
11059 | __const char *__msgid2, unsigned long int __n) | |
11060 | __attribute__ ((__nothrow__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3))); | |
11061 | ||
11062 | ||
11063 | ||
11064 | extern char *dcngettext (__const char *__domainname, __const char *__msgid1, | |
11065 | __const char *__msgid2, unsigned long int __n, | |
11066 | int __category) | |
11067 | __attribute__ ((__nothrow__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3))); | |
11068 | ||
11069 | ||
11070 | ||
11071 | ||
11072 | ||
11073 | extern char *textdomain (__const char *__domainname) __attribute__ ((__nothrow__)); | |
11074 | ||
11075 | ||
11076 | ||
11077 | extern char *bindtextdomain (__const char *__domainname, | |
11078 | __const char *__dirname) __attribute__ ((__nothrow__)); | |
11079 | ||
11080 | ||
11081 | ||
11082 | extern char *bind_textdomain_codeset (__const char *__domainname, | |
11083 | __const char *__codeset) __attribute__ ((__nothrow__)); | |
11084 | ||
11085 | ||
11086 | ||
11087 | ||
11088 | ||
11089 | ||
11090 | #define __need_NULL | |
11091 | # 1 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/stddef.h" 1 3 4 | |
11092 | # 163 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/stddef.h" 3 4 | |
11093 | #undef __need_ptrdiff_t | |
11094 | # 236 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/stddef.h" 3 4 | |
11095 | #undef __need_size_t | |
11096 | # 345 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/stddef.h" 3 4 | |
11097 | #undef __need_wchar_t | |
11098 | # 398 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/stddef.h" 3 4 | |
11099 | #undef NULL | |
11100 | ||
11101 | ||
11102 | ||
11103 | ||
11104 | #define NULL ((void *)0) | |
11105 | ||
11106 | ||
11107 | ||
11108 | ||
11109 | ||
11110 | #undef __need_NULL | |
11111 | ||
11112 | ||
11113 | ||
11114 | ||
11115 | #define offsetof(TYPE,MEMBER) __builtin_offsetof (TYPE, MEMBER) | |
11116 | # 102 "/usr/include/libintl.h" 2 3 4 | |
11117 | ||
11118 | ||
11119 | # 1 "/usr/include/locale.h" 1 3 4 | |
11120 | # 24 "/usr/include/locale.h" 3 4 | |
11121 | #define _LOCALE_H 1 | |
11122 | ||
11123 | ||
11124 | ||
11125 | #define __need_NULL | |
11126 | # 1 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/stddef.h" 1 3 4 | |
11127 | # 163 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/stddef.h" 3 4 | |
11128 | #undef __need_ptrdiff_t | |
11129 | # 236 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/stddef.h" 3 4 | |
11130 | #undef __need_size_t | |
11131 | # 345 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/stddef.h" 3 4 | |
11132 | #undef __need_wchar_t | |
11133 | # 398 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/stddef.h" 3 4 | |
11134 | #undef NULL | |
11135 | ||
11136 | ||
11137 | ||
11138 | ||
11139 | #define NULL ((void *)0) | |
11140 | ||
11141 | ||
11142 | ||
11143 | ||
11144 | ||
11145 | #undef __need_NULL | |
11146 | ||
11147 | ||
11148 | ||
11149 | ||
11150 | #define offsetof(TYPE,MEMBER) __builtin_offsetof (TYPE, MEMBER) | |
11151 | # 30 "/usr/include/locale.h" 2 3 4 | |
11152 | # 1 "/usr/include/bits/locale.h" 1 3 4 | |
11153 | # 25 "/usr/include/bits/locale.h" 3 4 | |
11154 | #define _BITS_LOCALE_H 1 | |
11155 | ||
11156 | enum | |
11157 | { | |
11158 | __LC_CTYPE = 0, | |
11159 | __LC_NUMERIC = 1, | |
11160 | __LC_TIME = 2, | |
11161 | __LC_COLLATE = 3, | |
11162 | __LC_MONETARY = 4, | |
11163 | __LC_MESSAGES = 5, | |
11164 | __LC_ALL = 6, | |
11165 | __LC_PAPER = 7, | |
11166 | __LC_NAME = 8, | |
11167 | __LC_ADDRESS = 9, | |
11168 | __LC_TELEPHONE = 10, | |
11169 | __LC_MEASUREMENT = 11, | |
11170 | __LC_IDENTIFICATION = 12 | |
11171 | }; | |
11172 | # 31 "/usr/include/locale.h" 2 3 4 | |
11173 | ||
11174 | ||
11175 | ||
11176 | ||
11177 | ||
11178 | #define LC_CTYPE __LC_CTYPE | |
11179 | #define LC_NUMERIC __LC_NUMERIC | |
11180 | #define LC_TIME __LC_TIME | |
11181 | #define LC_COLLATE __LC_COLLATE | |
11182 | #define LC_MONETARY __LC_MONETARY | |
11183 | #define LC_MESSAGES __LC_MESSAGES | |
11184 | #define LC_ALL __LC_ALL | |
11185 | #define LC_PAPER __LC_PAPER | |
11186 | #define LC_NAME __LC_NAME | |
11187 | #define LC_ADDRESS __LC_ADDRESS | |
11188 | #define LC_TELEPHONE __LC_TELEPHONE | |
11189 | #define LC_MEASUREMENT __LC_MEASUREMENT | |
11190 | #define LC_IDENTIFICATION __LC_IDENTIFICATION | |
11191 | ||
11192 | ||
11193 | ||
11194 | ||
11195 | ||
11196 | struct lconv | |
11197 | { | |
11198 | ||
11199 | ||
11200 | char *decimal_point; | |
11201 | char *thousands_sep; | |
11202 | ||
11203 | ||
11204 | ||
11205 | ||
11206 | ||
11207 | char *grouping; | |
11208 | ||
11209 | ||
11210 | ||
11211 | ||
11212 | ||
11213 | char *int_curr_symbol; | |
11214 | char *currency_symbol; | |
11215 | char *mon_decimal_point; | |
11216 | char *mon_thousands_sep; | |
11217 | char *mon_grouping; | |
11218 | char *positive_sign; | |
11219 | char *negative_sign; | |
11220 | char int_frac_digits; | |
11221 | char frac_digits; | |
11222 | ||
11223 | char p_cs_precedes; | |
11224 | ||
11225 | char p_sep_by_space; | |
11226 | ||
11227 | char n_cs_precedes; | |
11228 | ||
11229 | char n_sep_by_space; | |
11230 | ||
11231 | ||
11232 | ||
11233 | ||
11234 | ||
11235 | ||
11236 | char p_sign_posn; | |
11237 | char n_sign_posn; | |
11238 | # 114 "/usr/include/locale.h" 3 4 | |
11239 | char __int_p_cs_precedes; | |
11240 | char __int_p_sep_by_space; | |
11241 | char __int_n_cs_precedes; | |
11242 | char __int_n_sep_by_space; | |
11243 | char __int_p_sign_posn; | |
11244 | char __int_n_sign_posn; | |
11245 | ||
11246 | }; | |
11247 | ||
11248 | ||
11249 | ||
11250 | extern char *setlocale (int __category, __const char *__locale) __attribute__ ((__nothrow__)); | |
11251 | ||
11252 | ||
11253 | extern struct lconv *localeconv (void) __attribute__ ((__nothrow__)); | |
11254 | ||
11255 | ||
11256 | # 208 "/usr/include/locale.h" 3 4 | |
11257 | ||
11258 | # 105 "/usr/include/libintl.h" 2 3 4 | |
11259 | ||
11260 | ||
11261 | ||
11262 | ||
11263 | ||
11264 | #define gettext(msgid) dgettext (NULL, msgid) | |
11265 | ||
11266 | #define dgettext(domainname,msgid) dcgettext (domainname, msgid, LC_MESSAGES) | |
11267 | ||
11268 | ||
11269 | #define ngettext(msgid1,msgid2,n) dngettext (NULL, msgid1, msgid2, n) | |
11270 | ||
11271 | #define dngettext(domainname,msgid1,msgid2,n) dcngettext (domainname, msgid1, msgid2, n, LC_MESSAGES) | |
11272 | ||
11273 | ||
11274 | ||
11275 | ||
11276 | ||
11277 | # 44 "e2fsck.h" 2 | |
11278 | ||
11279 | #define _(a) (gettext (a)) | |
11280 | ||
11281 | ||
11282 | ||
11283 | #define N_(a) (a) | |
11284 | ||
11285 | #define P_(singular,plural,n) (ngettext (singular, plural, n)) | |
11286 | ||
11287 | #define NLS_CAT_NAME "e2fsprogs" | |
11288 | # 67 "e2fsck.h" | |
11289 | #define FSCK_OK 0 | |
11290 | #define FSCK_NONDESTRUCT 1 | |
11291 | #define FSCK_REBOOT 2 | |
11292 | #define FSCK_UNCORRECTED 4 | |
11293 | #define FSCK_ERROR 8 | |
11294 | #define FSCK_USAGE 16 | |
11295 | #define FSCK_CANCELED 32 | |
11296 | #define FSCK_LIBRARY 128 | |
11297 | ||
11298 | ||
11299 | ||
11300 | ||
11301 | ||
11302 | #define E2FSCK_CURRENT_REV 1 | |
11303 | ||
11304 | ||
11305 | ||
11306 | ||
11307 | ||
11308 | ||
11309 | struct dir_info { | |
11310 | ext2_ino_t ino; | |
11311 | ext2_ino_t dotdot; | |
11312 | ext2_ino_t parent; | |
11313 | }; | |
11314 | ||
11315 | ||
11316 | ||
11317 | ||
11318 | ||
11319 | ||
11320 | struct dx_dir_info { | |
11321 | ext2_ino_t ino; | |
11322 | int numblocks; | |
11323 | int hashversion; | |
11324 | short depth; | |
11325 | struct dx_dirblock_info *dx_block; | |
11326 | }; | |
11327 | ||
11328 | #define DX_DIRBLOCK_ROOT 1 | |
11329 | #define DX_DIRBLOCK_LEAF 2 | |
11330 | #define DX_DIRBLOCK_NODE 3 | |
11331 | #define DX_DIRBLOCK_CORRUPT 4 | |
11332 | #define DX_DIRBLOCK_CLEARED 8 | |
11333 | ||
11334 | struct dx_dirblock_info { | |
11335 | int type; | |
11336 | blk_t phys; | |
11337 | int flags; | |
11338 | blk_t parent; | |
11339 | ext2_dirhash_t min_hash; | |
11340 | ext2_dirhash_t max_hash; | |
11341 | ext2_dirhash_t node_min_hash; | |
11342 | ext2_dirhash_t node_max_hash; | |
11343 | }; | |
11344 | ||
11345 | #define DX_FLAG_REFERENCED 1 | |
11346 | #define DX_FLAG_DUP_REF 2 | |
11347 | #define DX_FLAG_FIRST 4 | |
11348 | #define DX_FLAG_LAST 8 | |
11349 | ||
11350 | ||
11351 | ||
11352 | ||
11353 | ||
11354 | ||
11355 | struct resource_track { | |
11356 | struct timeval time_start; | |
11357 | struct timeval user_start; | |
11358 | struct timeval system_start; | |
11359 | void *brk_start; | |
11360 | }; | |
11361 | ||
11362 | ||
11363 | ||
11364 | ||
11365 | ||
11366 | #define E2F_OPT_READONLY 0x0001 | |
11367 | #define E2F_OPT_PREEN 0x0002 | |
11368 | #define E2F_OPT_YES 0x0004 | |
11369 | #define E2F_OPT_NO 0x0008 | |
11370 | #define E2F_OPT_TIME 0x0010 | |
11371 | #define E2F_OPT_TIME2 0x0020 | |
11372 | #define E2F_OPT_CHECKBLOCKS 0x0040 | |
11373 | #define E2F_OPT_DEBUG 0x0080 | |
11374 | #define E2F_OPT_FORCE 0x0100 | |
11375 | #define E2F_OPT_WRITECHECK 0x0200 | |
11376 | #define E2F_OPT_COMPRESS_DIRS 0x0400 | |
11377 | ||
11378 | ||
11379 | ||
11380 | ||
11381 | #define E2F_FLAG_ABORT 0x0001 | |
11382 | #define E2F_FLAG_CANCEL 0x0002 | |
11383 | #define E2F_FLAG_SIGNAL_MASK 0x0003 | |
11384 | #define E2F_FLAG_RESTART 0x0004 | |
11385 | ||
11386 | #define E2F_FLAG_SETJMP_OK 0x0010 | |
11387 | ||
11388 | #define E2F_FLAG_PROG_BAR 0x0020 | |
11389 | #define E2F_FLAG_PROG_SUPPRESS 0x0040 | |
11390 | #define E2F_FLAG_JOURNAL_INODE 0x0080 | |
11391 | #define E2F_FLAG_SB_SPECIFIED 0x0100 | |
11392 | ||
11393 | #define E2F_FLAG_RESTARTED 0x0200 | |
11394 | #define E2F_FLAG_RESIZE_INODE 0x0400 | |
11395 | #define E2F_FLAG_GOT_DEVSIZE 0x0800 | |
11396 | ||
11397 | ||
11398 | ||
11399 | ||
11400 | #define E2F_PASS_1 1 | |
11401 | #define E2F_PASS_2 2 | |
11402 | #define E2F_PASS_3 3 | |
11403 | #define E2F_PASS_4 4 | |
11404 | #define E2F_PASS_5 5 | |
11405 | #define E2F_PASS_1B 6 | |
11406 | ||
11407 | ||
11408 | ||
11409 | ||
11410 | typedef struct ea_refcount *ext2_refcount_t; | |
11411 | ||
11412 | ||
11413 | ||
11414 | ||
11415 | typedef struct e2fsck_struct *e2fsck_t; | |
11416 | ||
11417 | struct e2fsck_struct { | |
11418 | ext2_filsys fs; | |
11419 | const char *program_name; | |
11420 | char *filesystem_name; | |
11421 | char *device_name; | |
11422 | char *io_options; | |
11423 | int flags; | |
11424 | int options; | |
11425 | blk_t use_superblock; | |
11426 | blk_t superblock; | |
11427 | int blocksize; | |
11428 | blk_t num_blocks; | |
11429 | int mount_flags; | |
11430 | blkid_cache blkid; | |
11431 | ||
11432 | ||
11433 | jmp_buf abort_loc; | |
11434 | ||
11435 | unsigned long abort_code; | |
11436 | ||
11437 | int (*progress)(e2fsck_t ctx, int pass, unsigned long cur, | |
11438 | unsigned long max); | |
11439 | ||
11440 | ext2fs_inode_bitmap inode_used_map; | |
11441 | ext2fs_inode_bitmap inode_bad_map; | |
11442 | ext2fs_inode_bitmap inode_dir_map; | |
11443 | ext2fs_inode_bitmap inode_bb_map; | |
11444 | ext2fs_inode_bitmap inode_imagic_map; | |
11445 | ext2fs_inode_bitmap inode_reg_map; | |
11446 | ||
11447 | ext2fs_block_bitmap block_found_map; | |
11448 | ext2fs_block_bitmap block_dup_map; | |
11449 | ext2fs_block_bitmap block_ea_map; | |
11450 | ||
11451 | ||
11452 | ||
11453 | ||
11454 | ext2_icount_t inode_count; | |
11455 | ext2_icount_t inode_link_info; | |
11456 | ||
11457 | ext2_refcount_t refcount; | |
11458 | ext2_refcount_t refcount_extra; | |
11459 | ||
11460 | ||
11461 | ||
11462 | ||
11463 | ||
11464 | int *invalid_inode_bitmap_flag; | |
11465 | int *invalid_block_bitmap_flag; | |
11466 | int *invalid_inode_table_flag; | |
11467 | int invalid_bitmaps; | |
11468 | ||
11469 | ||
11470 | ||
11471 | ||
11472 | char *block_buf; | |
11473 | ||
11474 | ||
11475 | ||
11476 | ||
11477 | ext2_ino_t stashed_ino; | |
11478 | struct ext2_inode *stashed_inode; | |
11479 | ||
11480 | ||
11481 | ||
11482 | ||
11483 | ext2_ino_t lost_and_found; | |
11484 | int bad_lost_and_found; | |
11485 | ||
11486 | ||
11487 | ||
11488 | ||
11489 | struct dir_info_db *dir_info; | |
11490 | ||
11491 | ||
11492 | ||
11493 | ||
11494 | int dx_dir_info_count; | |
11495 | int dx_dir_info_size; | |
11496 | struct dx_dir_info *dx_dir_info; | |
11497 | ||
11498 | ||
11499 | ||
11500 | ||
11501 | ext2_u32_list dirs_to_hash; | |
11502 | ||
11503 | ||
11504 | ||
11505 | ||
11506 | int process_inode_size; | |
11507 | int inode_buffer_blocks; | |
11508 | ||
11509 | ||
11510 | ||
11511 | ||
11512 | io_channel journal_io; | |
11513 | char *journal_name; | |
11514 | ||
11515 | ||
11516 | ||
11517 | ||
11518 | ||
11519 | struct resource_track global_rtrack; | |
11520 | ||
11521 | ||
11522 | ||
11523 | ||
11524 | ||
11525 | int progress_fd; | |
11526 | int progress_pos; | |
11527 | int progress_last_percent; | |
11528 | unsigned int progress_last_time; | |
11529 | int interactive; | |
11530 | char start_meta[2], stop_meta[2]; | |
11531 | ||
11532 | ||
11533 | __u32 fs_directory_count; | |
11534 | __u32 fs_regular_count; | |
11535 | __u32 fs_blockdev_count; | |
11536 | __u32 fs_chardev_count; | |
11537 | __u32 fs_links_count; | |
11538 | __u32 fs_symlinks_count; | |
11539 | __u32 fs_fast_symlinks_count; | |
11540 | __u32 fs_fifo_count; | |
11541 | __u32 fs_total_count; | |
11542 | __u32 fs_badblocks_count; | |
11543 | __u32 fs_sockets_count; | |
11544 | __u32 fs_ind_count; | |
11545 | __u32 fs_dind_count; | |
11546 | __u32 fs_tind_count; | |
11547 | __u32 fs_fragmented; | |
11548 | __u32 large_files; | |
11549 | __u32 fs_ext_attr_inodes; | |
11550 | __u32 fs_ext_attr_blocks; | |
11551 | ||
11552 | ||
11553 | time_t now; | |
11554 | time_t time_fudge; | |
11555 | int ext_attr_ver; | |
11556 | profile_t profile; | |
11557 | int blocks_per_page; | |
11558 | ||
11559 | ||
11560 | ||
11561 | ||
11562 | ||
11563 | void *priv_data; | |
11564 | }; | |
11565 | ||
11566 | ||
11567 | typedef __u32 region_addr_t; | |
11568 | typedef struct region_struct *region_t; | |
11569 | # 357 "e2fsck.h" | |
11570 | extern void e2fsck_pass1(e2fsck_t ctx); | |
11571 | extern void e2fsck_pass1_dupblocks(e2fsck_t ctx, char *block_buf); | |
11572 | extern void e2fsck_pass2(e2fsck_t ctx); | |
11573 | extern void e2fsck_pass3(e2fsck_t ctx); | |
11574 | extern void e2fsck_pass4(e2fsck_t ctx); | |
11575 | extern void e2fsck_pass5(e2fsck_t ctx); | |
11576 | ||
11577 | ||
11578 | extern errcode_t e2fsck_allocate_context(e2fsck_t *ret); | |
11579 | extern errcode_t e2fsck_reset_context(e2fsck_t ctx); | |
11580 | extern void e2fsck_free_context(e2fsck_t ctx); | |
11581 | extern int e2fsck_run(e2fsck_t ctx); | |
11582 | ||
11583 | ||
11584 | ||
11585 | extern void read_bad_blocks_file(e2fsck_t ctx, const char *bad_blocks_file, | |
11586 | int replace_bad_blocks); | |
11587 | ||
11588 | ||
11589 | extern void e2fsck_add_dir_info(e2fsck_t ctx, ext2_ino_t ino, ext2_ino_t parent); | |
11590 | extern void e2fsck_free_dir_info(e2fsck_t ctx); | |
11591 | extern int e2fsck_get_num_dirinfo(e2fsck_t ctx); | |
11592 | extern struct dir_info_iter *e2fsck_dir_info_iter_begin(e2fsck_t ctx); | |
11593 | extern struct dir_info *e2fsck_dir_info_iter(e2fsck_t ctx, | |
11594 | struct dir_info_iter *); | |
11595 | extern void e2fsck_dir_info_iter_end(e2fsck_t ctx, struct dir_info_iter *); | |
11596 | extern int e2fsck_dir_info_set_parent(e2fsck_t ctx, ext2_ino_t ino, | |
11597 | ext2_ino_t parent); | |
11598 | extern int e2fsck_dir_info_set_dotdot(e2fsck_t ctx, ext2_ino_t ino, | |
11599 | ext2_ino_t dotdot); | |
11600 | extern int e2fsck_dir_info_get_parent(e2fsck_t ctx, ext2_ino_t ino, | |
11601 | ext2_ino_t *parent); | |
11602 | extern int e2fsck_dir_info_get_dotdot(e2fsck_t ctx, ext2_ino_t ino, | |
11603 | ext2_ino_t *dotdot); | |
11604 | ||
11605 | ||
11606 | extern void e2fsck_add_dx_dir(e2fsck_t ctx, ext2_ino_t ino, int num_blocks); | |
11607 | extern struct dx_dir_info *e2fsck_get_dx_dir_info(e2fsck_t ctx, ext2_ino_t ino); | |
11608 | extern void e2fsck_free_dx_dir_info(e2fsck_t ctx); | |
11609 | extern int e2fsck_get_num_dx_dirinfo(e2fsck_t ctx); | |
11610 | extern struct dx_dir_info *e2fsck_dx_dir_info_iter(e2fsck_t ctx, int *control); | |
11611 | ||
11612 | ||
11613 | extern errcode_t ea_refcount_create(int size, ext2_refcount_t *ret); | |
11614 | extern void ea_refcount_free(ext2_refcount_t refcount); | |
11615 | extern errcode_t ea_refcount_fetch(ext2_refcount_t refcount, blk_t blk, | |
11616 | int *ret); | |
11617 | extern errcode_t ea_refcount_increment(ext2_refcount_t refcount, | |
11618 | blk_t blk, int *ret); | |
11619 | extern errcode_t ea_refcount_decrement(ext2_refcount_t refcount, | |
11620 | blk_t blk, int *ret); | |
11621 | extern errcode_t ea_refcount_store(ext2_refcount_t refcount, | |
11622 | blk_t blk, int count); | |
11623 | extern blk_t ext2fs_get_refcount_size(ext2_refcount_t refcount); | |
11624 | extern void ea_refcount_intr_begin(ext2_refcount_t refcount); | |
11625 | extern blk_t ea_refcount_intr_next(ext2_refcount_t refcount, int *ret); | |
11626 | ||
11627 | ||
11628 | extern const char *ehandler_operation(const char *op); | |
11629 | extern void ehandler_init(io_channel channel); | |
11630 | ||
11631 | ||
11632 | extern int e2fsck_check_ext3_journal(e2fsck_t ctx); | |
11633 | extern int e2fsck_run_ext3_journal(e2fsck_t ctx); | |
11634 | extern void e2fsck_move_ext3_journal(e2fsck_t ctx); | |
11635 | extern int e2fsck_fix_ext3_journal_hint(e2fsck_t ctx); | |
11636 | ||
11637 | ||
11638 | extern void e2fsck_setup_tdb_icount(e2fsck_t ctx, int flags, | |
11639 | ext2_icount_t *ret); | |
11640 | extern void e2fsck_use_inode_shortcuts(e2fsck_t ctx, int bool); | |
11641 | extern int e2fsck_pass1_check_device_inode(ext2_filsys fs, | |
11642 | struct ext2_inode *inode); | |
11643 | extern int e2fsck_pass1_check_symlink(ext2_filsys fs, | |
11644 | struct ext2_inode *inode, char *buf); | |
11645 | ||
11646 | ||
11647 | extern int e2fsck_process_bad_inode(e2fsck_t ctx, ext2_ino_t dir, | |
11648 | ext2_ino_t ino, char *buf); | |
11649 | ||
11650 | ||
11651 | extern int e2fsck_reconnect_file(e2fsck_t ctx, ext2_ino_t inode); | |
11652 | extern errcode_t e2fsck_expand_directory(e2fsck_t ctx, ext2_ino_t dir, | |
11653 | int num, int gauranteed_size); | |
11654 | extern ext2_ino_t e2fsck_get_lost_and_found(e2fsck_t ctx, int fix); | |
11655 | extern errcode_t e2fsck_adjust_inode_count(e2fsck_t ctx, ext2_ino_t ino, | |
11656 | int adj); | |
11657 | ||
11658 | ||
11659 | ||
11660 | extern region_t region_create(region_addr_t min, region_addr_t max); | |
11661 | extern void region_free(region_t region); | |
11662 | extern int region_allocate(region_t region, region_addr_t start, int n); | |
11663 | ||
11664 | ||
11665 | errcode_t e2fsck_rehash_dir(e2fsck_t ctx, ext2_ino_t ino); | |
11666 | void e2fsck_rehash_directories(e2fsck_t ctx); | |
11667 | ||
11668 | ||
11669 | void check_super_block(e2fsck_t ctx); | |
11670 | int check_backup_super_block(e2fsck_t ctx); | |
11671 | ||
11672 | ||
11673 | void swap_filesys(e2fsck_t ctx); | |
11674 | ||
11675 | ||
11676 | extern void *e2fsck_allocate_memory(e2fsck_t ctx, unsigned int size, | |
11677 | const char *description); | |
11678 | extern int ask(e2fsck_t ctx, const char * string, int def); | |
11679 | extern int ask_yn(const char * string, int def); | |
11680 | extern void fatal_error(e2fsck_t ctx, const char * fmt_string); | |
11681 | extern void e2fsck_read_bitmaps(e2fsck_t ctx); | |
11682 | extern void e2fsck_write_bitmaps(e2fsck_t ctx); | |
11683 | extern void preenhalt(e2fsck_t ctx); | |
11684 | extern char *string_copy(e2fsck_t ctx, const char *str, int len); | |
11685 | ||
11686 | extern void print_resource_track(const char *desc, | |
11687 | struct resource_track *track); | |
11688 | extern void init_resource_track(struct resource_track *track); | |
11689 | ||
11690 | extern int inode_has_valid_blocks(struct ext2_inode *inode); | |
11691 | extern void e2fsck_read_inode(e2fsck_t ctx, unsigned long ino, | |
11692 | struct ext2_inode * inode, const char * proc); | |
11693 | extern void e2fsck_write_inode(e2fsck_t ctx, unsigned long ino, | |
11694 | struct ext2_inode * inode, const char * proc); | |
11695 | extern void e2fsck_write_inode_full(e2fsck_t ctx, unsigned long ino, | |
11696 | struct ext2_inode * inode, int bufsize, | |
11697 | const char *proc); | |
11698 | ||
11699 | ||
11700 | ||
11701 | extern blk_t get_backup_sb(e2fsck_t ctx, ext2_filsys fs, | |
11702 | const char *name, io_manager manager); | |
11703 | extern int ext2_file_type(unsigned int mode); | |
11704 | ||
11705 | ||
11706 | extern void e2fsck_clear_progbar(e2fsck_t ctx); | |
11707 | extern int e2fsck_simple_progress(e2fsck_t ctx, const char *label, | |
11708 | float percent, unsigned int dpynum); | |
11709 | # 51 "unix.c" 2 | |
11710 | # 1 "problem.h" 1 | |
11711 | # 12 "problem.h" | |
11712 | typedef __u32 problem_t; | |
11713 | ||
11714 | struct problem_context { | |
11715 | errcode_t errcode; | |
11716 | ext2_ino_t ino, ino2, dir; | |
11717 | struct ext2_inode *inode; | |
11718 | struct ext2_dir_entry *dirent; | |
11719 | blk_t blk, blk2; | |
11720 | e2_blkcnt_t blkcount; | |
11721 | int group; | |
11722 | __u64 num; | |
11723 | const char *str; | |
11724 | }; | |
11725 | ||
11726 | ||
11727 | ||
11728 | ||
11729 | ||
11730 | ||
11731 | #define PR_LATCH_MASK 0x0ff0 | |
11732 | #define PR_LATCH_BLOCK 0x0010 | |
11733 | #define PR_LATCH_BBLOCK 0x0020 | |
11734 | #define PR_LATCH_IBITMAP 0x0030 | |
11735 | #define PR_LATCH_BBITMAP 0x0040 | |
11736 | #define PR_LATCH_RELOC 0x0050 | |
11737 | #define PR_LATCH_DBLOCK 0x0060 | |
11738 | #define PR_LATCH_LOW_DTIME 0x0070 | |
11739 | #define PR_LATCH_TOOBIG 0x0080 | |
11740 | #define PR_LATCH_OPTIMIZE_DIR 0x0090 | |
11741 | ||
11742 | #define PR_LATCH(x) ((((x) & PR_LATCH_MASK) >> 4) - 1) | |
11743 | ||
11744 | ||
11745 | ||
11746 | ||
11747 | #define PRL_YES 0x0001 | |
11748 | #define PRL_NO 0x0002 | |
11749 | #define PRL_LATCHED 0x0004 | |
11750 | #define PRL_SUPPRESS 0x0008 | |
11751 | ||
11752 | #define PRL_VARIABLE 0x000f | |
11753 | ||
11754 | ||
11755 | ||
11756 | ||
11757 | ||
11758 | ||
11759 | #define PR_0_BB_NOT_GROUP 0x000001 | |
11760 | ||
11761 | ||
11762 | #define PR_0_IB_NOT_GROUP 0x000002 | |
11763 | ||
11764 | ||
11765 | #define PR_0_ITABLE_NOT_GROUP 0x000003 | |
11766 | ||
11767 | ||
11768 | #define PR_0_SB_CORRUPT 0x000004 | |
11769 | ||
11770 | ||
11771 | #define PR_0_FS_SIZE_WRONG 0x000005 | |
11772 | ||
11773 | ||
11774 | #define PR_0_NO_FRAGMENTS 0x000006 | |
11775 | ||
11776 | ||
11777 | #define PR_0_BLOCKS_PER_GROUP 0x000007 | |
11778 | ||
11779 | ||
11780 | #define PR_0_FIRST_DATA_BLOCK 0x000008 | |
11781 | ||
11782 | ||
11783 | #define PR_0_ADD_UUID 0x000009 | |
11784 | ||
11785 | ||
11786 | #define PR_0_RELOCATE_HINT 0x00000A | |
11787 | ||
11788 | ||
11789 | #define PR_0_MISC_CORRUPT_SUPER 0x00000B | |
11790 | ||
11791 | ||
11792 | #define PR_0_GETSIZE_ERROR 0x00000C | |
11793 | ||
11794 | ||
11795 | #define PR_0_INODE_COUNT_WRONG 0x00000D | |
11796 | ||
11797 | ||
11798 | #define PR_0_HURD_CLEAR_FILETYPE 0x00000E | |
11799 | ||
11800 | ||
11801 | #define PR_0_JOURNAL_BAD_INODE 0x00000F | |
11802 | ||
11803 | ||
11804 | #define PR_0_JOURNAL_UNSUPP_MULTIFS 0x000010 | |
11805 | ||
11806 | ||
11807 | #define PR_0_CANT_FIND_JOURNAL 0x000011 | |
11808 | ||
11809 | ||
11810 | #define PR_0_EXT_JOURNAL_BAD_SUPER 0x000012 | |
11811 | ||
11812 | ||
11813 | #define PR_0_JOURNAL_BAD_UUID 0x000013 | |
11814 | ||
11815 | ||
11816 | #define PR_0_JOURNAL_UNSUPP_SUPER 0x000014 | |
11817 | ||
11818 | ||
11819 | #define PR_0_JOURNAL_BAD_SUPER 0x000015 | |
11820 | ||
11821 | ||
11822 | #define PR_0_JOURNAL_HAS_JOURNAL 0x000016 | |
11823 | ||
11824 | ||
11825 | #define PR_0_JOURNAL_RECOVER_SET 0x000017 | |
11826 | ||
11827 | ||
11828 | #define PR_0_JOURNAL_RECOVERY_CLEAR 0x000018 | |
11829 | ||
11830 | ||
11831 | #define PR_0_JOURNAL_RESET_JOURNAL 0x000019 | |
11832 | ||
11833 | ||
11834 | #define PR_0_FS_REV_LEVEL 0x00001A | |
11835 | ||
11836 | ||
11837 | #define PR_0_ORPHAN_CLEAR_INODE 0x000020 | |
11838 | ||
11839 | ||
11840 | #define PR_0_ORPHAN_ILLEGAL_BLOCK_NUM 0x000021 | |
11841 | ||
11842 | ||
11843 | #define PR_0_ORPHAN_ALREADY_CLEARED_BLOCK 0x000022 | |
11844 | ||
11845 | ||
11846 | #define PR_0_ORPHAN_ILLEGAL_HEAD_INODE 0x000023 | |
11847 | ||
11848 | ||
11849 | #define PR_0_ORPHAN_ILLEGAL_INODE 0x000024 | |
11850 | ||
11851 | ||
11852 | #define PR_0_JOURNAL_UNSUPP_ROCOMPAT 0x000025 | |
11853 | ||
11854 | ||
11855 | #define PR_0_JOURNAL_UNSUPP_INCOMPAT 0x000026 | |
11856 | ||
11857 | ||
11858 | #define PR_0_JOURNAL_UNSUPP_VERSION 0x000027 | |
11859 | ||
11860 | ||
11861 | #define PR_0_MOVE_JOURNAL 0x000028 | |
11862 | ||
11863 | ||
11864 | #define PR_0_ERR_MOVE_JOURNAL 0x000029 | |
11865 | ||
11866 | ||
11867 | #define PR_0_CLEAR_V2_JOURNAL 0x00002A | |
11868 | ||
11869 | ||
11870 | #define PR_0_JOURNAL_RUN 0x00002B | |
11871 | ||
11872 | ||
11873 | #define PR_0_JOURNAL_RUN_DEFAULT 0x00002C | |
11874 | ||
11875 | ||
11876 | #define PR_0_BACKUP_JNL 0x00002D | |
11877 | ||
11878 | ||
11879 | #define PR_0_NONZERO_RESERVED_GDT_BLOCKS 0x00002E | |
11880 | ||
11881 | ||
11882 | #define PR_0_CLEAR_RESIZE_INODE 0x00002F | |
11883 | ||
11884 | ||
11885 | #define PR_0_RESIZE_INODE_INVALID 0x000030 | |
11886 | ||
11887 | ||
11888 | #define PR_0_FUTURE_SB_LAST_MOUNT 0x000031 | |
11889 | ||
11890 | ||
11891 | #define PR_0_FUTURE_SB_LAST_WRITE 0x000032 | |
11892 | ||
11893 | ||
11894 | #define PR_0_EXTERNAL_JOURNAL_HINT 0x000033 | |
11895 | ||
11896 | ||
11897 | #define PR_0_DIRHASH_HINT 0x000034 | |
11898 | ||
11899 | ||
11900 | ||
11901 | ||
11902 | ||
11903 | ||
11904 | #define PR_1_PASS_HEADER 0x010000 | |
11905 | ||
11906 | ||
11907 | #define PR_1_ROOT_NO_DIR 0x010001 | |
11908 | ||
11909 | ||
11910 | #define PR_1_ROOT_DTIME 0x010002 | |
11911 | ||
11912 | ||
11913 | #define PR_1_RESERVED_BAD_MODE 0x010003 | |
11914 | ||
11915 | ||
11916 | #define PR_1_ZERO_DTIME 0x010004 | |
11917 | ||
11918 | ||
11919 | #define PR_1_SET_DTIME 0x010005 | |
11920 | ||
11921 | ||
11922 | #define PR_1_ZERO_LENGTH_DIR 0x010006 | |
11923 | ||
11924 | ||
11925 | #define PR_1_BB_CONFLICT 0x010007 | |
11926 | ||
11927 | ||
11928 | #define PR_1_IB_CONFLICT 0x010008 | |
11929 | ||
11930 | ||
11931 | #define PR_1_ITABLE_CONFLICT 0x010009 | |
11932 | ||
11933 | ||
11934 | #define PR_1_BB_BAD_BLOCK 0x01000A | |
11935 | ||
11936 | ||
11937 | #define PR_1_IB_BAD_BLOCK 0x01000B | |
11938 | ||
11939 | ||
11940 | #define PR_1_BAD_I_SIZE 0x01000C | |
11941 | ||
11942 | ||
11943 | #define PR_1_BAD_I_BLOCKS 0x01000D | |
11944 | ||
11945 | ||
11946 | #define PR_1_ILLEGAL_BLOCK_NUM 0x01000E | |
11947 | ||
11948 | ||
11949 | #define PR_1_BLOCK_OVERLAPS_METADATA 0x01000F | |
11950 | ||
11951 | ||
11952 | #define PR_1_INODE_BLOCK_LATCH 0x010010 | |
11953 | ||
11954 | ||
11955 | #define PR_1_TOO_MANY_BAD_BLOCKS 0x010011 | |
11956 | ||
11957 | ||
11958 | #define PR_1_BB_ILLEGAL_BLOCK_NUM 0x010012 | |
11959 | ||
11960 | ||
11961 | #define PR_1_INODE_BBLOCK_LATCH 0x010013 | |
11962 | ||
11963 | ||
11964 | #define PR_1_DUP_BLOCKS_PREENSTOP 0x010014 | |
11965 | ||
11966 | ||
11967 | #define PR_1_BBINODE_BAD_METABLOCK 0x010015 | |
11968 | ||
11969 | ||
11970 | #define PR_1_BBINODE_BAD_METABLOCK_PROMPT 0x010016 | |
11971 | ||
11972 | ||
11973 | #define PR_1_BAD_PRIMARY_BLOCK 0x010017 | |
11974 | ||
11975 | ||
11976 | #define PR_1_BAD_PRIMARY_BLOCK_PROMPT 0x010018 | |
11977 | ||
11978 | ||
11979 | #define PR_1_BAD_PRIMARY_SUPERBLOCK 0x010019 | |
11980 | ||
11981 | ||
11982 | #define PR_1_BAD_PRIMARY_GROUP_DESCRIPTOR 0x01001A | |
11983 | ||
11984 | ||
11985 | #define PR_1_BAD_SUPERBLOCK 0x01001B | |
11986 | ||
11987 | ||
11988 | #define PR_1_BAD_GROUP_DESCRIPTORS 0x01001C | |
11989 | ||
11990 | ||
11991 | #define PR_1_PROGERR_CLAIMED_BLOCK 0x01001D | |
11992 | ||
11993 | ||
11994 | #define PR_1_RELOC_BLOCK_ALLOCATE 0x01001E | |
11995 | ||
11996 | ||
11997 | #define PR_1_RELOC_MEMORY_ALLOCATE 0x01001F | |
11998 | ||
11999 | ||
12000 | #define PR_1_RELOC_FROM_TO 0x010020 | |
12001 | ||
12002 | ||
12003 | #define PR_1_RELOC_TO 0x010021 | |
12004 | ||
12005 | ||
12006 | #define PR_1_RELOC_READ_ERR 0x010022 | |
12007 | ||
12008 | ||
12009 | #define PR_1_RELOC_WRITE_ERR 0x010023 | |
12010 | ||
12011 | ||
12012 | #define PR_1_ALLOCATE_IBITMAP_ERROR 0x010024 | |
12013 | ||
12014 | ||
12015 | #define PR_1_ALLOCATE_BBITMAP_ERROR 0x010025 | |
12016 | ||
12017 | ||
12018 | #define PR_1_ALLOCATE_ICOUNT 0x010026 | |
12019 | ||
12020 | ||
12021 | #define PR_1_ALLOCATE_DBCOUNT 0x010027 | |
12022 | ||
12023 | ||
12024 | #define PR_1_ISCAN_ERROR 0x010028 | |
12025 | ||
12026 | ||
12027 | #define PR_1_BLOCK_ITERATE 0x010029 | |
12028 | ||
12029 | ||
12030 | #define PR_1_ICOUNT_STORE 0x01002A | |
12031 | ||
12032 | ||
12033 | #define PR_1_ADD_DBLOCK 0x01002B | |
12034 | ||
12035 | ||
12036 | #define PR_1_READ_INODE 0x01002C | |
12037 | ||
12038 | ||
12039 | #define PR_1_SUPPRESS_MESSAGES 0x01002D | |
12040 | ||
12041 | ||
12042 | #define PR_1_SET_IMAGIC 0x01002F | |
12043 | ||
12044 | ||
12045 | #define PR_1_SET_IMMUTABLE 0x010030 | |
12046 | ||
12047 | ||
12048 | #define PR_1_COMPR_SET 0x010031 | |
12049 | ||
12050 | ||
12051 | #define PR_1_SET_NONZSIZE 0x010032 | |
12052 | ||
12053 | ||
12054 | #define PR_1_FS_REV_LEVEL 0x010033 | |
12055 | ||
12056 | ||
12057 | #define PR_1_JOURNAL_INODE_NOT_CLEAR 0x010034 | |
12058 | ||
12059 | ||
12060 | #define PR_1_JOURNAL_BAD_MODE 0x010035 | |
12061 | ||
12062 | ||
12063 | #define PR_1_LOW_DTIME 0x010036 | |
12064 | ||
12065 | ||
12066 | #define PR_1_ORPHAN_LIST_REFUGEES 0x010037 | |
12067 | ||
12068 | ||
12069 | #define PR_1_ALLOCATE_REFCOUNT 0x010038 | |
12070 | ||
12071 | ||
12072 | #define PR_1_READ_EA_BLOCK 0x010039 | |
12073 | ||
12074 | ||
12075 | #define PR_1_BAD_EA_BLOCK 0x01003A | |
12076 | ||
12077 | ||
12078 | #define PR_1_EXTATTR_READ_ABORT 0x01003B | |
12079 | ||
12080 | ||
12081 | #define PR_1_EXTATTR_REFCOUNT 0x01003C | |
12082 | ||
12083 | ||
12084 | #define PR_1_EXTATTR_WRITE 0x01003D | |
12085 | ||
12086 | ||
12087 | #define PR_1_EA_MULTI_BLOCK 0x01003E | |
12088 | ||
12089 | ||
12090 | #define PR_1_EA_ALLOC_REGION 0x01003F | |
12091 | ||
12092 | ||
12093 | #define PR_1_EA_ALLOC_COLLISION 0x010040 | |
12094 | ||
12095 | ||
12096 | #define PR_1_EA_BAD_NAME 0x010041 | |
12097 | ||
12098 | ||
12099 | #define PR_1_EA_BAD_VALUE 0x010042 | |
12100 | ||
12101 | ||
12102 | #define PR_1_INODE_TOOBIG 0x010043 | |
12103 | ||
12104 | ||
12105 | #define PR_1_TOOBIG_DIR 0x010044 | |
12106 | ||
12107 | ||
12108 | #define PR_1_TOOBIG_REG 0x010045 | |
12109 | ||
12110 | ||
12111 | #define PR_1_TOOBIG_SYMLINK 0x010046 | |
12112 | ||
12113 | ||
12114 | #define PR_1_HTREE_SET 0x010047 | |
12115 | ||
12116 | ||
12117 | #define PR_1_HTREE_NODIR 0x010048 | |
12118 | ||
12119 | ||
12120 | #define PR_1_HTREE_BADROOT 0x010049 | |
12121 | ||
12122 | ||
12123 | #define PR_1_HTREE_HASHV 0x01004A | |
12124 | ||
12125 | ||
12126 | #define PR_1_HTREE_INCOMPAT 0x01004B | |
12127 | ||
12128 | ||
12129 | #define PR_1_HTREE_DEPTH 0x01004C | |
12130 | ||
12131 | ||
12132 | #define PR_1_BB_FS_BLOCK 0x01004D | |
12133 | ||
12134 | ||
12135 | #define PR_1_RESIZE_INODE_CREATE 0x01004E | |
12136 | ||
12137 | ||
12138 | #define PR_1_EXTRA_ISIZE 0x01004F | |
12139 | ||
12140 | ||
12141 | #define PR_1_ATTR_NAME_LEN 0x010050 | |
12142 | ||
12143 | ||
12144 | #define PR_1_ATTR_VALUE_OFFSET 0x010051 | |
12145 | ||
12146 | ||
12147 | #define PR_1_ATTR_VALUE_BLOCK 0x010052 | |
12148 | ||
12149 | ||
12150 | #define PR_1_ATTR_VALUE_SIZE 0x010053 | |
12151 | ||
12152 | ||
12153 | #define PR_1_ATTR_HASH 0x010054 | |
12154 | ||
12155 | ||
12156 | #define PR_1_TREAT_AS_DIRECTORY 0x010055 | |
12157 | ||
12158 | ||
12159 | ||
12160 | ||
12161 | ||
12162 | ||
12163 | #define PR_1B_PASS_HEADER 0x011000 | |
12164 | ||
12165 | ||
12166 | #define PR_1B_DUP_BLOCK_HEADER 0x011001 | |
12167 | ||
12168 | ||
12169 | #define PR_1B_DUP_BLOCK 0x011002 | |
12170 | ||
12171 | ||
12172 | #define PR_1B_DUP_BLOCK_END 0x011003 | |
12173 | ||
12174 | ||
12175 | #define PR_1B_ISCAN_ERROR 0x011004 | |
12176 | ||
12177 | ||
12178 | #define PR_1B_ALLOCATE_IBITMAP_ERROR 0x011005 | |
12179 | ||
12180 | ||
12181 | #define PR_1B_BLOCK_ITERATE 0x0110006 | |
12182 | ||
12183 | ||
12184 | #define PR_1B_ADJ_EA_REFCOUNT 0x0110007 | |
12185 | ||
12186 | ||
12187 | ||
12188 | #define PR_1C_PASS_HEADER 0x012000 | |
12189 | ||
12190 | ||
12191 | ||
12192 | #define PR_1D_PASS_HEADER 0x013000 | |
12193 | ||
12194 | ||
12195 | #define PR_1D_DUP_FILE 0x013001 | |
12196 | ||
12197 | ||
12198 | #define PR_1D_DUP_FILE_LIST 0x013002 | |
12199 | ||
12200 | ||
12201 | #define PR_1D_SHARE_METADATA 0x013003 | |
12202 | ||
12203 | ||
12204 | #define PR_1D_NUM_DUP_INODES 0x013004 | |
12205 | ||
12206 | ||
12207 | #define PR_1D_DUP_BLOCKS_DEALT 0x013005 | |
12208 | ||
12209 | ||
12210 | #define PR_1D_CLONE_QUESTION 0x013006 | |
12211 | ||
12212 | ||
12213 | #define PR_1D_DELETE_QUESTION 0x013007 | |
12214 | ||
12215 | ||
12216 | #define PR_1D_CLONE_ERROR 0x013008 | |
12217 | ||
12218 | ||
12219 | ||
12220 | ||
12221 | ||
12222 | ||
12223 | #define PR_2_PASS_HEADER 0x020000 | |
12224 | ||
12225 | ||
12226 | #define PR_2_BAD_INODE_DOT 0x020001 | |
12227 | ||
12228 | ||
12229 | #define PR_2_BAD_INO 0x020002 | |
12230 | ||
12231 | ||
12232 | #define PR_2_UNUSED_INODE 0x020003 | |
12233 | ||
12234 | ||
12235 | #define PR_2_LINK_DOT 0x020004 | |
12236 | ||
12237 | ||
12238 | #define PR_2_BB_INODE 0x020005 | |
12239 | ||
12240 | ||
12241 | #define PR_2_LINK_DIR 0x020006 | |
12242 | ||
12243 | ||
12244 | #define PR_2_LINK_ROOT 0x020007 | |
12245 | ||
12246 | ||
12247 | #define PR_2_BAD_NAME 0x020008 | |
12248 | ||
12249 | ||
12250 | #define PR_2_MISSING_DOT 0x020009 | |
12251 | ||
12252 | ||
12253 | #define PR_2_MISSING_DOT_DOT 0x02000A | |
12254 | ||
12255 | ||
12256 | #define PR_2_1ST_NOT_DOT 0x02000B | |
12257 | ||
12258 | ||
12259 | #define PR_2_2ND_NOT_DOT_DOT 0x02000C | |
12260 | ||
12261 | ||
12262 | #define PR_2_FADDR_ZERO 0x02000D | |
12263 | ||
12264 | ||
12265 | #define PR_2_FILE_ACL_ZERO 0x02000E | |
12266 | ||
12267 | ||
12268 | #define PR_2_DIR_ACL_ZERO 0x02000F | |
12269 | ||
12270 | ||
12271 | #define PR_2_FRAG_ZERO 0x020010 | |
12272 | ||
12273 | ||
12274 | #define PR_2_FSIZE_ZERO 0x020011 | |
12275 | ||
12276 | ||
12277 | #define PR_2_BAD_MODE 0x020012 | |
12278 | ||
12279 | ||
12280 | #define PR_2_DIR_CORRUPTED 0x020013 | |
12281 | ||
12282 | ||
12283 | #define PR_2_FILENAME_LONG 0x020014 | |
12284 | ||
12285 | ||
12286 | #define PR_2_DIRECTORY_HOLE 0x020015 | |
12287 | ||
12288 | ||
12289 | #define PR_2_DOT_NULL_TERM 0x020016 | |
12290 | ||
12291 | ||
12292 | #define PR_2_DOT_DOT_NULL_TERM 0x020017 | |
12293 | ||
12294 | ||
12295 | #define PR_2_BAD_CHAR_DEV 0x020018 | |
12296 | ||
12297 | ||
12298 | #define PR_2_BAD_BLOCK_DEV 0x020019 | |
12299 | ||
12300 | ||
12301 | #define PR_2_DUP_DOT 0x02001A | |
12302 | ||
12303 | ||
12304 | #define PR_2_DUP_DOT_DOT 0x02001B | |
12305 | ||
12306 | ||
12307 | #define PR_2_NO_DIRINFO 0x02001C | |
12308 | ||
12309 | ||
12310 | #define PR_2_FINAL_RECLEN 0x02001D | |
12311 | ||
12312 | ||
12313 | #define PR_2_ALLOCATE_ICOUNT 0x02001E | |
12314 | ||
12315 | ||
12316 | #define PR_2_DBLIST_ITERATE 0x02001F | |
12317 | ||
12318 | ||
12319 | #define PR_2_READ_DIRBLOCK 0x020020 | |
12320 | ||
12321 | ||
12322 | #define PR_2_WRITE_DIRBLOCK 0x020021 | |
12323 | ||
12324 | ||
12325 | #define PR_2_ALLOC_DIRBOCK 0x020022 | |
12326 | ||
12327 | ||
12328 | #define PR_2_DEALLOC_INODE 0x020023 | |
12329 | ||
12330 | ||
12331 | #define PR_2_SPLIT_DOT 0x020024 | |
12332 | ||
12333 | ||
12334 | #define PR_2_BAD_FIFO 0x020025 | |
12335 | ||
12336 | ||
12337 | #define PR_2_BAD_SOCKET 0x020026 | |
12338 | ||
12339 | ||
12340 | #define PR_2_SET_FILETYPE 0x020027 | |
12341 | ||
12342 | ||
12343 | #define PR_2_BAD_FILETYPE 0x020028 | |
12344 | ||
12345 | ||
12346 | #define PR_2_CLEAR_FILETYPE 0x020029 | |
12347 | ||
12348 | ||
12349 | #define PR_2_NULL_NAME 0x020030 | |
12350 | ||
12351 | ||
12352 | #define PR_2_INVALID_SYMLINK 0x020031 | |
12353 | ||
12354 | ||
12355 | #define PR_2_FILE_ACL_BAD 0x020032 | |
12356 | ||
12357 | ||
12358 | #define PR_2_FEATURE_LARGE_FILES 0x020033 | |
12359 | ||
12360 | ||
12361 | #define PR_2_HTREE_NOTREF 0x020034 | |
12362 | ||
12363 | ||
12364 | #define PR_2_HTREE_DUPREF 0x020035 | |
12365 | ||
12366 | ||
12367 | #define PR_2_HTREE_MIN_HASH 0x020036 | |
12368 | ||
12369 | ||
12370 | #define PR_2_HTREE_MAX_HASH 0x020037 | |
12371 | ||
12372 | ||
12373 | #define PR_2_HTREE_CLEAR 0x020038 | |
12374 | ||
12375 | ||
12376 | ||
12377 | ||
12378 | ||
12379 | #define PR_2_HTREE_BADBLK 0x02003A | |
12380 | ||
12381 | ||
12382 | #define PR_2_ADJ_EA_REFCOUNT 0x02003B | |
12383 | ||
12384 | ||
12385 | #define PR_2_HTREE_BAD_ROOT 0x02003C | |
12386 | ||
12387 | ||
12388 | #define PR_2_HTREE_BAD_LIMIT 0x02003D | |
12389 | ||
12390 | ||
12391 | #define PR_2_HTREE_BAD_COUNT 0x02003E | |
12392 | ||
12393 | ||
12394 | #define PR_2_HTREE_HASH_ORDER 0x02003F | |
12395 | ||
12396 | ||
12397 | #define PR_2_HTREE_BAD_DEPTH 0x020040 | |
12398 | ||
12399 | ||
12400 | #define PR_2_DUPLICATE_DIRENT 0x020041 | |
12401 | ||
12402 | ||
12403 | #define PR_2_NON_UNIQUE_FILE 0x020042 | |
12404 | ||
12405 | ||
12406 | #define PR_2_REPORT_DUP_DIRENT 0x020043 | |
12407 | ||
12408 | ||
12409 | #define PR_2_BLOCKS_HI_ZERO 0x020044 | |
12410 | ||
12411 | ||
12412 | ||
12413 | ||
12414 | ||
12415 | ||
12416 | #define PR_3_PASS_HEADER 0x030000 | |
12417 | ||
12418 | ||
12419 | #define PR_3_NO_ROOT_INODE 0x030001 | |
12420 | ||
12421 | ||
12422 | #define PR_3_EXPAND_LF_DIR 0x030002 | |
12423 | ||
12424 | ||
12425 | #define PR_3_UNCONNECTED_DIR 0x030003 | |
12426 | ||
12427 | ||
12428 | #define PR_3_NO_LF_DIR 0x030004 | |
12429 | ||
12430 | ||
12431 | #define PR_3_BAD_DOT_DOT 0x030005 | |
12432 | ||
12433 | ||
12434 | #define PR_3_NO_LPF 0x030006 | |
12435 | ||
12436 | ||
12437 | #define PR_3_CANT_EXPAND_LPF 0x030007 | |
12438 | ||
12439 | ||
12440 | #define PR_3_CANT_RECONNECT 0x030008 | |
12441 | ||
12442 | ||
12443 | #define PR_3_ERR_FIND_LPF 0x030009 | |
12444 | ||
12445 | ||
12446 | #define PR_3_ERR_LPF_NEW_BLOCK 0x03000A | |
12447 | ||
12448 | ||
12449 | #define PR_3_ERR_LPF_NEW_INODE 0x03000B | |
12450 | ||
12451 | ||
12452 | #define PR_3_ERR_LPF_NEW_DIR_BLOCK 0x03000C | |
12453 | ||
12454 | ||
12455 | #define PR_3_ERR_LPF_WRITE_BLOCK 0x03000D | |
12456 | ||
12457 | ||
12458 | #define PR_3_ADJUST_INODE 0x03000E | |
12459 | ||
12460 | ||
12461 | #define PR_3_FIX_PARENT_ERR 0x03000F | |
12462 | ||
12463 | ||
12464 | #define PR_3_FIX_PARENT_NOFIND 0x030010 | |
12465 | ||
12466 | ||
12467 | #define PR_3_ALLOCATE_IBITMAP_ERROR 0x030011 | |
12468 | ||
12469 | ||
12470 | #define PR_3_CREATE_ROOT_ERROR 0x030012 | |
12471 | ||
12472 | ||
12473 | #define PR_3_CREATE_LPF_ERROR 0x030013 | |
12474 | ||
12475 | ||
12476 | #define PR_3_ROOT_NOT_DIR_ABORT 0x030014 | |
12477 | ||
12478 | ||
12479 | #define PR_3_NO_ROOT_INODE_ABORT 0x030015 | |
12480 | ||
12481 | ||
12482 | #define PR_3_NO_DIRINFO 0x030016 | |
12483 | ||
12484 | ||
12485 | #define PR_3_LPF_NOTDIR 0x030017 | |
12486 | ||
12487 | ||
12488 | ||
12489 | ||
12490 | ||
12491 | #define PR_3A_PASS_HEADER 0x031000 | |
12492 | ||
12493 | ||
12494 | #define PR_3A_OPTIMIZE_ITER 0x031001 | |
12495 | ||
12496 | ||
12497 | #define PR_3A_OPTIMIZE_DIR_ERR 0x031002 | |
12498 | ||
12499 | ||
12500 | #define PR_3A_OPTIMIZE_DIR_HEADER 0x031003 | |
12501 | ||
12502 | ||
12503 | #define PR_3A_OPTIMIZE_DIR 0x031004 | |
12504 | ||
12505 | ||
12506 | #define PR_3A_OPTIMIZE_DIR_END 0x031005 | |
12507 | ||
12508 | ||
12509 | ||
12510 | ||
12511 | ||
12512 | ||
12513 | #define PR_4_PASS_HEADER 0x040000 | |
12514 | ||
12515 | ||
12516 | #define PR_4_ZERO_LEN_INODE 0x040001 | |
12517 | ||
12518 | ||
12519 | #define PR_4_UNATTACHED_INODE 0x040002 | |
12520 | ||
12521 | ||
12522 | #define PR_4_BAD_REF_COUNT 0x040003 | |
12523 | ||
12524 | ||
12525 | #define PR_4_INCONSISTENT_COUNT 0x040004 | |
12526 | ||
12527 | ||
12528 | ||
12529 | ||
12530 | ||
12531 | ||
12532 | #define PR_5_PASS_HEADER 0x050000 | |
12533 | ||
12534 | ||
12535 | #define PR_5_INODE_BMAP_PADDING 0x050001 | |
12536 | ||
12537 | ||
12538 | #define PR_5_BLOCK_BMAP_PADDING 0x050002 | |
12539 | ||
12540 | ||
12541 | #define PR_5_BLOCK_BITMAP_HEADER 0x050003 | |
12542 | ||
12543 | ||
12544 | #define PR_5_BLOCK_UNUSED 0x050004 | |
12545 | ||
12546 | ||
12547 | #define PR_5_BLOCK_USED 0x050005 | |
12548 | ||
12549 | ||
12550 | #define PR_5_BLOCK_BITMAP_END 0x050006 | |
12551 | ||
12552 | ||
12553 | #define PR_5_INODE_BITMAP_HEADER 0x050007 | |
12554 | ||
12555 | ||
12556 | #define PR_5_INODE_UNUSED 0x050008 | |
12557 | ||
12558 | ||
12559 | #define PR_5_INODE_USED 0x050009 | |
12560 | ||
12561 | ||
12562 | #define PR_5_INODE_BITMAP_END 0x05000A | |
12563 | ||
12564 | ||
12565 | #define PR_5_FREE_INODE_COUNT_GROUP 0x05000B | |
12566 | ||
12567 | ||
12568 | #define PR_5_FREE_DIR_COUNT_GROUP 0x05000C | |
12569 | ||
12570 | ||
12571 | #define PR_5_FREE_INODE_COUNT 0x05000D | |
12572 | ||
12573 | ||
12574 | #define PR_5_FREE_BLOCK_COUNT_GROUP 0x05000E | |
12575 | ||
12576 | ||
12577 | #define PR_5_FREE_BLOCK_COUNT 0x05000F | |
12578 | ||
12579 | ||
12580 | #define PR_5_BMAP_ENDPOINTS 0x050010 | |
12581 | ||
12582 | ||
12583 | #define PR_5_FUDGE_BITMAP_ERROR 0x050011 | |
12584 | ||
12585 | ||
12586 | #define PR_5_COPY_IBITMAP_ERROR 0x050012 | |
12587 | ||
12588 | ||
12589 | #define PR_5_COPY_BBITMAP_ERROR 0x050013 | |
12590 | ||
12591 | ||
12592 | #define PR_5_BLOCK_RANGE_UNUSED 0x050014 | |
12593 | ||
12594 | ||
12595 | #define PR_5_BLOCK_RANGE_USED 0x050015 | |
12596 | ||
12597 | ||
12598 | #define PR_5_INODE_RANGE_UNUSED 0x050016 | |
12599 | ||
12600 | ||
12601 | #define PR_5_INODE_RANGE_USED 0x050017 | |
12602 | ||
12603 | ||
12604 | ||
12605 | ||
12606 | ||
12607 | ||
12608 | #define PR_6_RECREATE_JOURNAL 0x060001 | |
12609 | ||
12610 | ||
12611 | ||
12612 | ||
12613 | int fix_problem(e2fsck_t ctx, problem_t code, struct problem_context *pctx); | |
12614 | int end_problem_latch(e2fsck_t ctx, int mask); | |
12615 | int set_latch_flags(int mask, int setflags, int clearflags); | |
12616 | int get_latch_flags(int mask, int *value); | |
12617 | void clear_problem_context(struct problem_context *ctx); | |
12618 | ||
12619 | ||
12620 | void print_e2fsck_message(e2fsck_t ctx, const char *msg, | |
12621 | struct problem_context *pctx, int first, | |
12622 | int recurse); | |
12623 | # 52 "unix.c" 2 | |
12624 | # 1 "../version.h" 1 | |
12625 | # 10 "../version.h" | |
12626 | #define E2FSPROGS_VERSION "1.40.4" | |
12627 | #define E2FSPROGS_DATE "31-Dec-2007" | |
12628 | # 53 "unix.c" 2 | |
12629 | ||
12630 | ||
12631 | static int swapfs; | |
12632 | static int normalize_swapfs; | |
12633 | static int cflag; | |
12634 | static int show_version_only; | |
12635 | static int verbose; | |
12636 | ||
12637 | static int replace_bad_blocks; | |
12638 | static int keep_bad_blocks; | |
12639 | static char *bad_blocks_file; | |
12640 | ||
12641 | e2fsck_t e2fsck_global_ctx; | |
12642 | ||
12643 | ||
12644 | ||
12645 | ||
12646 | ||
12647 | static void usage(e2fsck_t ctx) | |
12648 | { | |
12649 | fprintf(stderr, | |
12650 | (dcgettext (((void *)0), "Usage: %s [-panyrcdfvstDFSV] [-b superblock] [-B blocksize]\n" "\t\t[-I inode_buffer_blocks] [-P process_inode_size]\n" "\t\t[-l|-L bad_blocks_file] [-C fd] [-j external_journal]\n" "\t\t[-E extended-options] device\n", __LC_MESSAGES)), | |
12651 | ||
12652 | ||
12653 | ||
12654 | ctx->program_name); | |
12655 | ||
12656 | fprintf(stderr, (dcgettext (((void *)0), "\nEmergency help:\n" " -p Automatic repair (no questions)\n" " -n Make no changes to the filesystem\n" " -y Assume \"yes\" to all questions\n" " -c Check for bad blocks and add them to the badblock list\n" " -f Force checking even if filesystem is marked clean\n", __LC_MESSAGES))); | |
12657 | ||
12658 | ||
12659 | ||
12660 | ||
12661 | ||
12662 | fprintf(stderr, (dcgettext (((void *)0), "" " -v Be verbose\n" " -b superblock Use alternative superblock\n" " -B blocksize Force blocksize when looking for superblock\n" " -j external_journal Set location of the external journal\n" " -l bad_blocks_file Add to badblocks list\n" " -L bad_blocks_file Set badblocks list\n", __LC_MESSAGES))); | |
12663 | # 95 "unix.c" | |
12664 | exit(16); | |
12665 | } | |
12666 | ||
12667 | static void show_stats(e2fsck_t ctx) | |
12668 | { | |
12669 | ext2_filsys fs = ctx->fs; | |
12670 | ext2_ino_t inodes, inodes_used; | |
12671 | blk_t blocks, blocks_used; | |
12672 | int dir_links; | |
12673 | int num_files, num_links; | |
12674 | int frag_percent; | |
12675 | ||
12676 | dir_links = 2 * ctx->fs_directory_count - 1; | |
12677 | num_files = ctx->fs_total_count - dir_links; | |
12678 | num_links = ctx->fs_links_count - dir_links; | |
12679 | inodes = fs->super->s_inodes_count; | |
12680 | inodes_used = (fs->super->s_inodes_count - | |
12681 | fs->super->s_free_inodes_count); | |
12682 | blocks = fs->super->s_blocks_count; | |
12683 | blocks_used = (fs->super->s_blocks_count - | |
12684 | fs->super->s_free_blocks_count); | |
12685 | ||
12686 | frag_percent = (10000 * ctx->fs_fragmented) / inodes_used; | |
12687 | frag_percent = (frag_percent + 5) / 10; | |
12688 | ||
12689 | if (!verbose) { | |
12690 | printf((dcgettext (((void *)0), "%s: %u/%u files (%0d.%d%% non-contiguous), %u/%u blocks\n", __LC_MESSAGES)), | |
12691 | ctx->device_name, inodes_used, inodes, | |
12692 | frag_percent / 10, frag_percent % 10, | |
12693 | blocks_used, blocks); | |
12694 | return; | |
12695 | } | |
12696 | printf ((dcngettext (((void *)0), "\n%8u inode used (%2.2f%%)\n", "\n%8u inodes used (%2.2f%%)\n", inodes_used, __LC_MESSAGES)), inodes_used, 100.0 * inodes_used / inodes); | |
12697 | ||
12698 | printf ((dcngettext (((void *)0), "%8u non-contiguous inode (%0d.%d%%)\n", "%8u non-contiguous inodes (%0d.%d%%)\n", ctx->fs_fragmented, __LC_MESSAGES)), | |
12699 | ||
12700 | ||
12701 | ctx->fs_fragmented, frag_percent / 10, frag_percent % 10); | |
12702 | printf ((dcgettext (((void *)0), " # of inodes with ind/dind/tind blocks: %u/%u/%u\n", __LC_MESSAGES)), | |
12703 | ctx->fs_ind_count, ctx->fs_dind_count, ctx->fs_tind_count); | |
12704 | printf ((dcngettext (((void *)0), "%8u block used (%2.2f%%)\n", "%8u blocks used (%2.2f%%)\n", blocks_used, __LC_MESSAGES)), blocks_used, 100.0 * blocks_used / blocks); | |
12705 | ||
12706 | printf ((dcngettext (((void *)0), "%8u bad block\n", "%8u bad blocks\n", ctx->fs_badblocks_count, __LC_MESSAGES)), ctx->fs_badblocks_count); | |
12707 | ||
12708 | printf ((dcngettext (((void *)0), "%8u large file\n", "%8u large files\n", ctx->large_files, __LC_MESSAGES)), ctx->large_files); | |
12709 | ||
12710 | printf ((dcngettext (((void *)0), "\n%8u regular file\n", "\n%8u regular files\n", ctx->fs_regular_count, __LC_MESSAGES)), ctx->fs_regular_count); | |
12711 | ||
12712 | printf ((dcngettext (((void *)0), "%8u directory\n", "%8u directories\n", ctx->fs_directory_count, __LC_MESSAGES)), ctx->fs_directory_count); | |
12713 | ||
12714 | printf ((dcngettext (((void *)0), "%8u character device file\n", "%8u character device files\n", ctx->fs_chardev_count, __LC_MESSAGES)), | |
12715 | ||
12716 | ctx->fs_chardev_count); | |
12717 | printf ((dcngettext (((void *)0), "%8u block device file\n", "%8u block device files\n", ctx->fs_blockdev_count, __LC_MESSAGES)), ctx->fs_blockdev_count); | |
12718 | ||
12719 | printf ((dcngettext (((void *)0), "%8u fifo\n", "%8u fifos\n", ctx->fs_fifo_count, __LC_MESSAGES)), | |
12720 | ctx->fs_fifo_count); | |
12721 | printf ((dcngettext (((void *)0), "%8u link\n", "%8u links\n", ctx->fs_links_count - dir_links, __LC_MESSAGES)), | |
12722 | ||
12723 | ctx->fs_links_count - dir_links); | |
12724 | printf ((dcngettext (((void *)0), "%8u symbolic link", "%8u symbolic links", ctx->fs_symlinks_count, __LC_MESSAGES)), ctx->fs_symlinks_count); | |
12725 | ||
12726 | printf ((dcngettext (((void *)0), " (%u fast symbolic link)\n", " (%u fast symbolic links)\n", ctx->fs_fast_symlinks_count, __LC_MESSAGES)), ctx->fs_fast_symlinks_count); | |
12727 | ||
12728 | printf ((dcngettext (((void *)0), "%8u socket\n", "%8u sockets\n", ctx->fs_sockets_count, __LC_MESSAGES)), | |
12729 | ctx->fs_sockets_count); | |
12730 | printf ("--------\n"); | |
12731 | printf ((dcngettext (((void *)0), "%8u file\n", "%8u files\n", ctx->fs_total_count - dir_links, __LC_MESSAGES)), | |
12732 | ||
12733 | ctx->fs_total_count - dir_links); | |
12734 | } | |
12735 | ||
12736 | static void check_mount(e2fsck_t ctx) | |
12737 | { | |
12738 | errcode_t retval; | |
12739 | int cont; | |
12740 | ||
12741 | retval = ext2fs_check_if_mounted(ctx->filesystem_name, | |
12742 | &ctx->mount_flags); | |
12743 | if (retval) { | |
12744 | com_err("ext2fs_check_if_mount", retval, | |
12745 | (dcgettext (((void *)0), "while determining whether %s is mounted.", __LC_MESSAGES)), | |
12746 | ctx->filesystem_name); | |
12747 | return; | |
12748 | } | |
12749 | ||
12750 | ||
12751 | ||
12752 | ||
12753 | ||
12754 | ||
12755 | if ((!(ctx->mount_flags & 1)) || | |
12756 | ((ctx->mount_flags & 2) && | |
12757 | (ctx->mount_flags & 4) && | |
12758 | !(ctx->options & 0x0200))) | |
12759 | return; | |
12760 | ||
12761 | if ((ctx->options & 0x0001) && | |
12762 | !(ctx->options & 0x0200)) { | |
12763 | printf((dcgettext (((void *)0), "Warning! %s is mounted.\n", __LC_MESSAGES)), ctx->filesystem_name); | |
12764 | return; | |
12765 | } | |
12766 | ||
12767 | printf((dcgettext (((void *)0), "%s is mounted. ", __LC_MESSAGES)), ctx->filesystem_name); | |
12768 | if (!ctx->interactive) | |
12769 | fatal_error(ctx, (dcgettext (((void *)0), "Cannot continue, aborting.\n\n", __LC_MESSAGES))); | |
12770 | printf((dcgettext (((void *)0), "\n\n\007\007\007\007WARNING!!! " "Running e2fsck on a mounted filesystem may cause\n" "SEVERE filesystem damage.\007\007\007\n\n", __LC_MESSAGES))); | |
12771 | ||
12772 | ||
12773 | cont = ask_yn((dcgettext (((void *)0), "Do you really want to continue", __LC_MESSAGES)), -1); | |
12774 | if (!cont) { | |
12775 | printf ((dcgettext (((void *)0), "check aborted.\n", __LC_MESSAGES))); | |
12776 | exit (0); | |
12777 | } | |
12778 | return; | |
12779 | } | |
12780 | ||
12781 | static int is_on_batt(void) | |
12782 | { | |
12783 | FILE *f; | |
12784 | DIR *d; | |
12785 | char tmp[80], tmp2[80], fname[80]; | |
12786 | unsigned int acflag; | |
12787 | struct dirent* de; | |
12788 | ||
12789 | f = fopen("/proc/apm", "r"); | |
12790 | if (f) { | |
12791 | if (fscanf(f, "%s %s %s %x", tmp, tmp, tmp, &acflag) != 4) | |
12792 | acflag = 1; | |
12793 | fclose(f); | |
12794 | return (acflag != 1); | |
12795 | } | |
12796 | d = opendir("/proc/acpi/ac_adapter"); | |
12797 | if (d) { | |
12798 | while ((de=readdir(d)) != ((void *)0)) { | |
12799 | if (!(__extension__ (__builtin_constant_p (1) && ((__builtin_constant_p (".") && strlen (".") < ((size_t) (1))) || (__builtin_constant_p (de->d_name) && strlen (de->d_name) < ((size_t) (1)))) ? __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (".") && __builtin_constant_p (de->d_name) && (__s1_len = strlen ("."), __s2_len = strlen (de->d_name), (!((size_t)(const void *)((".") + 1) - (size_t)(const void *)(".") == 1) || __s1_len >= 4) && (!((size_t)(const void *)((de->d_name) + 1) - (size_t)(const void *)(de->d_name) == 1) || __s2_len >= 4)) ? __builtin_strcmp (".", de->d_name) : (__builtin_constant_p (".") && ((size_t)(const void *)((".") + 1) - (size_t)(const void *)(".") == 1) && (__s1_len = strlen ("."), __s1_len < 4) ? (__builtin_constant_p (de->d_name) && ((size_t)(const void *)((de->d_name) + 1) - (size_t)(const void *)(de->d_name) == 1) ? __builtin_strcmp (".", de->d_name) : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) (de->d_name); register int __result = (((__const unsigned char *) (__const char *) ("."))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ("."))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ("."))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) ("."))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p (de->d_name) && ((size_t)(const void *)((de->d_name) + 1) - (size_t)(const void *)(de->d_name) == 1) && (__s2_len = strlen (de->d_name), __s2_len < 4) ? (__builtin_constant_p (".") && ((size_t)(const void *)((".") + 1) - (size_t)(const void *)(".") == 1) ? __builtin_strcmp (".", de->d_name) : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) ("."); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) (de->d_name))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) (de->d_name))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) (de->d_name))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) (de->d_name))[3]); } } __result; }))) : __builtin_strcmp (".", de->d_name)))); }) : strncmp (".", de->d_name, 1)))) | |
12800 | continue; | |
12801 | snprintf(fname, 80, "/proc/acpi/ac_adapter/%s/state", | |
12802 | de->d_name); | |
12803 | f = fopen(fname, "r"); | |
12804 | if (!f) | |
12805 | continue; | |
12806 | if (fscanf(f, "%s %s", tmp2, tmp) != 2) | |
12807 | tmp[0] = 0; | |
12808 | fclose(f); | |
12809 | if ((__extension__ (__builtin_constant_p (8) && ((__builtin_constant_p (tmp) && strlen (tmp) < ((size_t) (8))) || (__builtin_constant_p ("off-line") && strlen ("off-line") < ((size_t) (8)))) ? __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (tmp) && __builtin_constant_p ("off-line") && (__s1_len = strlen (tmp), __s2_len = strlen ("off-line"), (!((size_t)(const void *)((tmp) + 1) - (size_t)(const void *)(tmp) == 1) || __s1_len >= 4) && (!((size_t)(const void *)(("off-line") + 1) - (size_t)(const void *)("off-line") == 1) || __s2_len >= 4)) ? __builtin_strcmp (tmp, "off-line") : (__builtin_constant_p (tmp) && ((size_t)(const void *)((tmp) + 1) - (size_t)(const void *)(tmp) == 1) && (__s1_len = strlen (tmp), __s1_len < 4) ? (__builtin_constant_p ("off-line") && ((size_t)(const void *)(("off-line") + 1) - (size_t)(const void *)("off-line") == 1) ? __builtin_strcmp (tmp, "off-line") : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ("off-line"); register int __result = (((__const unsigned char *) (__const char *) (tmp))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (tmp))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (tmp))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (tmp))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p ("off-line") && ((size_t)(const void *)(("off-line") + 1) - (size_t)(const void *)("off-line") == 1) && (__s2_len = strlen ("off-line"), __s2_len < 4) ? (__builtin_constant_p (tmp) && ((size_t)(const void *)((tmp) + 1) - (size_t)(const void *)(tmp) == 1) ? __builtin_strcmp (tmp, "off-line") : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) (tmp); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ("off-line"))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ("off-line"))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ("off-line"))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ("off-line"))[3]); } } __result; }))) : __builtin_strcmp (tmp, "off-line")))); }) : strncmp (tmp, "off-line", 8))) == 0) { | |
12810 | closedir(d); | |
12811 | return 1; | |
12812 | } | |
12813 | } | |
12814 | closedir(d); | |
12815 | } | |
12816 | return 0; | |
12817 | } | |
12818 | ||
12819 | ||
12820 | ||
12821 | ||
12822 | ||
12823 | ||
12824 | static void check_if_skip(e2fsck_t ctx) | |
12825 | { | |
12826 | ext2_filsys fs = ctx->fs; | |
12827 | const char *reason = ((void *)0); | |
12828 | unsigned int reason_arg = 0; | |
12829 | long next_check; | |
12830 | int batt = is_on_batt(); | |
12831 | int defer_check_on_battery; | |
12832 | time_t lastcheck; | |
12833 | ||
12834 | profile_get_boolean(ctx->profile, "options", | |
12835 | "defer_check_on_battery", 0, 1, | |
12836 | &defer_check_on_battery); | |
12837 | if (!defer_check_on_battery) | |
12838 | batt = 0; | |
12839 | ||
12840 | if ((ctx->options & 0x0100) || bad_blocks_file || | |
12841 | cflag || swapfs) | |
12842 | return; | |
12843 | ||
12844 | lastcheck = fs->super->s_lastcheck; | |
12845 | if (lastcheck > ctx->now) | |
12846 | lastcheck -= ctx->time_fudge; | |
12847 | if ((fs->super->s_state & 0x0002) || | |
12848 | !ext2fs_test_valid(fs)) | |
12849 | reason = (dcgettext (((void *)0), " contains a file system with errors", __LC_MESSAGES)); | |
12850 | else if ((fs->super->s_state & 0x0001) == 0) | |
12851 | reason = (dcgettext (((void *)0), " was not cleanly unmounted", __LC_MESSAGES)); | |
12852 | else if (check_backup_super_block(ctx)) | |
12853 | reason = (dcgettext (((void *)0), " primary superblock features different from backup", __LC_MESSAGES)); | |
12854 | else if ((fs->super->s_max_mnt_count > 0) && | |
12855 | (fs->super->s_mnt_count >= | |
12856 | (unsigned) fs->super->s_max_mnt_count)) { | |
12857 | reason = (dcgettext (((void *)0), " has been mounted %u times without being checked", __LC_MESSAGES)); | |
12858 | reason_arg = fs->super->s_mnt_count; | |
12859 | if (batt && (fs->super->s_mnt_count < | |
12860 | (unsigned) fs->super->s_max_mnt_count*2)) | |
12861 | reason = 0; | |
12862 | } else if (fs->super->s_checkinterval && | |
12863 | ((ctx->now - lastcheck) >= fs->super->s_checkinterval)) { | |
12864 | reason = (dcgettext (((void *)0), " has gone %u days without being checked", __LC_MESSAGES)); | |
12865 | reason_arg = (ctx->now - fs->super->s_lastcheck)/(3600*24); | |
12866 | if (batt && ((ctx->now - fs->super->s_lastcheck) < | |
12867 | fs->super->s_checkinterval*2)) | |
12868 | reason = 0; | |
12869 | } | |
12870 | if (reason) { | |
12871 | fputs(ctx->device_name, stdout); | |
12872 | printf(reason, reason_arg); | |
12873 | fputs((dcgettext (((void *)0), ", check forced.\n", __LC_MESSAGES)), stdout); | |
12874 | return; | |
12875 | } | |
12876 | printf((dcgettext (((void *)0), "%s: clean, %u/%u files, %u/%u blocks", __LC_MESSAGES)), ctx->device_name, | |
12877 | fs->super->s_inodes_count - fs->super->s_free_inodes_count, | |
12878 | fs->super->s_inodes_count, | |
12879 | fs->super->s_blocks_count - fs->super->s_free_blocks_count, | |
12880 | fs->super->s_blocks_count); | |
12881 | next_check = 100000; | |
12882 | if (fs->super->s_max_mnt_count > 0) { | |
12883 | next_check = fs->super->s_max_mnt_count - fs->super->s_mnt_count; | |
12884 | if (next_check <= 0) | |
12885 | next_check = 1; | |
12886 | } | |
12887 | if (fs->super->s_checkinterval && | |
12888 | ((ctx->now - fs->super->s_lastcheck) >= fs->super->s_checkinterval)) | |
12889 | next_check = 1; | |
12890 | if (next_check <= 5) { | |
12891 | if (next_check == 1) { | |
12892 | if (batt) | |
12893 | fputs((dcgettext (((void *)0), " (check deferred; on battery)", __LC_MESSAGES)), | |
12894 | stdout); | |
12895 | else | |
12896 | fputs((dcgettext (((void *)0), " (check after next mount)", __LC_MESSAGES)), stdout); | |
12897 | } else | |
12898 | printf((dcgettext (((void *)0), " (check in %ld mounts)", __LC_MESSAGES)), next_check); | |
12899 | } | |
12900 | fputc('\n', stdout); | |
12901 | ext2fs_close(fs); | |
12902 | ctx->fs = ((void *)0); | |
12903 | e2fsck_free_context(ctx); | |
12904 | exit(0); | |
12905 | } | |
12906 | ||
12907 | ||
12908 | ||
12909 | ||
12910 | struct percent_tbl { | |
12911 | int max_pass; | |
12912 | int table[32]; | |
12913 | }; | |
12914 | struct percent_tbl e2fsck_tbl = { | |
12915 | 5, { 0, 70, 90, 92, 95, 100 } | |
12916 | }; | |
12917 | static char bar[128], spaces[128]; | |
12918 | ||
12919 | static float calc_percent(struct percent_tbl *tbl, int pass, int curr, | |
12920 | int max) | |
12921 | { | |
12922 | float percent; | |
12923 | ||
12924 | if (pass <= 0) | |
12925 | return 0.0; | |
12926 | if (pass > tbl->max_pass || max == 0) | |
12927 | return 100.0; | |
12928 | percent = ((float) curr) / ((float) max); | |
12929 | return ((percent * (tbl->table[pass] - tbl->table[pass-1])) | |
12930 | + tbl->table[pass-1]); | |
12931 | } | |
12932 | ||
12933 | extern void e2fsck_clear_progbar(e2fsck_t ctx) | |
12934 | { | |
12935 | if (!(ctx->flags & 0x0020)) | |
12936 | return; | |
12937 | ||
12938 | printf("%s%s\r%s", ctx->start_meta, spaces + (sizeof(spaces) - 80), | |
12939 | ctx->stop_meta); | |
12940 | fflush(stdout); | |
12941 | ctx->flags &= ~0x0020; | |
12942 | } | |
12943 | ||
12944 | int e2fsck_simple_progress(e2fsck_t ctx, const char *label, float percent, | |
12945 | unsigned int dpynum) | |
12946 | { | |
12947 | static const char spinner[] = "\\|/-"; | |
12948 | int i; | |
12949 | unsigned int tick; | |
12950 | struct timeval tv; | |
12951 | int dpywidth; | |
12952 | int fixed_percent; | |
12953 | ||
12954 | if (ctx->flags & 0x0040) | |
12955 | return 0; | |
12956 | ||
12957 | ||
12958 | ||
12959 | ||
12960 | ||
12961 | ||
12962 | fixed_percent = (int) ((10 * percent) + 0.5); | |
12963 | if (ctx->progress_last_percent == fixed_percent) | |
12964 | return 0; | |
12965 | ctx->progress_last_percent = fixed_percent; | |
12966 | ||
12967 | ||
12968 | ||
12969 | ||
12970 | ||
12971 | ||
12972 | gettimeofday(&tv, ((void *)0)); | |
12973 | tick = (tv.tv_sec << 3) + (tv.tv_usec / (1000000 / 8)); | |
12974 | if ((tick == ctx->progress_last_time) && | |
12975 | (fixed_percent != 0) && (fixed_percent != 1000)) | |
12976 | return 0; | |
12977 | ctx->progress_last_time = tick; | |
12978 | ||
12979 | ||
12980 | ||
12981 | ||
12982 | ||
12983 | ctx->progress_pos = (ctx->progress_pos+1) & 3; | |
12984 | ctx->flags |= 0x0020; | |
12985 | ||
12986 | dpywidth = 66 - strlen(label); | |
12987 | dpywidth = 8 * (dpywidth / 8); | |
12988 | if (dpynum) | |
12989 | dpywidth -= 8; | |
12990 | ||
12991 | i = ((percent * dpywidth) + 50) / 100; | |
12992 | printf("%s%s: |%s%s", ctx->start_meta, label, | |
12993 | bar + (sizeof(bar) - (i+1)), | |
12994 | spaces + (sizeof(spaces) - (dpywidth - i + 1))); | |
12995 | if (fixed_percent == 1000) | |
12996 | fputc('|', stdout); | |
12997 | else | |
12998 | fputc(spinner[ctx->progress_pos & 3], stdout); | |
12999 | printf(" %4.1f%% ", percent); | |
13000 | if (dpynum) | |
13001 | printf("%u\r", dpynum); | |
13002 | else | |
13003 | fputs(" \r", stdout); | |
13004 | fputs(ctx->stop_meta, stdout); | |
13005 | ||
13006 | if (fixed_percent == 1000) | |
13007 | e2fsck_clear_progbar(ctx); | |
13008 | fflush(stdout); | |
13009 | ||
13010 | return 0; | |
13011 | } | |
13012 | ||
13013 | static int e2fsck_update_progress(e2fsck_t ctx, int pass, | |
13014 | unsigned long cur, unsigned long max) | |
13015 | { | |
13016 | char buf[80]; | |
13017 | float percent; | |
13018 | ||
13019 | if (pass == 0) | |
13020 | return 0; | |
13021 | ||
13022 | if (ctx->progress_fd) { | |
13023 | sprintf(buf, "%d %lu %lu\n", pass, cur, max); | |
13024 | write(ctx->progress_fd, buf, strlen(buf)); | |
13025 | } else { | |
13026 | percent = calc_percent(&e2fsck_tbl, pass, cur, max); | |
13027 | e2fsck_simple_progress(ctx, ctx->device_name, | |
13028 | percent, 0); | |
13029 | } | |
13030 | return 0; | |
13031 | } | |
13032 | ||
13033 | #define PATH_SET "PATH=/sbin" | |
13034 | ||
13035 | static void reserve_stdio_fds(void) | |
13036 | { | |
13037 | int fd; | |
13038 | ||
13039 | while (1) { | |
13040 | fd = open("/dev/null", 02); | |
13041 | if (fd > 2) | |
13042 | break; | |
13043 | if (fd < 0) { | |
13044 | fprintf(stderr, (dcgettext (((void *)0), "ERROR: Couldn't open " "/dev/null (%s)\n", __LC_MESSAGES)), | |
13045 | ||
13046 | strerror((*__errno_location ()))); | |
13047 | break; | |
13048 | } | |
13049 | } | |
13050 | close(fd); | |
13051 | } | |
13052 | ||
13053 | ||
13054 | static void signal_progress_on(int sig __attribute__((unused))) | |
13055 | { | |
13056 | e2fsck_t ctx = e2fsck_global_ctx; | |
13057 | ||
13058 | if (!ctx) | |
13059 | return; | |
13060 | ||
13061 | ctx->progress = e2fsck_update_progress; | |
13062 | ctx->progress_fd = 0; | |
13063 | } | |
13064 | ||
13065 | static void signal_progress_off(int sig __attribute__((unused))) | |
13066 | { | |
13067 | e2fsck_t ctx = e2fsck_global_ctx; | |
13068 | ||
13069 | if (!ctx) | |
13070 | return; | |
13071 | ||
13072 | e2fsck_clear_progbar(ctx); | |
13073 | ctx->progress = 0; | |
13074 | } | |
13075 | ||
13076 | static void signal_cancel(int sig __attribute__((unused))) | |
13077 | { | |
13078 | e2fsck_t ctx = e2fsck_global_ctx; | |
13079 | ||
13080 | if (!ctx) | |
13081 | exit(32); | |
13082 | ||
13083 | ctx->flags |= 0x0002; | |
13084 | } | |
13085 | ||
13086 | ||
13087 | static void parse_extended_opts(e2fsck_t ctx, const char *opts) | |
13088 | { | |
13089 | char *buf, *token, *next, *p, *arg; | |
13090 | int ea_ver; | |
13091 | int extended_usage = 0; | |
13092 | ||
13093 | buf = string_copy(ctx, opts, 0); | |
13094 | for (token = buf; token && *token; token = next) { | |
13095 | p = (__extension__ (__builtin_constant_p (',') && !__builtin_constant_p (token) && (',') == '\0' ? (char *) __rawmemchr (token, ',') : __builtin_strchr (token, ','))); | |
13096 | next = 0; | |
13097 | if (p) { | |
13098 | *p = 0; | |
13099 | next = p+1; | |
13100 | } | |
13101 | arg = (__extension__ (__builtin_constant_p ('=') && !__builtin_constant_p (token) && ('=') == '\0' ? (char *) __rawmemchr (token, '=') : __builtin_strchr (token, '='))); | |
13102 | if (arg) { | |
13103 | *arg = 0; | |
13104 | arg++; | |
13105 | } | |
13106 | if (__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (token) && __builtin_constant_p ("ea_ver") && (__s1_len = strlen (token), __s2_len = strlen ("ea_ver"), (!((size_t)(const void *)((token) + 1) - (size_t)(const void *)(token) == 1) || __s1_len >= 4) && (!((size_t)(const void *)(("ea_ver") + 1) - (size_t)(const void *)("ea_ver") == 1) || __s2_len >= 4)) ? __builtin_strcmp (token, "ea_ver") : (__builtin_constant_p (token) && ((size_t)(const void *)((token) + 1) - (size_t)(const void *)(token) == 1) && (__s1_len = strlen (token), __s1_len < 4) ? (__builtin_constant_p ("ea_ver") && ((size_t)(const void *)(("ea_ver") + 1) - (size_t)(const void *)("ea_ver") == 1) ? __builtin_strcmp (token, "ea_ver") : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ("ea_ver"); register int __result = (((__const unsigned char *) (__const char *) (token))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (token))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (token))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (token))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p ("ea_ver") && ((size_t)(const void *)(("ea_ver") + 1) - (size_t)(const void *)("ea_ver") == 1) && (__s2_len = strlen ("ea_ver"), __s2_len < 4) ? (__builtin_constant_p (token) && ((size_t)(const void *)((token) + 1) - (size_t)(const void *)(token) == 1) ? __builtin_strcmp (token, "ea_ver") : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) (token); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ("ea_ver"))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ("ea_ver"))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ("ea_ver"))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ("ea_ver"))[3]); } } __result; }))) : __builtin_strcmp (token, "ea_ver")))); }) == 0) { | |
13107 | if (!arg) { | |
13108 | extended_usage++; | |
13109 | continue; | |
13110 | } | |
13111 | ea_ver = strtoul(arg, &p, 0); | |
13112 | if (*p || | |
13113 | ((ea_ver != 1) && (ea_ver != 2))) { | |
13114 | fprintf(stderr, | |
13115 | (dcgettext (((void *)0), "Invalid EA version.\n", __LC_MESSAGES))); | |
13116 | extended_usage++; | |
13117 | continue; | |
13118 | } | |
13119 | ctx->ext_attr_ver = ea_ver; | |
13120 | } else { | |
13121 | fprintf(stderr, (dcgettext (((void *)0), "Unknown extended option: %s\n", __LC_MESSAGES)), | |
13122 | token); | |
13123 | extended_usage++; | |
13124 | } | |
13125 | } | |
13126 | free(buf); | |
13127 | ||
13128 | if (extended_usage) { | |
13129 | fputs(("\nExtended options are separated by commas, " | |
13130 | "and may take an argument which\n" | |
13131 | "is set off by an equals ('=') sign. " | |
13132 | "Valid extended options are:\n" | |
13133 | "\tea_ver=<ea_version (1 or 2)>\n\n"), stderr); | |
13134 | exit(1); | |
13135 | } | |
13136 | } | |
13137 | ||
13138 | static void syntax_err_report(const char *filename, long err, int line_num) | |
13139 | { | |
13140 | fprintf(stderr, | |
13141 | (dcgettext (((void *)0), "Syntax error in e2fsck config file (%s, line #%d)\n\t%s\n", __LC_MESSAGES)), | |
13142 | filename, line_num, error_message(err)); | |
13143 | exit(8); | |
13144 | } | |
13145 | ||
13146 | static const char *config_fn[] = { "/etc" "/e2fsck.conf", 0 }; | |
13147 | ||
13148 | static errcode_t PRS(int argc, char *argv[], e2fsck_t *ret_ctx) | |
13149 | { | |
13150 | int flush = 0; | |
13151 | int c, fd; | |
13152 | ||
13153 | ||
13154 | ||
13155 | e2fsck_t ctx; | |
13156 | errcode_t retval; | |
13157 | ||
13158 | struct sigaction sa; | |
13159 | ||
13160 | char *extended_opts = 0; | |
13161 | char *cp; | |
13162 | int res; | |
13163 | ||
13164 | ||
13165 | ||
13166 | ||
13167 | retval = e2fsck_allocate_context(&ctx); | |
13168 | if (retval) | |
13169 | return retval; | |
13170 | ||
13171 | *ret_ctx = ctx; | |
13172 | ||
13173 | setvbuf(stdout, ((void *)0), 2, 8192); | |
13174 | setvbuf(stderr, ((void *)0), 2, 8192); | |
13175 | if (isatty(0) && isatty(1)) { | |
13176 | ctx->interactive = 1; | |
13177 | } else { | |
13178 | ctx->start_meta[0] = '\001'; | |
13179 | ctx->stop_meta[0] = '\002'; | |
13180 | } | |
13181 | memset(bar, '=', sizeof(bar)-1); | |
13182 | memset(spaces, ' ', sizeof(spaces)-1); | |
13183 | add_error_table(&et_ext2_error_table); | |
13184 | add_error_table(&et_prof_error_table); | |
13185 | blkid_get_cache(&ctx->blkid, ((void *)0)); | |
13186 | ||
13187 | if (argc && *argv) | |
13188 | ctx->program_name = *argv; | |
13189 | else | |
13190 | ctx->program_name = "e2fsck"; | |
13191 | while ((c = getopt (argc, argv, "panyrcC:B:dE:fvtFVM:b:I:j:P:l:L:N:SsDk")) != (-1)) | |
13192 | switch (c) { | |
13193 | case 'C': | |
13194 | ctx->progress = e2fsck_update_progress; | |
13195 | res = sscanf(optarg, "%d", &ctx->progress_fd); | |
13196 | if (res != 1) | |
13197 | goto sscanf_err; | |
13198 | ||
13199 | if (!ctx->progress_fd) | |
13200 | break; | |
13201 | ||
13202 | fd = dup(ctx->progress_fd); | |
13203 | if (fd < 0) { | |
13204 | fprintf(stderr, | |
13205 | (dcgettext (((void *)0), "Error validating file descriptor %d: %s\n", __LC_MESSAGES)), | |
13206 | ctx->progress_fd, | |
13207 | error_message((*__errno_location ()))); | |
13208 | fatal_error(ctx, | |
13209 | (dcgettext (((void *)0), "Invalid completion information file descriptor", __LC_MESSAGES))); | |
13210 | } else | |
13211 | close(fd); | |
13212 | break; | |
13213 | case 'D': | |
13214 | ctx->options |= 0x0400; | |
13215 | break; | |
13216 | case 'E': | |
13217 | extended_opts = optarg; | |
13218 | break; | |
13219 | case 'p': | |
13220 | case 'a': | |
13221 | if (ctx->options & (0x0004|0x0008)) { | |
13222 | conflict_opt: | |
13223 | fatal_error(ctx, | |
13224 | (dcgettext (((void *)0), "Only one of the options -p/-a, -n or -y may be specified.", __LC_MESSAGES))); | |
13225 | } | |
13226 | ctx->options |= 0x0002; | |
13227 | break; | |
13228 | case 'n': | |
13229 | if (ctx->options & (0x0004|0x0002)) | |
13230 | goto conflict_opt; | |
13231 | ctx->options |= 0x0008; | |
13232 | break; | |
13233 | case 'y': | |
13234 | if (ctx->options & (0x0002|0x0008)) | |
13235 | goto conflict_opt; | |
13236 | ctx->options |= 0x0004; | |
13237 | break; | |
13238 | case 't': | |
13239 | ||
13240 | if (ctx->options & 0x0010) | |
13241 | ctx->options |= 0x0020; | |
13242 | else | |
13243 | ctx->options |= 0x0010; | |
13244 | ||
13245 | ||
13246 | ||
13247 | ||
13248 | break; | |
13249 | case 'c': | |
13250 | if (cflag++) | |
13251 | ctx->options |= 0x0200; | |
13252 | ctx->options |= 0x0040; | |
13253 | break; | |
13254 | case 'r': | |
13255 | ||
13256 | break; | |
13257 | case 'b': | |
13258 | res = sscanf(optarg, "%d", &ctx->use_superblock); | |
13259 | if (res != 1) | |
13260 | goto sscanf_err; | |
13261 | ctx->flags |= 0x0100; | |
13262 | break; | |
13263 | case 'B': | |
13264 | ctx->blocksize = atoi(optarg); | |
13265 | break; | |
13266 | case 'I': | |
13267 | res = sscanf(optarg, "%d", &ctx->inode_buffer_blocks); | |
13268 | if (res != 1) | |
13269 | goto sscanf_err; | |
13270 | break; | |
13271 | case 'j': | |
13272 | ctx->journal_name = string_copy(ctx, optarg, 0); | |
13273 | break; | |
13274 | case 'P': | |
13275 | res = sscanf(optarg, "%d", &ctx->process_inode_size); | |
13276 | if (res != 1) | |
13277 | goto sscanf_err; | |
13278 | break; | |
13279 | case 'L': | |
13280 | replace_bad_blocks++; | |
13281 | case 'l': | |
13282 | bad_blocks_file = string_copy(ctx, optarg, 0); | |
13283 | break; | |
13284 | case 'd': | |
13285 | ctx->options |= 0x0080; | |
13286 | break; | |
13287 | case 'f': | |
13288 | ctx->options |= 0x0100; | |
13289 | break; | |
13290 | case 'F': | |
13291 | flush = 1; | |
13292 | break; | |
13293 | case 'v': | |
13294 | verbose = 1; | |
13295 | break; | |
13296 | case 'V': | |
13297 | show_version_only = 1; | |
13298 | break; | |
13299 | ||
13300 | ||
13301 | ||
13302 | ||
13303 | ||
13304 | case 'N': | |
13305 | ctx->device_name = optarg; | |
13306 | break; | |
13307 | ||
13308 | case 's': | |
13309 | normalize_swapfs = 1; | |
13310 | case 'S': | |
13311 | swapfs = 1; | |
13312 | break; | |
13313 | # 752 "unix.c" | |
13314 | case 'k': | |
13315 | keep_bad_blocks++; | |
13316 | break; | |
13317 | default: | |
13318 | usage(ctx); | |
13319 | } | |
13320 | if (show_version_only) | |
13321 | return 0; | |
13322 | if (optind != argc - 1) | |
13323 | usage(ctx); | |
13324 | if ((ctx->options & 0x0008) && !bad_blocks_file && | |
13325 | !cflag && !swapfs && !(ctx->options & 0x0400)) | |
13326 | ctx->options |= 0x0001; | |
13327 | ctx->io_options = (__extension__ (__builtin_constant_p ('?') && !__builtin_constant_p (argv[optind]) && ('?') == '\0' ? (char *) __rawmemchr (argv[optind], '?') : __builtin_strchr (argv[optind], '?'))); | |
13328 | if (ctx->io_options) | |
13329 | *ctx->io_options++ = 0; | |
13330 | ctx->filesystem_name = blkid_get_devname(ctx->blkid, argv[optind], 0); | |
13331 | if (!ctx->filesystem_name) { | |
13332 | com_err(ctx->program_name, 0, (dcgettext (((void *)0), "Unable to resolve '%s'", __LC_MESSAGES)), | |
13333 | argv[optind]); | |
13334 | fatal_error(ctx, 0); | |
13335 | } | |
13336 | if (extended_opts) | |
13337 | parse_extended_opts(ctx, extended_opts); | |
13338 | ||
13339 | if ((cp = getenv("E2FSCK_CONFIG")) != ((void *)0)) | |
13340 | config_fn[0] = cp; | |
13341 | profile_set_syntax_err_cb(syntax_err_report); | |
13342 | profile_init(config_fn, &ctx->profile); | |
13343 | ||
13344 | if (flush) { | |
13345 | fd = open(ctx->filesystem_name, 00, 0); | |
13346 | if (fd < 0) { | |
13347 | com_err("open", (*__errno_location ()), | |
13348 | (dcgettext (((void *)0), "while opening %s for flushing", __LC_MESSAGES)), | |
13349 | ctx->filesystem_name); | |
13350 | fatal_error(ctx, 0); | |
13351 | } | |
13352 | if ((retval = ext2fs_sync_device(fd, 1))) { | |
13353 | com_err("ext2fs_sync_device", retval, | |
13354 | (dcgettext (((void *)0), "while trying to flush %s", __LC_MESSAGES)), | |
13355 | ctx->filesystem_name); | |
13356 | fatal_error(ctx, 0); | |
13357 | } | |
13358 | close(fd); | |
13359 | } | |
13360 | ||
13361 | if (swapfs) { | |
13362 | if (cflag || bad_blocks_file) { | |
13363 | fprintf(stderr, (dcgettext (((void *)0), "Incompatible options not " "allowed when byte-swapping.\n", __LC_MESSAGES))); | |
13364 | ||
13365 | exit(16); | |
13366 | } | |
13367 | } | |
13368 | ||
13369 | if (cflag && bad_blocks_file) { | |
13370 | fprintf(stderr, (dcgettext (((void *)0), "The -c and the -l/-L options may " "not be both used at the same time.\n", __LC_MESSAGES))); | |
13371 | ||
13372 | exit(16); | |
13373 | } | |
13374 | ||
13375 | ||
13376 | ||
13377 | ||
13378 | memset(&sa, 0, sizeof(struct sigaction)); | |
13379 | sa.__sigaction_handler.sa_handler = signal_cancel; | |
13380 | sigaction(2, &sa, 0); | |
13381 | sigaction(15, &sa, 0); | |
13382 | ||
13383 | sa.sa_flags = 0x10000000; | |
13384 | ||
13385 | e2fsck_global_ctx = ctx; | |
13386 | sa.__sigaction_handler.sa_handler = signal_progress_on; | |
13387 | sigaction(10, &sa, 0); | |
13388 | sa.__sigaction_handler.sa_handler = signal_progress_off; | |
13389 | sigaction(12, &sa, 0); | |
13390 | ||
13391 | ||
13392 | ||
13393 | if (cflag) { | |
13394 | char *oldpath = getenv("PATH"); | |
13395 | char *newpath; | |
13396 | int len = sizeof("PATH=/sbin") + 1; | |
13397 | ||
13398 | if (oldpath) | |
13399 | len += strlen(oldpath); | |
13400 | ||
13401 | newpath = malloc(len); | |
13402 | if (!newpath) | |
13403 | fatal_error(ctx, "Couldn't malloc() newpath"); | |
13404 | strcpy(newpath, "PATH=/sbin"); | |
13405 | ||
13406 | if (oldpath) { | |
13407 | strcat(newpath, ":"); | |
13408 | strcat(newpath, oldpath); | |
13409 | } | |
13410 | putenv(newpath); | |
13411 | } | |
13412 | # 861 "unix.c" | |
13413 | return 0; | |
13414 | ||
13415 | sscanf_err: | |
13416 | fprintf(stderr, (dcgettext (((void *)0), "\nInvalid non-numeric argument to -%c (\"%s\")\n\n", __LC_MESSAGES)), | |
13417 | c, optarg); | |
13418 | exit (1); | |
13419 | } | |
13420 | ||
13421 | static const char *my_ver_string = "1.40.4"; | |
13422 | static const char *my_ver_date = "31-Dec-2007"; | |
13423 | ||
13424 | int main (int argc, char *argv[]) | |
13425 | { | |
13426 | errcode_t retval = 0, orig_retval = 0; | |
13427 | int exit_value = 0; | |
13428 | ext2_filsys fs = 0; | |
13429 | io_manager io_ptr; | |
13430 | struct ext2_super_block *sb; | |
13431 | const char *lib_ver_date; | |
13432 | int my_ver, lib_ver; | |
13433 | e2fsck_t ctx; | |
13434 | struct problem_context pctx; | |
13435 | int flags, run_result; | |
13436 | int journal_size; | |
13437 | int sysval, sys_page_size = 4096; | |
13438 | ||
13439 | clear_problem_context(&pctx); | |
13440 | ||
13441 | ||
13442 | ||
13443 | ||
13444 | ||
13445 | ||
13446 | ||
13447 | setlocale(__LC_MESSAGES, ""); | |
13448 | setlocale(__LC_CTYPE, ""); | |
13449 | bindtextdomain("e2fsprogs", "/usr/share/locale"); | |
13450 | textdomain("e2fsprogs"); | |
13451 | ||
13452 | my_ver = ext2fs_parse_version_string(my_ver_string); | |
13453 | lib_ver = ext2fs_get_library_version(0, &lib_ver_date); | |
13454 | if (my_ver > lib_ver) { | |
13455 | fprintf( stderr, (dcgettext (((void *)0), "Error: ext2fs library version " "out of date!\n", __LC_MESSAGES))); | |
13456 | ||
13457 | show_version_only++; | |
13458 | } | |
13459 | ||
13460 | retval = PRS(argc, argv, &ctx); | |
13461 | if (retval) { | |
13462 | com_err("e2fsck", retval, | |
13463 | (dcgettext (((void *)0), "while trying to initialize program", __LC_MESSAGES))); | |
13464 | exit(8); | |
13465 | } | |
13466 | reserve_stdio_fds(); | |
13467 | ||
13468 | ||
13469 | init_resource_track(&ctx->global_rtrack); | |
13470 | ||
13471 | ||
13472 | if (!(ctx->options & 0x0002) || show_version_only) | |
13473 | fprintf(stderr, "e2fsck %s (%s)\n", my_ver_string, | |
13474 | my_ver_date); | |
13475 | ||
13476 | if (show_version_only) { | |
13477 | fprintf(stderr, (dcgettext (((void *)0), "\tUsing %s, %s\n", __LC_MESSAGES)), | |
13478 | error_message((2133571328L)), lib_ver_date); | |
13479 | exit(0); | |
13480 | } | |
13481 | ||
13482 | check_mount(ctx); | |
13483 | ||
13484 | if (!(ctx->options & 0x0002) && | |
13485 | !(ctx->options & 0x0008) && | |
13486 | !(ctx->options & 0x0004)) { | |
13487 | if (!ctx->interactive) | |
13488 | fatal_error(ctx, | |
13489 | (dcgettext (((void *)0), "need terminal for interactive repairs", __LC_MESSAGES))); | |
13490 | } | |
13491 | ctx->superblock = ctx->use_superblock; | |
13492 | restart: | |
13493 | ||
13494 | ||
13495 | ||
13496 | ||
13497 | io_ptr = unix_io_manager; | |
13498 | ||
13499 | flags = 0; | |
13500 | if ((ctx->options & 0x0001) == 0) | |
13501 | flags |= 0x01; | |
13502 | if ((ctx->mount_flags & 1) == 0) | |
13503 | flags |= 0x4000; | |
13504 | ||
13505 | if (ctx->superblock && ctx->blocksize) { | |
13506 | retval = ext2fs_open2(ctx->filesystem_name, ctx->io_options, | |
13507 | flags, ctx->superblock, ctx->blocksize, | |
13508 | io_ptr, &fs); | |
13509 | } else if (ctx->superblock) { | |
13510 | int blocksize; | |
13511 | for (blocksize = (1 << 10); | |
13512 | blocksize <= (1 << 16); blocksize *= 2) { | |
13513 | retval = ext2fs_open2(ctx->filesystem_name, | |
13514 | ctx->io_options, flags, | |
13515 | ctx->superblock, blocksize, | |
13516 | io_ptr, &fs); | |
13517 | if (!retval) | |
13518 | break; | |
13519 | } | |
13520 | } else | |
13521 | retval = ext2fs_open2(ctx->filesystem_name, ctx->io_options, | |
13522 | flags, 0, 0, io_ptr, &fs); | |
13523 | if (!ctx->superblock && !(ctx->options & 0x0002) && | |
13524 | !(ctx->flags & 0x0100) && | |
13525 | ((retval == (2133571347L)) || | |
13526 | (retval == (2133571388L)) || | |
13527 | ((retval == 0) && ext2fs_check_desc(fs)))) { | |
13528 | if (!fs || (fs->group_desc_count > 1)) { | |
13529 | printf((dcgettext (((void *)0), "%s: %s trying backup blocks...\n", __LC_MESSAGES)), | |
13530 | ctx->program_name, | |
13531 | retval ? (dcgettext (((void *)0), "Superblock invalid,", __LC_MESSAGES)) : | |
13532 | (dcgettext (((void *)0), "Group descriptors look bad...", __LC_MESSAGES))); | |
13533 | get_backup_sb(ctx, fs, ctx->filesystem_name, io_ptr); | |
13534 | if (fs) | |
13535 | ext2fs_close(fs); | |
13536 | orig_retval = retval; | |
13537 | goto restart; | |
13538 | } | |
13539 | } | |
13540 | if (retval) { | |
13541 | if (orig_retval) | |
13542 | retval = orig_retval; | |
13543 | com_err(ctx->program_name, retval, (dcgettext (((void *)0), "while trying to open %s", __LC_MESSAGES)), | |
13544 | ctx->filesystem_name); | |
13545 | if (retval == (2133571348L)) { | |
13546 | printf((dcgettext (((void *)0), "The filesystem revision is apparently " "too high for this version of e2fsck.\n" "(Or the filesystem superblock " "is corrupt)\n\n", __LC_MESSAGES))); | |
13547 | ||
13548 | ||
13549 | ||
13550 | fix_problem(ctx, 0x000004, &pctx); | |
13551 | } else if (retval == (2133571364L)) | |
13552 | printf((dcgettext (((void *)0), "Could this be a zero-length partition?\n", __LC_MESSAGES))); | |
13553 | else if ((retval == 1) || (retval == 13)) | |
13554 | printf((dcgettext (((void *)0), "You must have %s access to the " "filesystem or be root\n", __LC_MESSAGES)), | |
13555 | ||
13556 | (ctx->options & 0x0001) ? | |
13557 | "r/o" : "r/w"); | |
13558 | else if (retval == 6) | |
13559 | printf((dcgettext (((void *)0), "Possibly non-existent or swap device?\n", __LC_MESSAGES))); | |
13560 | else if (retval == 16) | |
13561 | printf((dcgettext (((void *)0), "Filesystem mounted or opened exclusively " "by another program?\n", __LC_MESSAGES))); | |
13562 | ||
13563 | ||
13564 | else if (retval == 30) | |
13565 | printf((dcgettext (((void *)0), "Disk write-protected; use the -n option " "to do a read-only\n" "check of the device.\n", __LC_MESSAGES))); | |
13566 | ||
13567 | ||
13568 | ||
13569 | else | |
13570 | fix_problem(ctx, 0x000004, &pctx); | |
13571 | fatal_error(ctx, 0); | |
13572 | } | |
13573 | # 1032 "unix.c" | |
13574 | fs->flags |= 0x200; | |
13575 | ||
13576 | if (!(ctx->flags & 0x0800)) { | |
13577 | __u32 blocksize = ((1 << 10) << (fs->super)->s_log_block_size); | |
13578 | int need_restart = 0; | |
13579 | ||
13580 | pctx.errcode = ext2fs_get_device_size(ctx->filesystem_name, | |
13581 | blocksize, | |
13582 | &ctx->num_blocks); | |
13583 | ||
13584 | ||
13585 | ||
13586 | ||
13587 | ||
13588 | ||
13589 | ||
13590 | if (pctx.errcode == 16) { | |
13591 | ext2fs_close(fs); | |
13592 | need_restart++; | |
13593 | pctx.errcode = | |
13594 | ext2fs_get_device_size(ctx->filesystem_name, | |
13595 | blocksize, | |
13596 | &ctx->num_blocks); | |
13597 | } | |
13598 | if (pctx.errcode == (2133571408L)) | |
13599 | ctx->num_blocks = 0; | |
13600 | else if (pctx.errcode) { | |
13601 | fix_problem(ctx, 0x00000C, &pctx); | |
13602 | ctx->flags |= 0x0001; | |
13603 | fatal_error(ctx, 0); | |
13604 | } | |
13605 | ctx->flags |= 0x0800; | |
13606 | if (need_restart) | |
13607 | goto restart; | |
13608 | } | |
13609 | ||
13610 | ctx->fs = fs; | |
13611 | fs->priv_data = ctx; | |
13612 | fs->now = ctx->now; | |
13613 | sb = fs->super; | |
13614 | if (sb->s_rev_level > 1) { | |
13615 | com_err(ctx->program_name, (2133571348L), | |
13616 | (dcgettext (((void *)0), "while trying to open %s", __LC_MESSAGES)), | |
13617 | ctx->filesystem_name); | |
13618 | get_newer: | |
13619 | fatal_error(ctx, (dcgettext (((void *)0), "Get a newer version of e2fsck!", __LC_MESSAGES))); | |
13620 | } | |
13621 | ||
13622 | ||
13623 | ||
13624 | ||
13625 | ||
13626 | if (ctx->device_name == 0 && | |
13627 | (sb->s_volume_name[0] != 0)) { | |
13628 | ctx->device_name = string_copy(ctx, sb->s_volume_name, | |
13629 | sizeof(sb->s_volume_name)); | |
13630 | } | |
13631 | if (ctx->device_name == 0) | |
13632 | ctx->device_name = ctx->filesystem_name; | |
13633 | ||
13634 | ||
13635 | ||
13636 | ||
13637 | retval = e2fsck_check_ext3_journal(ctx); | |
13638 | if (retval) { | |
13639 | com_err(ctx->program_name, retval, | |
13640 | (dcgettext (((void *)0), "while checking ext3 journal for %s", __LC_MESSAGES)), | |
13641 | ctx->device_name); | |
13642 | fatal_error(ctx, 0); | |
13643 | } | |
13644 | ||
13645 | ||
13646 | ||
13647 | ||
13648 | ||
13649 | if (sb->s_feature_incompat & 0x0004) { | |
13650 | if (ctx->options & 0x0001) { | |
13651 | printf((dcgettext (((void *)0), "Warning: skipping journal recovery " "because doing a read-only filesystem " "check.\n", __LC_MESSAGES))); | |
13652 | ||
13653 | ||
13654 | ((ctx->fs->io)->manager->flush((ctx->fs->io))); | |
13655 | } else { | |
13656 | if (ctx->flags & 0x0200) { | |
13657 | ||
13658 | ||
13659 | ||
13660 | ||
13661 | ||
13662 | ||
13663 | com_err(ctx->program_name, 0, | |
13664 | (dcgettext (((void *)0), "unable to set superblock flags on %s\n", __LC_MESSAGES)), ctx->device_name); | |
13665 | fatal_error(ctx, 0); | |
13666 | } | |
13667 | retval = e2fsck_run_ext3_journal(ctx); | |
13668 | if (retval) { | |
13669 | com_err(ctx->program_name, retval, | |
13670 | (dcgettext (((void *)0), "while recovering ext3 journal of %s", __LC_MESSAGES)), | |
13671 | ctx->device_name); | |
13672 | fatal_error(ctx, 0); | |
13673 | } | |
13674 | ext2fs_close(ctx->fs); | |
13675 | ctx->fs = 0; | |
13676 | ctx->flags |= 0x0200; | |
13677 | goto restart; | |
13678 | } | |
13679 | } | |
13680 | ||
13681 | ||
13682 | ||
13683 | ||
13684 | ||
13685 | if ((sb->s_feature_compat & ~(0x0001| 0x0002| 0x0004| 0x0010| 0x0020| 0x0040| 0x0008)) || | |
13686 | (sb->s_feature_incompat & ~(0x0002| 0x0008| 0x0010| 0x0004))) { | |
13687 | com_err(ctx->program_name, (2133571395L), | |
13688 | "(%s)", ctx->device_name); | |
13689 | goto get_newer; | |
13690 | } | |
13691 | if (sb->s_feature_ro_compat & ~(0x0001| 0x0002)) { | |
13692 | com_err(ctx->program_name, (2133571396L), | |
13693 | "(%s)", ctx->device_name); | |
13694 | goto get_newer; | |
13695 | } | |
13696 | # 1174 "unix.c" | |
13697 | if (ctx->superblock && | |
13698 | !(ctx->options & 0x0001)) | |
13699 | ext2fs_mark_super_dirty(fs); | |
13700 | ||
13701 | ||
13702 | ||
13703 | ||
13704 | ||
13705 | ||
13706 | ||
13707 | sysval = sysconf(_SC_PAGESIZE); | |
13708 | if (sysval > 0) | |
13709 | sys_page_size = sysval; | |
13710 | ||
13711 | ctx->blocks_per_page = sys_page_size / fs->blocksize; | |
13712 | if (ctx->blocks_per_page == 0) | |
13713 | ctx->blocks_per_page = 1; | |
13714 | ||
13715 | ehandler_init(fs->io); | |
13716 | ||
13717 | if (ctx->superblock) | |
13718 | set_latch_flags(0x0050, 0x0004, 0); | |
13719 | ext2fs_mark_valid(fs); | |
13720 | check_super_block(ctx); | |
13721 | if (ctx->flags & 0x0003) | |
13722 | fatal_error(ctx, 0); | |
13723 | check_if_skip(ctx); | |
13724 | if (bad_blocks_file) | |
13725 | read_bad_blocks_file(ctx, bad_blocks_file, replace_bad_blocks); | |
13726 | else if (cflag) | |
13727 | read_bad_blocks_file(ctx, 0, !keep_bad_blocks); | |
13728 | if (ctx->flags & 0x0003) | |
13729 | fatal_error(ctx, 0); | |
13730 | ||
13731 | if (normalize_swapfs) { | |
13732 | if ((fs->flags & 0x40) == | |
13733 | ext2fs_native_flag()) { | |
13734 | fprintf(stderr, (dcgettext (((void *)0), "%s: Filesystem byte order " "already normalized.\n", __LC_MESSAGES)), ctx->device_name); | |
13735 | ||
13736 | fatal_error(ctx, 0); | |
13737 | } | |
13738 | } | |
13739 | if (swapfs) { | |
13740 | swap_filesys(ctx); | |
13741 | if (ctx->flags & 0x0003) | |
13742 | fatal_error(ctx, 0); | |
13743 | } | |
13744 | ||
13745 | ||
13746 | ||
13747 | ||
13748 | ||
13749 | ext2fs_mark_valid(fs); | |
13750 | ||
13751 | retval = ext2fs_read_bb_inode(fs, &fs->badblocks); | |
13752 | if (retval) { | |
13753 | com_err(ctx->program_name, retval, | |
13754 | (dcgettext (((void *)0), "while reading bad blocks inode", __LC_MESSAGES))); | |
13755 | preenhalt(ctx); | |
13756 | printf((dcgettext (((void *)0), "This doesn't bode well," " but we'll try to go on...\n", __LC_MESSAGES))); | |
13757 | ||
13758 | } | |
13759 | ||
13760 | ||
13761 | ||
13762 | ||
13763 | ||
13764 | ||
13765 | if (sb->s_jnl_backup_type == 1) | |
13766 | journal_size = sb->s_jnl_blocks[16] >> 20; | |
13767 | else | |
13768 | journal_size = -1; | |
13769 | ||
13770 | run_result = e2fsck_run(ctx); | |
13771 | e2fsck_clear_progbar(ctx); | |
13772 | ||
13773 | if (ctx->flags & 0x0080) { | |
13774 | if (fix_problem(ctx, 0x060001, &pctx)) { | |
13775 | if (journal_size < 1024) | |
13776 | journal_size = ext2fs_default_journal_size(fs->super->s_blocks_count); | |
13777 | if (journal_size < 0) { | |
13778 | fs->super->s_feature_compat &= | |
13779 | ~0x0004; | |
13780 | fs->flags &= ~0x200; | |
13781 | com_err(ctx->program_name, 0, | |
13782 | (dcgettext (((void *)0), "Couldn't determine journal size", __LC_MESSAGES))); | |
13783 | goto no_journal; | |
13784 | } | |
13785 | printf((dcgettext (((void *)0), "Creating journal (%d blocks): ", __LC_MESSAGES)), | |
13786 | journal_size); | |
13787 | fflush(stdout); | |
13788 | retval = ext2fs_add_journal_inode(fs, | |
13789 | journal_size, 0); | |
13790 | if (retval) { | |
13791 | com_err("Error ", retval, | |
13792 | (dcgettext (((void *)0), "\n\twhile trying to create journal", __LC_MESSAGES))); | |
13793 | goto no_journal; | |
13794 | } | |
13795 | printf((dcgettext (((void *)0), " Done.\n", __LC_MESSAGES))); | |
13796 | printf((dcgettext (((void *)0), "\n*** journal has been re-created - " "filesystem is now ext3 again ***\n", __LC_MESSAGES))); | |
13797 | ||
13798 | } | |
13799 | } | |
13800 | no_journal: | |
13801 | ||
13802 | if (run_result == 0x0004) { | |
13803 | printf((dcgettext (((void *)0), "Restarting e2fsck from the beginning...\n", __LC_MESSAGES))); | |
13804 | retval = e2fsck_reset_context(ctx); | |
13805 | if (retval) { | |
13806 | com_err(ctx->program_name, retval, | |
13807 | (dcgettext (((void *)0), "while resetting context", __LC_MESSAGES))); | |
13808 | fatal_error(ctx, 0); | |
13809 | } | |
13810 | ext2fs_close(fs); | |
13811 | goto restart; | |
13812 | } | |
13813 | if (run_result & 0x0002) { | |
13814 | printf((dcgettext (((void *)0), "%s: e2fsck canceled.\n", __LC_MESSAGES)), ctx->device_name ? | |
13815 | ctx->device_name : ctx->filesystem_name); | |
13816 | exit_value |= 32; | |
13817 | } | |
13818 | if (run_result & 0x0001) | |
13819 | fatal_error(ctx, (dcgettext (((void *)0), "aborted", __LC_MESSAGES))); | |
13820 | if (check_backup_super_block(ctx)) { | |
13821 | fs->flags &= ~0x200; | |
13822 | ext2fs_mark_super_dirty(fs); | |
13823 | } | |
13824 | ||
13825 | ||
13826 | ||
13827 | ||
13828 | if (ext2fs_test_changed(fs)) { | |
13829 | exit_value |= 1; | |
13830 | if (!(ctx->options & 0x0002)) | |
13831 | printf((dcgettext (((void *)0), "\n%s: ***** FILE SYSTEM WAS MODIFIED *****\n", __LC_MESSAGES)), | |
13832 | ctx->device_name); | |
13833 | if (ctx->mount_flags & 2) { | |
13834 | printf((dcgettext (((void *)0), "%s: ***** REBOOT LINUX *****\n", __LC_MESSAGES)), | |
13835 | ctx->device_name); | |
13836 | exit_value |= 2; | |
13837 | } | |
13838 | } | |
13839 | if (!ext2fs_test_valid(fs) || | |
13840 | ((exit_value & 32) && | |
13841 | (sb->s_state & 0x0002))) { | |
13842 | printf((dcgettext (((void *)0), "\n%s: ********** WARNING: Filesystem still has " "errors **********\n\n", __LC_MESSAGES)), ctx->device_name); | |
13843 | ||
13844 | exit_value |= 4; | |
13845 | exit_value &= ~1; | |
13846 | } | |
13847 | if (exit_value & 32) { | |
13848 | int allow_cancellation; | |
13849 | ||
13850 | profile_get_boolean(ctx->profile, "options", | |
13851 | "allow_cancellation", 0, 0, | |
13852 | &allow_cancellation); | |
13853 | exit_value &= ~1; | |
13854 | if (allow_cancellation && ext2fs_test_valid(fs) && | |
13855 | (sb->s_state & 0x0001) && | |
13856 | !(sb->s_state & 0x0002)) | |
13857 | exit_value = 0; | |
13858 | } else { | |
13859 | show_stats(ctx); | |
13860 | if (!(ctx->options & 0x0001)) { | |
13861 | if (ext2fs_test_valid(fs)) { | |
13862 | if (!(sb->s_state & 0x0001)) | |
13863 | exit_value |= 1; | |
13864 | sb->s_state = 0x0001; | |
13865 | } else | |
13866 | sb->s_state &= ~0x0001; | |
13867 | sb->s_mnt_count = 0; | |
13868 | sb->s_lastcheck = ctx->now; | |
13869 | ext2fs_mark_super_dirty(fs); | |
13870 | } | |
13871 | } | |
13872 | ||
13873 | e2fsck_write_bitmaps(ctx); | |
13874 | ||
13875 | ext2fs_close(fs); | |
13876 | ctx->fs = ((void *)0); | |
13877 | free(ctx->filesystem_name); | |
13878 | free(ctx->journal_name); | |
13879 | ||
13880 | ||
13881 | if (ctx->options & 0x0010) | |
13882 | print_resource_track(((void *)0), &ctx->global_rtrack); | |
13883 | ||
13884 | e2fsck_free_context(ctx); | |
13885 | remove_error_table(&et_ext2_error_table); | |
13886 | remove_error_table(&et_prof_error_table); | |
13887 | return exit_value; | |
13888 | } |