]> git.wh0rd.org - ICEs.git/blob - 353816/busybox.i.0
more
[ICEs.git] / 353816 / busybox.i.0
1 typedef signed char int8_t;
2 typedef short int int16_t;
3 typedef int int32_t;
4 typedef long int int64_t;
5 typedef unsigned char uint8_t;
6 typedef unsigned short int uint16_t;
7 typedef unsigned int uint32_t;
8 typedef unsigned long int uint64_t;
9 typedef signed char int_least8_t;
10 typedef short int int_least16_t;
11 typedef int int_least32_t;
12 typedef long int int_least64_t;
13 typedef unsigned char uint_least8_t;
14 typedef unsigned short int uint_least16_t;
15 typedef unsigned int uint_least32_t;
16 typedef unsigned long int uint_least64_t;
17 typedef signed char int_fast8_t;
18 typedef long int int_fast16_t;
19 typedef long int int_fast32_t;
20 typedef long int int_fast64_t;
21 typedef unsigned char uint_fast8_t;
22 typedef unsigned long int uint_fast16_t;
23 typedef unsigned long int uint_fast32_t;
24 typedef unsigned long int uint_fast64_t;
25 typedef long int intptr_t;
26 typedef unsigned long int uintptr_t;
27 typedef long int intmax_t;
28 typedef unsigned long int uintmax_t;
29 typedef int bb__aliased_int __attribute__((__may_alias__));
30 typedef uint16_t bb__aliased_uint16_t __attribute__((__may_alias__));
31 typedef uint32_t bb__aliased_uint32_t __attribute__((__may_alias__));
32 typedef signed char smallint;
33 typedef unsigned char smalluint;
34 typedef unsigned char __u_char;
35 typedef unsigned short int __u_short;
36 typedef unsigned int __u_int;
37 typedef unsigned long int __u_long;
38 typedef signed char __int8_t;
39 typedef unsigned char __uint8_t;
40 typedef signed short int __int16_t;
41 typedef unsigned short int __uint16_t;
42 typedef signed int __int32_t;
43 typedef unsigned int __uint32_t;
44 typedef signed long int __int64_t;
45 typedef unsigned long int __uint64_t;
46 typedef long int __quad_t;
47 typedef unsigned long int __u_quad_t;
48 typedef unsigned long int __dev_t;
49 typedef unsigned int __uid_t;
50 typedef unsigned int __gid_t;
51 typedef unsigned long int __ino_t;
52 typedef unsigned long int __ino64_t;
53 typedef unsigned int __mode_t;
54 typedef unsigned long int __nlink_t;
55 typedef long int __off_t;
56 typedef long int __off64_t;
57 typedef int __pid_t;
58 typedef struct { int __val[2]; } __fsid_t;
59 typedef long int __clock_t;
60 typedef unsigned long int __rlim_t;
61 typedef unsigned long int __rlim64_t;
62 typedef unsigned int __id_t;
63 typedef long int __time_t;
64 typedef unsigned int __useconds_t;
65 typedef long int __suseconds_t;
66 typedef int __daddr_t;
67 typedef long int __swblk_t;
68 typedef int __key_t;
69 typedef int __clockid_t;
70 typedef void * __timer_t;
71 typedef long int __blksize_t;
72 typedef long int __blkcnt_t;
73 typedef long int __blkcnt64_t;
74 typedef unsigned long int __fsblkcnt_t;
75 typedef unsigned long int __fsblkcnt64_t;
76 typedef unsigned long int __fsfilcnt_t;
77 typedef unsigned long int __fsfilcnt64_t;
78 typedef long int __ssize_t;
79 typedef __off64_t __loff_t;
80 typedef __quad_t *__qaddr_t;
81 typedef char *__caddr_t;
82 typedef long int __intptr_t;
83 typedef unsigned int __socklen_t;
84 enum
85 {
86 _ISupper = ((0) < 8 ? ((1 << (0)) << 8) : ((1 << (0)) >> 8)),
87 _ISlower = ((1) < 8 ? ((1 << (1)) << 8) : ((1 << (1)) >> 8)),
88 _ISalpha = ((2) < 8 ? ((1 << (2)) << 8) : ((1 << (2)) >> 8)),
89 _ISdigit = ((3) < 8 ? ((1 << (3)) << 8) : ((1 << (3)) >> 8)),
90 _ISxdigit = ((4) < 8 ? ((1 << (4)) << 8) : ((1 << (4)) >> 8)),
91 _ISspace = ((5) < 8 ? ((1 << (5)) << 8) : ((1 << (5)) >> 8)),
92 _ISprint = ((6) < 8 ? ((1 << (6)) << 8) : ((1 << (6)) >> 8)),
93 _ISgraph = ((7) < 8 ? ((1 << (7)) << 8) : ((1 << (7)) >> 8)),
94 _ISblank = ((8) < 8 ? ((1 << (8)) << 8) : ((1 << (8)) >> 8)),
95 _IScntrl = ((9) < 8 ? ((1 << (9)) << 8) : ((1 << (9)) >> 8)),
96 _ISpunct = ((10) < 8 ? ((1 << (10)) << 8) : ((1 << (10)) >> 8)),
97 _ISalnum = ((11) < 8 ? ((1 << (11)) << 8) : ((1 << (11)) >> 8))
98 };
99 extern const unsigned short int **__ctype_b_loc (void)
100 __attribute__ ((__nothrow__)) __attribute__ ((const));
101 extern const __int32_t **__ctype_tolower_loc (void)
102 __attribute__ ((__nothrow__)) __attribute__ ((const));
103 extern const __int32_t **__ctype_toupper_loc (void)
104 __attribute__ ((__nothrow__)) __attribute__ ((const));
105 extern int isalnum (int) __attribute__ ((__nothrow__));
106 extern int isalpha (int) __attribute__ ((__nothrow__));
107 extern int iscntrl (int) __attribute__ ((__nothrow__));
108 extern int isdigit (int) __attribute__ ((__nothrow__));
109 extern int islower (int) __attribute__ ((__nothrow__));
110 extern int isgraph (int) __attribute__ ((__nothrow__));
111 extern int isprint (int) __attribute__ ((__nothrow__));
112 extern int ispunct (int) __attribute__ ((__nothrow__));
113 extern int isspace (int) __attribute__ ((__nothrow__));
114 extern int isupper (int) __attribute__ ((__nothrow__));
115 extern int isxdigit (int) __attribute__ ((__nothrow__));
116 extern int tolower (int __c) __attribute__ ((__nothrow__));
117 extern int toupper (int __c) __attribute__ ((__nothrow__));
118 extern int isblank (int) __attribute__ ((__nothrow__));
119 extern int isctype (int __c, int __mask) __attribute__ ((__nothrow__));
120 extern int isascii (int __c) __attribute__ ((__nothrow__));
121 extern int toascii (int __c) __attribute__ ((__nothrow__));
122 extern int _toupper (int) __attribute__ ((__nothrow__));
123 extern int _tolower (int) __attribute__ ((__nothrow__));
124 extern __inline __attribute__ ((__gnu_inline__)) int
125 __attribute__ ((__nothrow__)) tolower (int __c)
126 {
127 return __c >= -128 && __c < 256 ? (*__ctype_tolower_loc ())[__c] : __c;
128 }
129 extern __inline __attribute__ ((__gnu_inline__)) int
130 __attribute__ ((__nothrow__)) toupper (int __c)
131 {
132 return __c >= -128 && __c < 256 ? (*__ctype_toupper_loc ())[__c] : __c;
133 }
134 typedef struct __locale_struct
135 {
136 struct __locale_data *__locales[13];
137 const unsigned short int *__ctype_b;
138 const int *__ctype_tolower;
139 const int *__ctype_toupper;
140 const char *__names[13];
141 } *__locale_t;
142 typedef __locale_t locale_t;
143 extern int isalnum_l (int, __locale_t) __attribute__ ((__nothrow__));
144 extern int isalpha_l (int, __locale_t) __attribute__ ((__nothrow__));
145 extern int iscntrl_l (int, __locale_t) __attribute__ ((__nothrow__));
146 extern int isdigit_l (int, __locale_t) __attribute__ ((__nothrow__));
147 extern int islower_l (int, __locale_t) __attribute__ ((__nothrow__));
148 extern int isgraph_l (int, __locale_t) __attribute__ ((__nothrow__));
149 extern int isprint_l (int, __locale_t) __attribute__ ((__nothrow__));
150 extern int ispunct_l (int, __locale_t) __attribute__ ((__nothrow__));
151 extern int isspace_l (int, __locale_t) __attribute__ ((__nothrow__));
152 extern int isupper_l (int, __locale_t) __attribute__ ((__nothrow__));
153 extern int isxdigit_l (int, __locale_t) __attribute__ ((__nothrow__));
154 extern int isblank_l (int, __locale_t) __attribute__ ((__nothrow__));
155 extern int __tolower_l (int __c, __locale_t __l) __attribute__ ((__nothrow__));
156 extern int tolower_l (int __c, __locale_t __l) __attribute__ ((__nothrow__));
157 extern int __toupper_l (int __c, __locale_t __l) __attribute__ ((__nothrow__));
158 extern int toupper_l (int __c, __locale_t __l) __attribute__ ((__nothrow__));
159 typedef __ino64_t ino_t;
160 typedef __ino64_t ino64_t;
161 struct dirent
162 {
163 __ino64_t d_ino;
164 __off64_t d_off;
165 unsigned short int d_reclen;
166 unsigned char d_type;
167 char d_name[256];
168 };
169 struct dirent64
170 {
171 __ino64_t d_ino;
172 __off64_t d_off;
173 unsigned short int d_reclen;
174 unsigned char d_type;
175 char d_name[256];
176 };
177 enum
178 {
179 DT_UNKNOWN = 0,
180 DT_FIFO = 1,
181 DT_CHR = 2,
182 DT_DIR = 4,
183 DT_BLK = 6,
184 DT_REG = 8,
185 DT_LNK = 10,
186 DT_SOCK = 12,
187 DT_WHT = 14
188 };
189 typedef struct __dirstream DIR;
190 extern DIR *opendir (const char *__name) __attribute__ ((__nonnull__ (1)));
191 extern DIR *fdopendir (int __fd);
192 extern int closedir (DIR *__dirp) __attribute__ ((__nonnull__ (1)));
193 extern struct dirent *readdir (DIR *__dirp) __asm__ ("" "readdir64")
194 __attribute__ ((__nonnull__ (1)));
195 extern struct dirent64 *readdir64 (DIR *__dirp) __attribute__ ((__nonnull__ (1)));
196 extern int readdir_r (DIR *__restrict __dirp, struct dirent *__restrict __entry, struct dirent **__restrict __result) __asm__ ("" "readdir64_r")
197 __attribute__ ((__nonnull__ (1, 2, 3)));
198 extern int readdir64_r (DIR *__restrict __dirp,
199 struct dirent64 *__restrict __entry,
200 struct dirent64 **__restrict __result)
201 __attribute__ ((__nonnull__ (1, 2, 3)));
202 extern void rewinddir (DIR *__dirp) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
203 extern void seekdir (DIR *__dirp, long int __pos) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
204 extern long int telldir (DIR *__dirp) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
205 extern int dirfd (DIR *__dirp) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
206 typedef long unsigned int size_t;
207 extern int scandir (const char *__restrict __dir, struct dirent ***__restrict __namelist, int (*__selector) (const struct dirent *), int (*__cmp) (const struct dirent **, const struct dirent **)) __asm__ ("" "scandir64")
208 __attribute__ ((__nonnull__ (1, 2)));
209 extern int scandir64 (const char *__restrict __dir,
210 struct dirent64 ***__restrict __namelist,
211 int (*__selector) (const struct dirent64 *),
212 int (*__cmp) (const struct dirent64 **,
213 const struct dirent64 **))
214 __attribute__ ((__nonnull__ (1, 2)));
215 extern int alphasort (const struct dirent **__e1, const struct dirent **__e2) __asm__ ("" "alphasort64") __attribute__ ((__nothrow__))
216 __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
217 extern int alphasort64 (const struct dirent64 **__e1,
218 const struct dirent64 **__e2)
219 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
220 extern __ssize_t getdirentries (int __fd, char *__restrict __buf, size_t __nbytes, __off64_t *__restrict __basep) __asm__ ("" "getdirentries64") __attribute__ ((__nothrow__))
221 __attribute__ ((__nonnull__ (2, 4)));
222 extern __ssize_t getdirentries64 (int __fd, char *__restrict __buf,
223 size_t __nbytes,
224 __off64_t *__restrict __basep)
225 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 4)));
226 extern int versionsort (const struct dirent **__e1, const struct dirent **__e2) __asm__ ("" "versionsort64") __attribute__ ((__nothrow__))
227 __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
228 extern int versionsort64 (const struct dirent64 **__e1,
229 const struct dirent64 **__e2)
230 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
231 extern int *__errno_location (void) __attribute__ ((__nothrow__)) __attribute__ ((__const__));
232 extern char *program_invocation_name, *program_invocation_short_name;
233 typedef int error_t;
234 typedef __u_char u_char;
235 typedef __u_short u_short;
236 typedef __u_int u_int;
237 typedef __u_long u_long;
238 typedef __quad_t quad_t;
239 typedef __u_quad_t u_quad_t;
240 typedef __fsid_t fsid_t;
241 typedef __loff_t loff_t;
242 typedef __dev_t dev_t;
243 typedef __gid_t gid_t;
244 typedef __mode_t mode_t;
245 typedef __nlink_t nlink_t;
246 typedef __uid_t uid_t;
247 typedef __off64_t off_t;
248 typedef __off64_t off64_t;
249 typedef __pid_t pid_t;
250 typedef __id_t id_t;
251 typedef __ssize_t ssize_t;
252 typedef __daddr_t daddr_t;
253 typedef __caddr_t caddr_t;
254 typedef __key_t key_t;
255 typedef __clock_t clock_t;
256 typedef __time_t time_t;
257 typedef __clockid_t clockid_t;
258 typedef __timer_t timer_t;
259 typedef __useconds_t useconds_t;
260 typedef __suseconds_t suseconds_t;
261 typedef unsigned long int ulong;
262 typedef unsigned short int ushort;
263 typedef unsigned int uint;
264 typedef unsigned int u_int8_t __attribute__ ((__mode__ (__QI__)));
265 typedef unsigned int u_int16_t __attribute__ ((__mode__ (__HI__)));
266 typedef unsigned int u_int32_t __attribute__ ((__mode__ (__SI__)));
267 typedef unsigned int u_int64_t __attribute__ ((__mode__ (__DI__)));
268 typedef int register_t __attribute__ ((__mode__ (__word__)));
269 typedef int __sig_atomic_t;
270 typedef struct
271 {
272 unsigned long int __val[(1024 / (8 * sizeof (unsigned long int)))];
273 } __sigset_t;
274 typedef __sigset_t sigset_t;
275 struct timespec
276 {
277 __time_t tv_sec;
278 long int tv_nsec;
279 };
280 struct timeval
281 {
282 __time_t tv_sec;
283 __suseconds_t tv_usec;
284 };
285 typedef long int __fd_mask;
286 typedef struct
287 {
288 __fd_mask fds_bits[1024 / (8 * (int) sizeof (__fd_mask))];
289 } fd_set;
290 typedef __fd_mask fd_mask;
291 extern int select (int __nfds, fd_set *__restrict __readfds,
292 fd_set *__restrict __writefds,
293 fd_set *__restrict __exceptfds,
294 struct timeval *__restrict __timeout);
295 extern int pselect (int __nfds, fd_set *__restrict __readfds,
296 fd_set *__restrict __writefds,
297 fd_set *__restrict __exceptfds,
298 const struct timespec *__restrict __timeout,
299 const __sigset_t *__restrict __sigmask);
300 __extension__
301 extern unsigned int gnu_dev_major (unsigned long long int __dev)
302 __attribute__ ((__nothrow__));
303 __extension__
304 extern unsigned int gnu_dev_minor (unsigned long long int __dev)
305 __attribute__ ((__nothrow__));
306 __extension__
307 extern unsigned long long int gnu_dev_makedev (unsigned int __major,
308 unsigned int __minor)
309 __attribute__ ((__nothrow__));
310 __extension__ extern __inline __attribute__ ((__gnu_inline__)) unsigned int
311 __attribute__ ((__nothrow__)) gnu_dev_major (unsigned long long int __dev)
312 {
313 return ((__dev >> 8) & 0xfff) | ((unsigned int) (__dev >> 32) & ~0xfff);
314 }
315 __extension__ extern __inline __attribute__ ((__gnu_inline__)) unsigned int
316 __attribute__ ((__nothrow__)) gnu_dev_minor (unsigned long long int __dev)
317 {
318 return (__dev & 0xff) | ((unsigned int) (__dev >> 12) & ~0xff);
319 }
320 __extension__ extern __inline __attribute__ ((__gnu_inline__)) unsigned long long int
321 __attribute__ ((__nothrow__)) gnu_dev_makedev (unsigned int __major, unsigned int __minor)
322 {
323 return ((__minor & 0xff) | ((__major & 0xfff) << 8)
324 | (((unsigned long long int) (__minor & ~0xff)) << 12)
325 | (((unsigned long long int) (__major & ~0xfff)) << 32));
326 }
327 typedef __blksize_t blksize_t;
328 typedef __blkcnt64_t blkcnt_t;
329 typedef __fsblkcnt64_t fsblkcnt_t;
330 typedef __fsfilcnt64_t fsfilcnt_t;
331 typedef __blkcnt64_t blkcnt64_t;
332 typedef __fsblkcnt64_t fsblkcnt64_t;
333 typedef __fsfilcnt64_t fsfilcnt64_t;
334 typedef unsigned long int pthread_t;
335 typedef union
336 {
337 char __size[56];
338 long int __align;
339 } pthread_attr_t;
340 typedef struct __pthread_internal_list
341 {
342 struct __pthread_internal_list *__prev;
343 struct __pthread_internal_list *__next;
344 } __pthread_list_t;
345 typedef union
346 {
347 struct __pthread_mutex_s
348 {
349 int __lock;
350 unsigned int __count;
351 int __owner;
352 unsigned int __nusers;
353 int __kind;
354 int __spins;
355 __pthread_list_t __list;
356 } __data;
357 char __size[40];
358 long int __align;
359 } pthread_mutex_t;
360 typedef union
361 {
362 char __size[4];
363 int __align;
364 } pthread_mutexattr_t;
365 typedef union
366 {
367 struct
368 {
369 int __lock;
370 unsigned int __futex;
371 __extension__ unsigned long long int __total_seq;
372 __extension__ unsigned long long int __wakeup_seq;
373 __extension__ unsigned long long int __woken_seq;
374 void *__mutex;
375 unsigned int __nwaiters;
376 unsigned int __broadcast_seq;
377 } __data;
378 char __size[48];
379 __extension__ long long int __align;
380 } pthread_cond_t;
381 typedef union
382 {
383 char __size[4];
384 int __align;
385 } pthread_condattr_t;
386 typedef unsigned int pthread_key_t;
387 typedef int pthread_once_t;
388 typedef union
389 {
390 struct
391 {
392 int __lock;
393 unsigned int __nr_readers;
394 unsigned int __readers_wakeup;
395 unsigned int __writer_wakeup;
396 unsigned int __nr_readers_queued;
397 unsigned int __nr_writers_queued;
398 int __writer;
399 int __shared;
400 unsigned long int __pad1;
401 unsigned long int __pad2;
402 unsigned int __flags;
403 } __data;
404 char __size[56];
405 long int __align;
406 } pthread_rwlock_t;
407 typedef union
408 {
409 char __size[8];
410 long int __align;
411 } pthread_rwlockattr_t;
412 typedef volatile int pthread_spinlock_t;
413 typedef union
414 {
415 char __size[32];
416 long int __align;
417 } pthread_barrier_t;
418 typedef union
419 {
420 char __size[4];
421 int __align;
422 } pthread_barrierattr_t;
423 struct iovec
424 {
425 void *iov_base;
426 size_t iov_len;
427 };
428 struct flock
429 {
430 short int l_type;
431 short int l_whence;
432 __off64_t l_start;
433 __off64_t l_len;
434 __pid_t l_pid;
435 };
436 struct flock64
437 {
438 short int l_type;
439 short int l_whence;
440 __off64_t l_start;
441 __off64_t l_len;
442 __pid_t l_pid;
443 };
444 enum __pid_type
445 {
446 F_OWNER_TID = 0,
447 F_OWNER_PID,
448 F_OWNER_PGRP,
449 F_OWNER_GID = F_OWNER_PGRP
450 };
451 struct f_owner_ex
452 {
453 enum __pid_type type;
454 __pid_t pid;
455 };
456 extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count)
457 __attribute__ ((__nothrow__));
458 extern int sync_file_range (int __fd, __off64_t __offset, __off64_t __count,
459 unsigned int __flags);
460 extern ssize_t vmsplice (int __fdout, const struct iovec *__iov,
461 size_t __count, unsigned int __flags);
462 extern ssize_t splice (int __fdin, __off64_t *__offin, int __fdout,
463 __off64_t *__offout, size_t __len,
464 unsigned int __flags);
465 extern ssize_t tee (int __fdin, int __fdout, size_t __len,
466 unsigned int __flags);
467 extern int fallocate (int __fd, int __mode, __off64_t __offset, __off64_t __len) __asm__ ("" "fallocate64")
468 ;
469 extern int fallocate64 (int __fd, int __mode, __off64_t __offset,
470 __off64_t __len);
471 struct stat
472 {
473 __dev_t st_dev;
474 __ino_t st_ino;
475 __nlink_t st_nlink;
476 __mode_t st_mode;
477 __uid_t st_uid;
478 __gid_t st_gid;
479 int __pad0;
480 __dev_t st_rdev;
481 __off_t st_size;
482 __blksize_t st_blksize;
483 __blkcnt_t st_blocks;
484 struct timespec st_atim;
485 struct timespec st_mtim;
486 struct timespec st_ctim;
487 long int __unused[3];
488 };
489 struct stat64
490 {
491 __dev_t st_dev;
492 __ino64_t st_ino;
493 __nlink_t st_nlink;
494 __mode_t st_mode;
495 __uid_t st_uid;
496 __gid_t st_gid;
497 int __pad0;
498 __dev_t st_rdev;
499 __off_t st_size;
500 __blksize_t st_blksize;
501 __blkcnt64_t st_blocks;
502 struct timespec st_atim;
503 struct timespec st_mtim;
504 struct timespec st_ctim;
505 long int __unused[3];
506 };
507 extern int fcntl (int __fd, int __cmd, ...);
508 extern int open (const char *__file, int __oflag, ...) __asm__ ("" "open64")
509 __attribute__ ((__nonnull__ (1)));
510 extern int open64 (const char *__file, int __oflag, ...) __attribute__ ((__nonnull__ (1)));
511 extern int openat (int __fd, const char *__file, int __oflag, ...) __asm__ ("" "openat64")
512 __attribute__ ((__nonnull__ (2)));
513 extern int openat64 (int __fd, const char *__file, int __oflag, ...)
514 __attribute__ ((__nonnull__ (2)));
515 extern int creat (const char *__file, __mode_t __mode) __asm__ ("" "creat64")
516 __attribute__ ((__nonnull__ (1)));
517 extern int creat64 (const char *__file, __mode_t __mode) __attribute__ ((__nonnull__ (1)));
518 extern int lockf (int __fd, int __cmd, __off64_t __len) __asm__ ("" "lockf64");
519 extern int lockf64 (int __fd, int __cmd, __off64_t __len);
520 extern int posix_fadvise (int __fd, __off64_t __offset, __off64_t __len, int __advise) __asm__ ("" "posix_fadvise64") __attribute__ ((__nothrow__))
521 ;
522 extern int posix_fadvise64 (int __fd, __off64_t __offset, __off64_t __len,
523 int __advise) __attribute__ ((__nothrow__));
524 extern int posix_fallocate (int __fd, __off64_t __offset, __off64_t __len) __asm__ ("" "posix_fallocate64")
525 ;
526 extern int posix_fallocate64 (int __fd, __off64_t __offset, __off64_t __len);
527 extern int __open_2 (const char *__path, int __oflag) __asm__ ("" "__open64_2")
528 __attribute__ ((__nonnull__ (1)));
529 extern int __open_alias (const char *__path, int __oflag, ...) __asm__ ("" "open64")
530 __attribute__ ((__nonnull__ (1)));
531 extern void __open_too_many_args (void) __attribute__((__error__ ("open can be called either with 2 or 3 arguments, not more")))
532 ;
533 extern void __open_missing_mode (void) __attribute__((__error__ ("open with O_CREAT in second argument needs 3 arguments")))
534 ;
535 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) int
536 open (const char *__path, int __oflag, ...)
537 {
538 if (__builtin_va_arg_pack_len () > 1)
539 __open_too_many_args ();
540 if (__builtin_constant_p (__oflag))
541 {
542 if ((__oflag & 0100) != 0 && __builtin_va_arg_pack_len () < 1)
543 {
544 __open_missing_mode ();
545 return __open_2 (__path, __oflag);
546 }
547 return __open_alias (__path, __oflag, __builtin_va_arg_pack ());
548 }
549 if (__builtin_va_arg_pack_len () < 1)
550 return __open_2 (__path, __oflag);
551 return __open_alias (__path, __oflag, __builtin_va_arg_pack ());
552 }
553 extern int __open64_2 (const char *__path, int __oflag) __attribute__ ((__nonnull__ (1)));
554 extern int __open64_alias (const char *__path, int __oflag, ...) __asm__ ("" "open64")
555 __attribute__ ((__nonnull__ (1)));
556 extern void __open64_too_many_args (void) __attribute__((__error__ ("open64 can be called either with 2 or 3 arguments, not more")))
557 ;
558 extern void __open64_missing_mode (void) __attribute__((__error__ ("open64 with O_CREAT in second argument needs 3 arguments")))
559 ;
560 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) int
561 open64 (const char *__path, int __oflag, ...)
562 {
563 if (__builtin_va_arg_pack_len () > 1)
564 __open64_too_many_args ();
565 if (__builtin_constant_p (__oflag))
566 {
567 if ((__oflag & 0100) != 0 && __builtin_va_arg_pack_len () < 1)
568 {
569 __open64_missing_mode ();
570 return __open64_2 (__path, __oflag);
571 }
572 return __open64_alias (__path, __oflag, __builtin_va_arg_pack ());
573 }
574 if (__builtin_va_arg_pack_len () < 1)
575 return __open64_2 (__path, __oflag);
576 return __open64_alias (__path, __oflag, __builtin_va_arg_pack ());
577 }
578 extern int __openat_2 (int __fd, const char *__path, int __oflag) __asm__ ("" "__openat64_2")
579 __attribute__ ((__nonnull__ (2)));
580 extern int __openat_alias (int __fd, const char *__path, int __oflag, ...) __asm__ ("" "openat64")
581 __attribute__ ((__nonnull__ (2)));
582 extern void __openat_too_many_args (void) __attribute__((__error__ ("openat can be called either with 3 or 4 arguments, not more")))
583 ;
584 extern void __openat_missing_mode (void) __attribute__((__error__ ("openat with O_CREAT in third argument needs 4 arguments")))
585 ;
586 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) int
587 openat (int __fd, const char *__path, int __oflag, ...)
588 {
589 if (__builtin_va_arg_pack_len () > 1)
590 __openat_too_many_args ();
591 if (__builtin_constant_p (__oflag))
592 {
593 if ((__oflag & 0100) != 0 && __builtin_va_arg_pack_len () < 1)
594 {
595 __openat_missing_mode ();
596 return __openat_2 (__fd, __path, __oflag);
597 }
598 return __openat_alias (__fd, __path, __oflag, __builtin_va_arg_pack ());
599 }
600 if (__builtin_va_arg_pack_len () < 1)
601 return __openat_2 (__fd, __path, __oflag);
602 return __openat_alias (__fd, __path, __oflag, __builtin_va_arg_pack ());
603 }
604 extern int __openat64_2 (int __fd, const char *__path, int __oflag)
605 __attribute__ ((__nonnull__ (2)));
606 extern int __openat64_alias (int __fd, const char *__path, int __oflag, ...) __asm__ ("" "openat64")
607 __attribute__ ((__nonnull__ (2)));
608 extern void __openat64_too_many_args (void) __attribute__((__error__ ("openat64 can be called either with 3 or 4 arguments, not more")))
609 ;
610 extern void __openat64_missing_mode (void) __attribute__((__error__ ("openat64 with O_CREAT in third argument needs 4 arguments")))
611 ;
612 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) int
613 openat64 (int __fd, const char *__path, int __oflag, ...)
614 {
615 if (__builtin_va_arg_pack_len () > 1)
616 __openat64_too_many_args ();
617 if (__builtin_constant_p (__oflag))
618 {
619 if ((__oflag & 0100) != 0 && __builtin_va_arg_pack_len () < 1)
620 {
621 __openat64_missing_mode ();
622 return __openat64_2 (__fd, __path, __oflag);
623 }
624 return __openat64_alias (__fd, __path, __oflag, __builtin_va_arg_pack ());
625 }
626 if (__builtin_va_arg_pack_len () < 1)
627 return __openat64_2 (__fd, __path, __oflag);
628 return __openat64_alias (__fd, __path, __oflag, __builtin_va_arg_pack ());
629 }
630 typedef int __gwchar_t;
631 typedef struct
632 {
633 long int quot;
634 long int rem;
635 } imaxdiv_t;
636 extern intmax_t imaxabs (intmax_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__const__));
637 extern imaxdiv_t imaxdiv (intmax_t __numer, intmax_t __denom)
638 __attribute__ ((__nothrow__)) __attribute__ ((__const__));
639 extern intmax_t strtoimax (const char *__restrict __nptr,
640 char **__restrict __endptr, int __base) __attribute__ ((__nothrow__));
641 extern uintmax_t strtoumax (const char *__restrict __nptr,
642 char ** __restrict __endptr, int __base) __attribute__ ((__nothrow__));
643 extern intmax_t wcstoimax (const __gwchar_t *__restrict __nptr,
644 __gwchar_t **__restrict __endptr, int __base)
645 __attribute__ ((__nothrow__));
646 extern uintmax_t wcstoumax (const __gwchar_t *__restrict __nptr,
647 __gwchar_t ** __restrict __endptr, int __base)
648 __attribute__ ((__nothrow__));
649 extern long int __strtol_internal (const char *__restrict __nptr,
650 char **__restrict __endptr,
651 int __base, int __group)
652 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
653 extern __inline __attribute__ ((__gnu_inline__)) intmax_t
654 __attribute__ ((__nothrow__)) strtoimax (const char *__restrict nptr, char **__restrict endptr, int base)
655 {
656 return __strtol_internal (nptr, endptr, base, 0);
657 }
658 extern unsigned long int __strtoul_internal (const char *
659 __restrict __nptr,
660 char ** __restrict __endptr,
661 int __base, int __group)
662 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
663 extern __inline __attribute__ ((__gnu_inline__)) uintmax_t
664 __attribute__ ((__nothrow__)) strtoumax (const char *__restrict nptr, char **__restrict endptr, int base)
665 {
666 return __strtoul_internal (nptr, endptr, base, 0);
667 }
668 extern long int __wcstol_internal (const __gwchar_t * __restrict __nptr,
669 __gwchar_t **__restrict __endptr,
670 int __base, int __group)
671 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
672 extern __inline __attribute__ ((__gnu_inline__)) intmax_t
673 __attribute__ ((__nothrow__)) wcstoimax (const __gwchar_t *__restrict nptr, __gwchar_t **__restrict endptr, int base)
674 {
675 return __wcstol_internal (nptr, endptr, base, 0);
676 }
677 extern unsigned long int __wcstoul_internal (const __gwchar_t *
678 __restrict __nptr,
679 __gwchar_t **
680 __restrict __endptr,
681 int __base, int __group)
682 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
683 extern __inline __attribute__ ((__gnu_inline__)) uintmax_t
684 __attribute__ ((__nothrow__)) wcstoumax (const __gwchar_t *__restrict nptr, __gwchar_t **__restrict endptr, int base)
685 {
686 return __wcstoul_internal (nptr, endptr, base, 0);
687 }
688 extern ssize_t readv (int __fd, const struct iovec *__iovec, int __count)
689 __attribute__ ((__warn_unused_result__));
690 extern ssize_t writev (int __fd, const struct iovec *__iovec, int __count)
691 __attribute__ ((__warn_unused_result__));
692 extern ssize_t preadv (int __fd, const struct iovec *__iovec, int __count, __off64_t __offset) __asm__ ("" "preadv64")
693 __attribute__ ((__warn_unused_result__));
694 extern ssize_t pwritev (int __fd, const struct iovec *__iovec, int __count, __off64_t __offset) __asm__ ("" "pwritev64")
695 __attribute__ ((__warn_unused_result__));
696 extern ssize_t preadv64 (int __fd, const struct iovec *__iovec, int __count,
697 __off64_t __offset) __attribute__ ((__warn_unused_result__));
698 extern ssize_t pwritev64 (int __fd, const struct iovec *__iovec, int __count,
699 __off64_t __offset) __attribute__ ((__warn_unused_result__));
700 typedef __socklen_t socklen_t;
701 enum __socket_type
702 {
703 SOCK_STREAM = 1,
704 SOCK_DGRAM = 2,
705 SOCK_RAW = 3,
706 SOCK_RDM = 4,
707 SOCK_SEQPACKET = 5,
708 SOCK_DCCP = 6,
709 SOCK_PACKET = 10,
710 SOCK_CLOEXEC = 02000000,
711 SOCK_NONBLOCK = 04000
712 };
713 typedef unsigned short int sa_family_t;
714 struct sockaddr
715 {
716 sa_family_t sa_family;
717 char sa_data[14];
718 };
719 struct sockaddr_storage
720 {
721 sa_family_t ss_family;
722 unsigned long int __ss_align;
723 char __ss_padding[(128 - (2 * sizeof (unsigned long int)))];
724 };
725 enum
726 {
727 MSG_OOB = 0x01,
728 MSG_PEEK = 0x02,
729 MSG_DONTROUTE = 0x04,
730 MSG_TRYHARD = MSG_DONTROUTE,
731 MSG_CTRUNC = 0x08,
732 MSG_PROXY = 0x10,
733 MSG_TRUNC = 0x20,
734 MSG_DONTWAIT = 0x40,
735 MSG_EOR = 0x80,
736 MSG_WAITALL = 0x100,
737 MSG_FIN = 0x200,
738 MSG_SYN = 0x400,
739 MSG_CONFIRM = 0x800,
740 MSG_RST = 0x1000,
741 MSG_ERRQUEUE = 0x2000,
742 MSG_NOSIGNAL = 0x4000,
743 MSG_MORE = 0x8000,
744 MSG_WAITFORONE = 0x10000,
745 MSG_CMSG_CLOEXEC = 0x40000000
746 };
747 struct msghdr
748 {
749 void *msg_name;
750 socklen_t msg_namelen;
751 struct iovec *msg_iov;
752 size_t msg_iovlen;
753 void *msg_control;
754 size_t msg_controllen;
755 int msg_flags;
756 };
757 struct mmsghdr
758 {
759 struct msghdr msg_hdr;
760 unsigned int msg_len;
761 };
762 struct cmsghdr
763 {
764 size_t cmsg_len;
765 int cmsg_level;
766 int cmsg_type;
767 __extension__ unsigned char __cmsg_data [];
768 };
769 extern struct cmsghdr *__cmsg_nxthdr (struct msghdr *__mhdr,
770 struct cmsghdr *__cmsg) __attribute__ ((__nothrow__));
771 extern __inline __attribute__ ((__gnu_inline__)) struct cmsghdr *
772 __attribute__ ((__nothrow__)) __cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg)
773 {
774 if ((size_t) __cmsg->cmsg_len < sizeof (struct cmsghdr))
775 return 0;
776 __cmsg = (struct cmsghdr *) ((unsigned char *) __cmsg
777 + (((__cmsg->cmsg_len) + sizeof (size_t) - 1) & (size_t) ~(sizeof (size_t) - 1)));
778 if ((unsigned char *) (__cmsg + 1) > ((unsigned char *) __mhdr->msg_control
779 + __mhdr->msg_controllen)
780 || ((unsigned char *) __cmsg + (((__cmsg->cmsg_len) + sizeof (size_t) - 1) & (size_t) ~(sizeof (size_t) - 1))
781 > ((unsigned char *) __mhdr->msg_control + __mhdr->msg_controllen)))
782 return 0;
783 return __cmsg;
784 }
785 enum
786 {
787 SCM_RIGHTS = 0x01
788 , SCM_CREDENTIALS = 0x02
789 };
790 struct ucred
791 {
792 pid_t pid;
793 uid_t uid;
794 gid_t gid;
795 };
796 struct linger
797 {
798 int l_onoff;
799 int l_linger;
800 };
801 extern int recvmmsg (int __fd, struct mmsghdr *__vmessages,
802 unsigned int __vlen, int __flags,
803 const struct timespec *__tmo);
804 struct osockaddr
805 {
806 unsigned short int sa_family;
807 unsigned char sa_data[14];
808 };
809 enum
810 {
811 SHUT_RD = 0,
812 SHUT_WR,
813 SHUT_RDWR
814 };
815 typedef union { struct sockaddr *__restrict __sockaddr__; struct sockaddr_at *__restrict __sockaddr_at__; struct sockaddr_ax25 *__restrict __sockaddr_ax25__; struct sockaddr_dl *__restrict __sockaddr_dl__; struct sockaddr_eon *__restrict __sockaddr_eon__; struct sockaddr_in *__restrict __sockaddr_in__; struct sockaddr_in6 *__restrict __sockaddr_in6__; struct sockaddr_inarp *__restrict __sockaddr_inarp__; struct sockaddr_ipx *__restrict __sockaddr_ipx__; struct sockaddr_iso *__restrict __sockaddr_iso__; struct sockaddr_ns *__restrict __sockaddr_ns__; struct sockaddr_un *__restrict __sockaddr_un__; struct sockaddr_x25 *__restrict __sockaddr_x25__;
816 } __SOCKADDR_ARG __attribute__ ((__transparent_union__));
817 typedef union { const struct sockaddr *__restrict __sockaddr__; const struct sockaddr_at *__restrict __sockaddr_at__; const struct sockaddr_ax25 *__restrict __sockaddr_ax25__; const struct sockaddr_dl *__restrict __sockaddr_dl__; const struct sockaddr_eon *__restrict __sockaddr_eon__; const struct sockaddr_in *__restrict __sockaddr_in__; const struct sockaddr_in6 *__restrict __sockaddr_in6__; const struct sockaddr_inarp *__restrict __sockaddr_inarp__; const struct sockaddr_ipx *__restrict __sockaddr_ipx__; const struct sockaddr_iso *__restrict __sockaddr_iso__; const struct sockaddr_ns *__restrict __sockaddr_ns__; const struct sockaddr_un *__restrict __sockaddr_un__; const struct sockaddr_x25 *__restrict __sockaddr_x25__;
818 } __CONST_SOCKADDR_ARG __attribute__ ((__transparent_union__));
819 extern int socket (int __domain, int __type, int __protocol) __attribute__ ((__nothrow__));
820 extern int socketpair (int __domain, int __type, int __protocol,
821 int __fds[2]) __attribute__ ((__nothrow__));
822 extern int bind (int __fd, __CONST_SOCKADDR_ARG __addr, socklen_t __len)
823 __attribute__ ((__nothrow__));
824 extern int getsockname (int __fd, __SOCKADDR_ARG __addr,
825 socklen_t *__restrict __len) __attribute__ ((__nothrow__));
826 extern int connect (int __fd, __CONST_SOCKADDR_ARG __addr, socklen_t __len);
827 extern int getpeername (int __fd, __SOCKADDR_ARG __addr,
828 socklen_t *__restrict __len) __attribute__ ((__nothrow__));
829 extern ssize_t send (int __fd, const void *__buf, size_t __n, int __flags);
830 extern ssize_t recv (int __fd, void *__buf, size_t __n, int __flags);
831 extern ssize_t sendto (int __fd, const void *__buf, size_t __n,
832 int __flags, __CONST_SOCKADDR_ARG __addr,
833 socklen_t __addr_len);
834 extern ssize_t recvfrom (int __fd, void *__restrict __buf, size_t __n,
835 int __flags, __SOCKADDR_ARG __addr,
836 socklen_t *__restrict __addr_len);
837 extern ssize_t sendmsg (int __fd, const struct msghdr *__message,
838 int __flags);
839 extern ssize_t recvmsg (int __fd, struct msghdr *__message, int __flags);
840 extern int getsockopt (int __fd, int __level, int __optname,
841 void *__restrict __optval,
842 socklen_t *__restrict __optlen) __attribute__ ((__nothrow__));
843 extern int setsockopt (int __fd, int __level, int __optname,
844 const void *__optval, socklen_t __optlen) __attribute__ ((__nothrow__));
845 extern int listen (int __fd, int __n) __attribute__ ((__nothrow__));
846 extern int accept (int __fd, __SOCKADDR_ARG __addr,
847 socklen_t *__restrict __addr_len);
848 extern int accept4 (int __fd, __SOCKADDR_ARG __addr,
849 socklen_t *__restrict __addr_len, int __flags);
850 extern int shutdown (int __fd, int __how) __attribute__ ((__nothrow__));
851 extern int sockatmark (int __fd) __attribute__ ((__nothrow__));
852 extern int isfdtype (int __fd, int __fdtype) __attribute__ ((__nothrow__));
853 extern ssize_t __recv_chk (int __fd, void *__buf, size_t __n, size_t __buflen,
854 int __flags);
855 extern ssize_t __recv_alias (int __fd, void *__buf, size_t __n, int __flags) __asm__ ("" "recv")
856 ;
857 extern ssize_t __recv_chk_warn (int __fd, void *__buf, size_t __n, size_t __buflen, int __flags) __asm__ ("" "__recv_chk")
858 __attribute__((__warning__ ("recv called with bigger length than size of destination " "buffer")))
859 ;
860 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) ssize_t
861 recv (int __fd, void *__buf, size_t __n, int __flags)
862 {
863 if (__builtin_object_size (__buf, 0) != (size_t) -1)
864 {
865 if (!__builtin_constant_p (__n))
866 return __recv_chk (__fd, __buf, __n, __builtin_object_size (__buf, 0), __flags);
867 if (__n > __builtin_object_size (__buf, 0))
868 return __recv_chk_warn (__fd, __buf, __n, __builtin_object_size (__buf, 0), __flags);
869 }
870 return __recv_alias (__fd, __buf, __n, __flags);
871 }
872 extern ssize_t __recvfrom_chk (int __fd, void *__restrict __buf, size_t __n,
873 size_t __buflen, int __flags,
874 __SOCKADDR_ARG __addr,
875 socklen_t *__restrict __addr_len);
876 extern ssize_t __recvfrom_alias (int __fd, void *__restrict __buf, size_t __n, int __flags, __SOCKADDR_ARG __addr, socklen_t *__restrict __addr_len) __asm__ ("" "recvfrom")
877 ;
878 extern ssize_t __recvfrom_chk_warn (int __fd, void *__restrict __buf, size_t __n, size_t __buflen, int __flags, __SOCKADDR_ARG __addr, socklen_t *__restrict __addr_len) __asm__ ("" "__recvfrom_chk")
879 __attribute__((__warning__ ("recvfrom called with bigger length than size of " "destination buffer")))
880 ;
881 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) ssize_t
882 recvfrom (int __fd, void *__restrict __buf, size_t __n, int __flags,
883 __SOCKADDR_ARG __addr, socklen_t *__restrict __addr_len)
884 {
885 if (__builtin_object_size (__buf, 0) != (size_t) -1)
886 {
887 if (!__builtin_constant_p (__n))
888 return __recvfrom_chk (__fd, __buf, __n, __builtin_object_size (__buf, 0), __flags,
889 __addr, __addr_len);
890 if (__n > __builtin_object_size (__buf, 0))
891 return __recvfrom_chk_warn (__fd, __buf, __n, __builtin_object_size (__buf, 0), __flags,
892 __addr, __addr_len);
893 }
894 return __recvfrom_alias (__fd, __buf, __n, __flags, __addr, __addr_len);
895 }
896 enum
897 {
898 IPPROTO_IP = 0,
899 IPPROTO_HOPOPTS = 0,
900 IPPROTO_ICMP = 1,
901 IPPROTO_IGMP = 2,
902 IPPROTO_IPIP = 4,
903 IPPROTO_TCP = 6,
904 IPPROTO_EGP = 8,
905 IPPROTO_PUP = 12,
906 IPPROTO_UDP = 17,
907 IPPROTO_IDP = 22,
908 IPPROTO_TP = 29,
909 IPPROTO_DCCP = 33,
910 IPPROTO_IPV6 = 41,
911 IPPROTO_ROUTING = 43,
912 IPPROTO_FRAGMENT = 44,
913 IPPROTO_RSVP = 46,
914 IPPROTO_GRE = 47,
915 IPPROTO_ESP = 50,
916 IPPROTO_AH = 51,
917 IPPROTO_ICMPV6 = 58,
918 IPPROTO_NONE = 59,
919 IPPROTO_DSTOPTS = 60,
920 IPPROTO_MTP = 92,
921 IPPROTO_ENCAP = 98,
922 IPPROTO_PIM = 103,
923 IPPROTO_COMP = 108,
924 IPPROTO_SCTP = 132,
925 IPPROTO_UDPLITE = 136,
926 IPPROTO_RAW = 255,
927 IPPROTO_MAX
928 };
929 typedef uint16_t in_port_t;
930 enum
931 {
932 IPPORT_ECHO = 7,
933 IPPORT_DISCARD = 9,
934 IPPORT_SYSTAT = 11,
935 IPPORT_DAYTIME = 13,
936 IPPORT_NETSTAT = 15,
937 IPPORT_FTP = 21,
938 IPPORT_TELNET = 23,
939 IPPORT_SMTP = 25,
940 IPPORT_TIMESERVER = 37,
941 IPPORT_NAMESERVER = 42,
942 IPPORT_WHOIS = 43,
943 IPPORT_MTP = 57,
944 IPPORT_TFTP = 69,
945 IPPORT_RJE = 77,
946 IPPORT_FINGER = 79,
947 IPPORT_TTYLINK = 87,
948 IPPORT_SUPDUP = 95,
949 IPPORT_EXECSERVER = 512,
950 IPPORT_LOGINSERVER = 513,
951 IPPORT_CMDSERVER = 514,
952 IPPORT_EFSSERVER = 520,
953 IPPORT_BIFFUDP = 512,
954 IPPORT_WHOSERVER = 513,
955 IPPORT_ROUTESERVER = 520,
956 IPPORT_RESERVED = 1024,
957 IPPORT_USERRESERVED = 5000
958 };
959 typedef uint32_t in_addr_t;
960 struct in_addr
961 {
962 in_addr_t s_addr;
963 };
964 struct in6_addr
965 {
966 union
967 {
968 uint8_t __u6_addr8[16];
969 uint16_t __u6_addr16[8];
970 uint32_t __u6_addr32[4];
971 } __in6_u;
972 };
973 extern const struct in6_addr in6addr_any;
974 extern const struct in6_addr in6addr_loopback;
975 struct sockaddr_in
976 {
977 sa_family_t sin_family;
978 in_port_t sin_port;
979 struct in_addr sin_addr;
980 unsigned char sin_zero[sizeof (struct sockaddr) -
981 (sizeof (unsigned short int)) -
982 sizeof (in_port_t) -
983 sizeof (struct in_addr)];
984 };
985 struct sockaddr_in6
986 {
987 sa_family_t sin6_family;
988 in_port_t sin6_port;
989 uint32_t sin6_flowinfo;
990 struct in6_addr sin6_addr;
991 uint32_t sin6_scope_id;
992 };
993 struct ip_mreq
994 {
995 struct in_addr imr_multiaddr;
996 struct in_addr imr_interface;
997 };
998 struct ip_mreq_source
999 {
1000 struct in_addr imr_multiaddr;
1001 struct in_addr imr_interface;
1002 struct in_addr imr_sourceaddr;
1003 };
1004 struct ipv6_mreq
1005 {
1006 struct in6_addr ipv6mr_multiaddr;
1007 unsigned int ipv6mr_interface;
1008 };
1009 struct group_req
1010 {
1011 uint32_t gr_interface;
1012 struct sockaddr_storage gr_group;
1013 };
1014 struct group_source_req
1015 {
1016 uint32_t gsr_interface;
1017 struct sockaddr_storage gsr_group;
1018 struct sockaddr_storage gsr_source;
1019 };
1020 struct ip_msfilter
1021 {
1022 struct in_addr imsf_multiaddr;
1023 struct in_addr imsf_interface;
1024 uint32_t imsf_fmode;
1025 uint32_t imsf_numsrc;
1026 struct in_addr imsf_slist[1];
1027 };
1028 struct group_filter
1029 {
1030 uint32_t gf_interface;
1031 struct sockaddr_storage gf_group;
1032 uint32_t gf_fmode;
1033 uint32_t gf_numsrc;
1034 struct sockaddr_storage gf_slist[1];
1035 };
1036 struct ip_opts
1037 {
1038 struct in_addr ip_dst;
1039 char ip_opts[40];
1040 };
1041 struct ip_mreqn
1042 {
1043 struct in_addr imr_multiaddr;
1044 struct in_addr imr_address;
1045 int imr_ifindex;
1046 };
1047 struct in_pktinfo
1048 {
1049 int ipi_ifindex;
1050 struct in_addr ipi_spec_dst;
1051 struct in_addr ipi_addr;
1052 };
1053 extern uint32_t ntohl (uint32_t __netlong) __attribute__ ((__nothrow__)) __attribute__ ((__const__));
1054 extern uint16_t ntohs (uint16_t __netshort)
1055 __attribute__ ((__nothrow__)) __attribute__ ((__const__));
1056 extern uint32_t htonl (uint32_t __hostlong)
1057 __attribute__ ((__nothrow__)) __attribute__ ((__const__));
1058 extern uint16_t htons (uint16_t __hostshort)
1059 __attribute__ ((__nothrow__)) __attribute__ ((__const__));
1060 extern int bindresvport (int __sockfd, struct sockaddr_in *__sock_in) __attribute__ ((__nothrow__));
1061 extern int bindresvport6 (int __sockfd, struct sockaddr_in6 *__sock_in)
1062 __attribute__ ((__nothrow__));
1063 struct in6_pktinfo
1064 {
1065 struct in6_addr ipi6_addr;
1066 unsigned int ipi6_ifindex;
1067 };
1068 struct ip6_mtuinfo
1069 {
1070 struct sockaddr_in6 ip6m_addr;
1071 uint32_t ip6m_mtu;
1072 };
1073 extern int inet6_option_space (int __nbytes)
1074 __attribute__ ((__nothrow__)) __attribute__ ((__deprecated__));
1075 extern int inet6_option_init (void *__bp, struct cmsghdr **__cmsgp,
1076 int __type) __attribute__ ((__nothrow__)) __attribute__ ((__deprecated__));
1077 extern int inet6_option_append (struct cmsghdr *__cmsg,
1078 const uint8_t *__typep, int __multx,
1079 int __plusy) __attribute__ ((__nothrow__)) __attribute__ ((__deprecated__));
1080 extern uint8_t *inet6_option_alloc (struct cmsghdr *__cmsg, int __datalen,
1081 int __multx, int __plusy)
1082 __attribute__ ((__nothrow__)) __attribute__ ((__deprecated__));
1083 extern int inet6_option_next (const struct cmsghdr *__cmsg,
1084 uint8_t **__tptrp)
1085 __attribute__ ((__nothrow__)) __attribute__ ((__deprecated__));
1086 extern int inet6_option_find (const struct cmsghdr *__cmsg,
1087 uint8_t **__tptrp, int __type)
1088 __attribute__ ((__nothrow__)) __attribute__ ((__deprecated__));
1089 extern int inet6_opt_init (void *__extbuf, socklen_t __extlen) __attribute__ ((__nothrow__));
1090 extern int inet6_opt_append (void *__extbuf, socklen_t __extlen, int __offset,
1091 uint8_t __type, socklen_t __len, uint8_t __align,
1092 void **__databufp) __attribute__ ((__nothrow__));
1093 extern int inet6_opt_finish (void *__extbuf, socklen_t __extlen, int __offset)
1094 __attribute__ ((__nothrow__));
1095 extern int inet6_opt_set_val (void *__databuf, int __offset, void *__val,
1096 socklen_t __vallen) __attribute__ ((__nothrow__));
1097 extern int inet6_opt_next (void *__extbuf, socklen_t __extlen, int __offset,
1098 uint8_t *__typep, socklen_t *__lenp,
1099 void **__databufp) __attribute__ ((__nothrow__));
1100 extern int inet6_opt_find (void *__extbuf, socklen_t __extlen, int __offset,
1101 uint8_t __type, socklen_t *__lenp,
1102 void **__databufp) __attribute__ ((__nothrow__));
1103 extern int inet6_opt_get_val (void *__databuf, int __offset, void *__val,
1104 socklen_t __vallen) __attribute__ ((__nothrow__));
1105 extern socklen_t inet6_rth_space (int __type, int __segments) __attribute__ ((__nothrow__));
1106 extern void *inet6_rth_init (void *__bp, socklen_t __bp_len, int __type,
1107 int __segments) __attribute__ ((__nothrow__));
1108 extern int inet6_rth_add (void *__bp, const struct in6_addr *__addr) __attribute__ ((__nothrow__));
1109 extern int inet6_rth_reverse (const void *__in, void *__out) __attribute__ ((__nothrow__));
1110 extern int inet6_rth_segments (const void *__bp) __attribute__ ((__nothrow__));
1111 extern struct in6_addr *inet6_rth_getaddr (const void *__bp, int __index)
1112 __attribute__ ((__nothrow__));
1113 extern int getipv4sourcefilter (int __s, struct in_addr __interface_addr,
1114 struct in_addr __group, uint32_t *__fmode,
1115 uint32_t *__numsrc, struct in_addr *__slist)
1116 __attribute__ ((__nothrow__));
1117 extern int setipv4sourcefilter (int __s, struct in_addr __interface_addr,
1118 struct in_addr __group, uint32_t __fmode,
1119 uint32_t __numsrc,
1120 const struct in_addr *__slist)
1121 __attribute__ ((__nothrow__));
1122 extern int getsourcefilter (int __s, uint32_t __interface_addr,
1123 const struct sockaddr *__group,
1124 socklen_t __grouplen, uint32_t *__fmode,
1125 uint32_t *__numsrc,
1126 struct sockaddr_storage *__slist) __attribute__ ((__nothrow__));
1127 extern int setsourcefilter (int __s, uint32_t __interface_addr,
1128 const struct sockaddr *__group,
1129 socklen_t __grouplen, uint32_t __fmode,
1130 uint32_t __numsrc,
1131 const struct sockaddr_storage *__slist) __attribute__ ((__nothrow__));
1132 struct rpcent
1133 {
1134 char *r_name;
1135 char **r_aliases;
1136 int r_number;
1137 };
1138 extern void setrpcent (int __stayopen) __attribute__ ((__nothrow__));
1139 extern void endrpcent (void) __attribute__ ((__nothrow__));
1140 extern struct rpcent *getrpcbyname (const char *__name) __attribute__ ((__nothrow__));
1141 extern struct rpcent *getrpcbynumber (int __number) __attribute__ ((__nothrow__));
1142 extern struct rpcent *getrpcent (void) __attribute__ ((__nothrow__));
1143 extern int getrpcbyname_r (const char *__name, struct rpcent *__result_buf,
1144 char *__buffer, size_t __buflen,
1145 struct rpcent **__result) __attribute__ ((__nothrow__));
1146 extern int getrpcbynumber_r (int __number, struct rpcent *__result_buf,
1147 char *__buffer, size_t __buflen,
1148 struct rpcent **__result) __attribute__ ((__nothrow__));
1149 extern int getrpcent_r (struct rpcent *__result_buf, char *__buffer,
1150 size_t __buflen, struct rpcent **__result) __attribute__ ((__nothrow__));
1151 typedef union sigval
1152 {
1153 int sival_int;
1154 void *sival_ptr;
1155 } sigval_t;
1156 typedef struct sigevent
1157 {
1158 sigval_t sigev_value;
1159 int sigev_signo;
1160 int sigev_notify;
1161 union
1162 {
1163 int _pad[((64 / sizeof (int)) - 4)];
1164 __pid_t _tid;
1165 struct
1166 {
1167 void (*_function) (sigval_t);
1168 void *_attribute;
1169 } _sigev_thread;
1170 } _sigev_un;
1171 } sigevent_t;
1172 enum
1173 {
1174 SIGEV_SIGNAL = 0,
1175 SIGEV_NONE,
1176 SIGEV_THREAD,
1177 SIGEV_THREAD_ID = 4
1178 };
1179 struct netent
1180 {
1181 char *n_name;
1182 char **n_aliases;
1183 int n_addrtype;
1184 uint32_t n_net;
1185 };
1186 extern int *__h_errno_location (void) __attribute__ ((__nothrow__)) __attribute__ ((__const__));
1187 extern void herror (const char *__str) __attribute__ ((__nothrow__));
1188 extern const char *hstrerror (int __err_num) __attribute__ ((__nothrow__));
1189 struct hostent
1190 {
1191 char *h_name;
1192 char **h_aliases;
1193 int h_addrtype;
1194 int h_length;
1195 char **h_addr_list;
1196 };
1197 extern void sethostent (int __stay_open);
1198 extern void endhostent (void);
1199 extern struct hostent *gethostent (void);
1200 extern struct hostent *gethostbyaddr (const void *__addr, __socklen_t __len,
1201 int __type);
1202 extern struct hostent *gethostbyname (const char *__name);
1203 extern struct hostent *gethostbyname2 (const char *__name, int __af);
1204 extern int gethostent_r (struct hostent *__restrict __result_buf,
1205 char *__restrict __buf, size_t __buflen,
1206 struct hostent **__restrict __result,
1207 int *__restrict __h_errnop);
1208 extern int gethostbyaddr_r (const void *__restrict __addr, __socklen_t __len,
1209 int __type,
1210 struct hostent *__restrict __result_buf,
1211 char *__restrict __buf, size_t __buflen,
1212 struct hostent **__restrict __result,
1213 int *__restrict __h_errnop);
1214 extern int gethostbyname_r (const char *__restrict __name,
1215 struct hostent *__restrict __result_buf,
1216 char *__restrict __buf, size_t __buflen,
1217 struct hostent **__restrict __result,
1218 int *__restrict __h_errnop);
1219 extern int gethostbyname2_r (const char *__restrict __name, int __af,
1220 struct hostent *__restrict __result_buf,
1221 char *__restrict __buf, size_t __buflen,
1222 struct hostent **__restrict __result,
1223 int *__restrict __h_errnop);
1224 extern void setnetent (int __stay_open);
1225 extern void endnetent (void);
1226 extern struct netent *getnetent (void);
1227 extern struct netent *getnetbyaddr (uint32_t __net, int __type);
1228 extern struct netent *getnetbyname (const char *__name);
1229 extern int getnetent_r (struct netent *__restrict __result_buf,
1230 char *__restrict __buf, size_t __buflen,
1231 struct netent **__restrict __result,
1232 int *__restrict __h_errnop);
1233 extern int getnetbyaddr_r (uint32_t __net, int __type,
1234 struct netent *__restrict __result_buf,
1235 char *__restrict __buf, size_t __buflen,
1236 struct netent **__restrict __result,
1237 int *__restrict __h_errnop);
1238 extern int getnetbyname_r (const char *__restrict __name,
1239 struct netent *__restrict __result_buf,
1240 char *__restrict __buf, size_t __buflen,
1241 struct netent **__restrict __result,
1242 int *__restrict __h_errnop);
1243 struct servent
1244 {
1245 char *s_name;
1246 char **s_aliases;
1247 int s_port;
1248 char *s_proto;
1249 };
1250 extern void setservent (int __stay_open);
1251 extern void endservent (void);
1252 extern struct servent *getservent (void);
1253 extern struct servent *getservbyname (const char *__name,
1254 const char *__proto);
1255 extern struct servent *getservbyport (int __port, const char *__proto);
1256 extern int getservent_r (struct servent *__restrict __result_buf,
1257 char *__restrict __buf, size_t __buflen,
1258 struct servent **__restrict __result);
1259 extern int getservbyname_r (const char *__restrict __name,
1260 const char *__restrict __proto,
1261 struct servent *__restrict __result_buf,
1262 char *__restrict __buf, size_t __buflen,
1263 struct servent **__restrict __result);
1264 extern int getservbyport_r (int __port, const char *__restrict __proto,
1265 struct servent *__restrict __result_buf,
1266 char *__restrict __buf, size_t __buflen,
1267 struct servent **__restrict __result);
1268 struct protoent
1269 {
1270 char *p_name;
1271 char **p_aliases;
1272 int p_proto;
1273 };
1274 extern void setprotoent (int __stay_open);
1275 extern void endprotoent (void);
1276 extern struct protoent *getprotoent (void);
1277 extern struct protoent *getprotobyname (const char *__name);
1278 extern struct protoent *getprotobynumber (int __proto);
1279 extern int getprotoent_r (struct protoent *__restrict __result_buf,
1280 char *__restrict __buf, size_t __buflen,
1281 struct protoent **__restrict __result);
1282 extern int getprotobyname_r (const char *__restrict __name,
1283 struct protoent *__restrict __result_buf,
1284 char *__restrict __buf, size_t __buflen,
1285 struct protoent **__restrict __result);
1286 extern int getprotobynumber_r (int __proto,
1287 struct protoent *__restrict __result_buf,
1288 char *__restrict __buf, size_t __buflen,
1289 struct protoent **__restrict __result);
1290 extern int setnetgrent (const char *__netgroup);
1291 extern void endnetgrent (void);
1292 extern int getnetgrent (char **__restrict __hostp,
1293 char **__restrict __userp,
1294 char **__restrict __domainp);
1295 extern int innetgr (const char *__netgroup, const char *__host,
1296 const char *__user, const char *__domain);
1297 extern int getnetgrent_r (char **__restrict __hostp,
1298 char **__restrict __userp,
1299 char **__restrict __domainp,
1300 char *__restrict __buffer, size_t __buflen);
1301 extern int rcmd (char **__restrict __ahost, unsigned short int __rport,
1302 const char *__restrict __locuser,
1303 const char *__restrict __remuser,
1304 const char *__restrict __cmd, int *__restrict __fd2p);
1305 extern int rcmd_af (char **__restrict __ahost, unsigned short int __rport,
1306 const char *__restrict __locuser,
1307 const char *__restrict __remuser,
1308 const char *__restrict __cmd, int *__restrict __fd2p,
1309 sa_family_t __af);
1310 extern int rexec (char **__restrict __ahost, int __rport,
1311 const char *__restrict __name,
1312 const char *__restrict __pass,
1313 const char *__restrict __cmd, int *__restrict __fd2p);
1314 extern int rexec_af (char **__restrict __ahost, int __rport,
1315 const char *__restrict __name,
1316 const char *__restrict __pass,
1317 const char *__restrict __cmd, int *__restrict __fd2p,
1318 sa_family_t __af);
1319 extern int ruserok (const char *__rhost, int __suser,
1320 const char *__remuser, const char *__locuser);
1321 extern int ruserok_af (const char *__rhost, int __suser,
1322 const char *__remuser, const char *__locuser,
1323 sa_family_t __af);
1324 extern int iruserok (uint32_t __raddr, int __suser,
1325 const char *__remuser, const char *__locuser);
1326 extern int iruserok_af (const void *__raddr, int __suser,
1327 const char *__remuser, const char *__locuser,
1328 sa_family_t __af);
1329 extern int rresvport (int *__alport);
1330 extern int rresvport_af (int *__alport, sa_family_t __af);
1331 struct addrinfo
1332 {
1333 int ai_flags;
1334 int ai_family;
1335 int ai_socktype;
1336 int ai_protocol;
1337 socklen_t ai_addrlen;
1338 struct sockaddr *ai_addr;
1339 char *ai_canonname;
1340 struct addrinfo *ai_next;
1341 };
1342 struct gaicb
1343 {
1344 const char *ar_name;
1345 const char *ar_service;
1346 const struct addrinfo *ar_request;
1347 struct addrinfo *ar_result;
1348 int __return;
1349 int __unused[5];
1350 };
1351 extern int getaddrinfo (const char *__restrict __name,
1352 const char *__restrict __service,
1353 const struct addrinfo *__restrict __req,
1354 struct addrinfo **__restrict __pai);
1355 extern void freeaddrinfo (struct addrinfo *__ai) __attribute__ ((__nothrow__));
1356 extern const char *gai_strerror (int __ecode) __attribute__ ((__nothrow__));
1357 extern int getnameinfo (const struct sockaddr *__restrict __sa,
1358 socklen_t __salen, char *__restrict __host,
1359 socklen_t __hostlen, char *__restrict __serv,
1360 socklen_t __servlen, unsigned int __flags);
1361 extern int getaddrinfo_a (int __mode, struct gaicb *__list[__restrict],
1362 int __ent, struct sigevent *__restrict __sig);
1363 extern int gai_suspend (const struct gaicb *const __list[], int __ent,
1364 const struct timespec *__timeout);
1365 extern int gai_error (struct gaicb *__req) __attribute__ ((__nothrow__));
1366 extern int gai_cancel (struct gaicb *__gaicbp) __attribute__ ((__nothrow__));
1367 typedef long int __jmp_buf[8];
1368 struct __jmp_buf_tag
1369 {
1370 __jmp_buf __jmpbuf;
1371 int __mask_was_saved;
1372 __sigset_t __saved_mask;
1373 };
1374 typedef struct __jmp_buf_tag jmp_buf[1];
1375 extern int setjmp (jmp_buf __env) __attribute__ ((__nothrow__));
1376 extern int __sigsetjmp (struct __jmp_buf_tag __env[1], int __savemask) __attribute__ ((__nothrow__));
1377 extern int _setjmp (struct __jmp_buf_tag __env[1]) __attribute__ ((__nothrow__));
1378 extern void longjmp (struct __jmp_buf_tag __env[1], int __val)
1379 __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));
1380 extern void _longjmp (struct __jmp_buf_tag __env[1], int __val)
1381 __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));
1382 typedef struct __jmp_buf_tag sigjmp_buf[1];
1383 extern void siglongjmp (sigjmp_buf __env, int __val)
1384 __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));
1385 extern void longjmp (struct __jmp_buf_tag __env[1], int __val) __asm__ ("" "__longjmp_chk") __attribute__ ((__nothrow__))
1386 __attribute__ ((__noreturn__));
1387 extern void _longjmp (struct __jmp_buf_tag __env[1], int __val) __asm__ ("" "__longjmp_chk") __attribute__ ((__nothrow__))
1388 __attribute__ ((__noreturn__));
1389 extern void siglongjmp (struct __jmp_buf_tag __env[1], int __val) __asm__ ("" "__longjmp_chk") __attribute__ ((__nothrow__))
1390 __attribute__ ((__noreturn__));
1391 extern int __sigismember (const __sigset_t *, int);
1392 extern int __sigaddset (__sigset_t *, int);
1393 extern int __sigdelset (__sigset_t *, int);
1394 extern __inline __attribute__ ((__gnu_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; }
1395 extern __inline __attribute__ ((__gnu_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); }
1396 extern __inline __attribute__ ((__gnu_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); }
1397 typedef __sig_atomic_t sig_atomic_t;
1398 typedef struct siginfo
1399 {
1400 int si_signo;
1401 int si_errno;
1402 int si_code;
1403 union
1404 {
1405 int _pad[((128 / sizeof (int)) - 4)];
1406 struct
1407 {
1408 __pid_t si_pid;
1409 __uid_t si_uid;
1410 } _kill;
1411 struct
1412 {
1413 int si_tid;
1414 int si_overrun;
1415 sigval_t si_sigval;
1416 } _timer;
1417 struct
1418 {
1419 __pid_t si_pid;
1420 __uid_t si_uid;
1421 sigval_t si_sigval;
1422 } _rt;
1423 struct
1424 {
1425 __pid_t si_pid;
1426 __uid_t si_uid;
1427 int si_status;
1428 __clock_t si_utime;
1429 __clock_t si_stime;
1430 } _sigchld;
1431 struct
1432 {
1433 void *si_addr;
1434 } _sigfault;
1435 struct
1436 {
1437 long int si_band;
1438 int si_fd;
1439 } _sigpoll;
1440 } _sifields;
1441 } siginfo_t;
1442 enum
1443 {
1444 SI_ASYNCNL = -60,
1445 SI_TKILL = -6,
1446 SI_SIGIO,
1447 SI_ASYNCIO,
1448 SI_MESGQ,
1449 SI_TIMER,
1450 SI_QUEUE,
1451 SI_USER,
1452 SI_KERNEL = 0x80
1453 };
1454 enum
1455 {
1456 ILL_ILLOPC = 1,
1457 ILL_ILLOPN,
1458 ILL_ILLADR,
1459 ILL_ILLTRP,
1460 ILL_PRVOPC,
1461 ILL_PRVREG,
1462 ILL_COPROC,
1463 ILL_BADSTK
1464 };
1465 enum
1466 {
1467 FPE_INTDIV = 1,
1468 FPE_INTOVF,
1469 FPE_FLTDIV,
1470 FPE_FLTOVF,
1471 FPE_FLTUND,
1472 FPE_FLTRES,
1473 FPE_FLTINV,
1474 FPE_FLTSUB
1475 };
1476 enum
1477 {
1478 SEGV_MAPERR = 1,
1479 SEGV_ACCERR
1480 };
1481 enum
1482 {
1483 BUS_ADRALN = 1,
1484 BUS_ADRERR,
1485 BUS_OBJERR
1486 };
1487 enum
1488 {
1489 TRAP_BRKPT = 1,
1490 TRAP_TRACE
1491 };
1492 enum
1493 {
1494 CLD_EXITED = 1,
1495 CLD_KILLED,
1496 CLD_DUMPED,
1497 CLD_TRAPPED,
1498 CLD_STOPPED,
1499 CLD_CONTINUED
1500 };
1501 enum
1502 {
1503 POLL_IN = 1,
1504 POLL_OUT,
1505 POLL_MSG,
1506 POLL_ERR,
1507 POLL_PRI,
1508 POLL_HUP
1509 };
1510 typedef void (*__sighandler_t) (int);
1511 extern __sighandler_t __sysv_signal (int __sig, __sighandler_t __handler)
1512 __attribute__ ((__nothrow__));
1513 extern __sighandler_t sysv_signal (int __sig, __sighandler_t __handler)
1514 __attribute__ ((__nothrow__));
1515 extern __sighandler_t signal (int __sig, __sighandler_t __handler)
1516 __attribute__ ((__nothrow__));
1517 extern __sighandler_t bsd_signal (int __sig, __sighandler_t __handler)
1518 __attribute__ ((__nothrow__));
1519 extern int kill (__pid_t __pid, int __sig) __attribute__ ((__nothrow__));
1520 extern int killpg (__pid_t __pgrp, int __sig) __attribute__ ((__nothrow__));
1521 extern int raise (int __sig) __attribute__ ((__nothrow__));
1522 extern __sighandler_t ssignal (int __sig, __sighandler_t __handler)
1523 __attribute__ ((__nothrow__));
1524 extern int gsignal (int __sig) __attribute__ ((__nothrow__));
1525 extern void psignal (int __sig, const char *__s);
1526 extern void psiginfo (const siginfo_t *__pinfo, const char *__s);
1527 extern int __sigpause (int __sig_or_mask, int __is_sig);
1528 extern int sigpause (int __sig) __asm__ ("__xpg_sigpause");
1529 extern int sigblock (int __mask) __attribute__ ((__nothrow__)) __attribute__ ((__deprecated__));
1530 extern int sigsetmask (int __mask) __attribute__ ((__nothrow__)) __attribute__ ((__deprecated__));
1531 extern int siggetmask (void) __attribute__ ((__nothrow__)) __attribute__ ((__deprecated__));
1532 typedef __sighandler_t sighandler_t;
1533 typedef __sighandler_t sig_t;
1534 extern int sigemptyset (sigset_t *__set) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1535 extern int sigfillset (sigset_t *__set) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1536 extern int sigaddset (sigset_t *__set, int __signo) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1537 extern int sigdelset (sigset_t *__set, int __signo) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1538 extern int sigismember (const sigset_t *__set, int __signo)
1539 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1540 extern int sigisemptyset (const sigset_t *__set) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1541 extern int sigandset (sigset_t *__set, const sigset_t *__left,
1542 const sigset_t *__right) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2, 3)));
1543 extern int sigorset (sigset_t *__set, const sigset_t *__left,
1544 const sigset_t *__right) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2, 3)));
1545 struct sigaction
1546 {
1547 union
1548 {
1549 __sighandler_t sa_handler;
1550 void (*sa_sigaction) (int, siginfo_t *, void *);
1551 }
1552 __sigaction_handler;
1553 __sigset_t sa_mask;
1554 int sa_flags;
1555 void (*sa_restorer) (void);
1556 };
1557 extern int sigprocmask (int __how, const sigset_t *__restrict __set,
1558 sigset_t *__restrict __oset) __attribute__ ((__nothrow__));
1559 extern int sigsuspend (const sigset_t *__set) __attribute__ ((__nonnull__ (1)));
1560 extern int sigaction (int __sig, const struct sigaction *__restrict __act,
1561 struct sigaction *__restrict __oact) __attribute__ ((__nothrow__));
1562 extern int sigpending (sigset_t *__set) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1563 extern int sigwait (const sigset_t *__restrict __set, int *__restrict __sig)
1564 __attribute__ ((__nonnull__ (1, 2)));
1565 extern int sigwaitinfo (const sigset_t *__restrict __set,
1566 siginfo_t *__restrict __info) __attribute__ ((__nonnull__ (1)));
1567 extern int sigtimedwait (const sigset_t *__restrict __set,
1568 siginfo_t *__restrict __info,
1569 const struct timespec *__restrict __timeout)
1570 __attribute__ ((__nonnull__ (1)));
1571 extern int sigqueue (__pid_t __pid, int __sig, const union sigval __val)
1572 __attribute__ ((__nothrow__));
1573 extern const char *const _sys_siglist[65];
1574 extern const char *const sys_siglist[65];
1575 struct sigvec
1576 {
1577 __sighandler_t sv_handler;
1578 int sv_mask;
1579 int sv_flags;
1580 };
1581 extern int sigvec (int __sig, const struct sigvec *__vec,
1582 struct sigvec *__ovec) __attribute__ ((__nothrow__));
1583 struct _fpreg
1584 {
1585 unsigned short significand[4];
1586 unsigned short exponent;
1587 };
1588 struct _fpxreg
1589 {
1590 unsigned short significand[4];
1591 unsigned short exponent;
1592 unsigned short padding[3];
1593 };
1594 struct _xmmreg
1595 {
1596 __uint32_t element[4];
1597 };
1598 struct _fpstate
1599 {
1600 __uint16_t cwd;
1601 __uint16_t swd;
1602 __uint16_t ftw;
1603 __uint16_t fop;
1604 __uint64_t rip;
1605 __uint64_t rdp;
1606 __uint32_t mxcsr;
1607 __uint32_t mxcr_mask;
1608 struct _fpxreg _st[8];
1609 struct _xmmreg _xmm[16];
1610 __uint32_t padding[24];
1611 };
1612 struct sigcontext
1613 {
1614 unsigned long r8;
1615 unsigned long r9;
1616 unsigned long r10;
1617 unsigned long r11;
1618 unsigned long r12;
1619 unsigned long r13;
1620 unsigned long r14;
1621 unsigned long r15;
1622 unsigned long rdi;
1623 unsigned long rsi;
1624 unsigned long rbp;
1625 unsigned long rbx;
1626 unsigned long rdx;
1627 unsigned long rax;
1628 unsigned long rcx;
1629 unsigned long rsp;
1630 unsigned long rip;
1631 unsigned long eflags;
1632 unsigned short cs;
1633 unsigned short gs;
1634 unsigned short fs;
1635 unsigned short __pad0;
1636 unsigned long err;
1637 unsigned long trapno;
1638 unsigned long oldmask;
1639 unsigned long cr2;
1640 struct _fpstate * fpstate;
1641 unsigned long __reserved1 [8];
1642 };
1643 extern int sigreturn (struct sigcontext *__scp) __attribute__ ((__nothrow__));
1644 extern int siginterrupt (int __sig, int __interrupt) __attribute__ ((__nothrow__));
1645 struct sigstack
1646 {
1647 void *ss_sp;
1648 int ss_onstack;
1649 };
1650 enum
1651 {
1652 SS_ONSTACK = 1,
1653 SS_DISABLE
1654 };
1655 typedef struct sigaltstack
1656 {
1657 void *ss_sp;
1658 int ss_flags;
1659 size_t ss_size;
1660 } stack_t;
1661 typedef long int greg_t;
1662 typedef greg_t gregset_t[23];
1663 enum
1664 {
1665 REG_R8 = 0,
1666 REG_R9,
1667 REG_R10,
1668 REG_R11,
1669 REG_R12,
1670 REG_R13,
1671 REG_R14,
1672 REG_R15,
1673 REG_RDI,
1674 REG_RSI,
1675 REG_RBP,
1676 REG_RBX,
1677 REG_RDX,
1678 REG_RAX,
1679 REG_RCX,
1680 REG_RSP,
1681 REG_RIP,
1682 REG_EFL,
1683 REG_CSGSFS,
1684 REG_ERR,
1685 REG_TRAPNO,
1686 REG_OLDMASK,
1687 REG_CR2
1688 };
1689 struct _libc_fpxreg
1690 {
1691 unsigned short int significand[4];
1692 unsigned short int exponent;
1693 unsigned short int padding[3];
1694 };
1695 struct _libc_xmmreg
1696 {
1697 __uint32_t element[4];
1698 };
1699 struct _libc_fpstate
1700 {
1701 __uint16_t cwd;
1702 __uint16_t swd;
1703 __uint16_t ftw;
1704 __uint16_t fop;
1705 __uint64_t rip;
1706 __uint64_t rdp;
1707 __uint32_t mxcsr;
1708 __uint32_t mxcr_mask;
1709 struct _libc_fpxreg _st[8];
1710 struct _libc_xmmreg _xmm[16];
1711 __uint32_t padding[24];
1712 };
1713 typedef struct _libc_fpstate *fpregset_t;
1714 typedef struct
1715 {
1716 gregset_t gregs;
1717 fpregset_t fpregs;
1718 unsigned long __reserved1 [8];
1719 } mcontext_t;
1720 typedef struct ucontext
1721 {
1722 unsigned long int uc_flags;
1723 struct ucontext *uc_link;
1724 stack_t uc_stack;
1725 mcontext_t uc_mcontext;
1726 __sigset_t uc_sigmask;
1727 struct _libc_fpstate __fpregs_mem;
1728 } ucontext_t;
1729 extern int sigstack (struct sigstack *__ss, struct sigstack *__oss)
1730 __attribute__ ((__nothrow__)) __attribute__ ((__deprecated__));
1731 extern int sigaltstack (const struct sigaltstack *__restrict __ss,
1732 struct sigaltstack *__restrict __oss) __attribute__ ((__nothrow__));
1733 extern int sighold (int __sig) __attribute__ ((__nothrow__));
1734 extern int sigrelse (int __sig) __attribute__ ((__nothrow__));
1735 extern int sigignore (int __sig) __attribute__ ((__nothrow__));
1736 extern __sighandler_t sigset (int __sig, __sighandler_t __disp) __attribute__ ((__nothrow__));
1737 extern int pthread_sigmask (int __how,
1738 const __sigset_t *__restrict __newmask,
1739 __sigset_t *__restrict __oldmask)__attribute__ ((__nothrow__));
1740 extern int pthread_kill (pthread_t __threadid, int __signo) __attribute__ ((__nothrow__));
1741 extern int pthread_sigqueue (pthread_t __threadid, int __signo,
1742 const union sigval __value) __attribute__ ((__nothrow__));
1743 extern int __libc_current_sigrtmin (void) __attribute__ ((__nothrow__));
1744 extern int __libc_current_sigrtmax (void) __attribute__ ((__nothrow__));
1745 struct _IO_FILE;
1746 typedef struct _IO_FILE FILE;
1747 typedef struct _IO_FILE __FILE;
1748 typedef struct
1749 {
1750 int __count;
1751 union
1752 {
1753 unsigned int __wch;
1754 char __wchb[4];
1755 } __value;
1756 } __mbstate_t;
1757 typedef struct
1758 {
1759 __off_t __pos;
1760 __mbstate_t __state;
1761 } _G_fpos_t;
1762 typedef struct
1763 {
1764 __off64_t __pos;
1765 __mbstate_t __state;
1766 } _G_fpos64_t;
1767 typedef int _G_int16_t __attribute__ ((__mode__ (__HI__)));
1768 typedef int _G_int32_t __attribute__ ((__mode__ (__SI__)));
1769 typedef unsigned int _G_uint16_t __attribute__ ((__mode__ (__HI__)));
1770 typedef unsigned int _G_uint32_t __attribute__ ((__mode__ (__SI__)));
1771 typedef __builtin_va_list __gnuc_va_list;
1772 struct _IO_jump_t; struct _IO_FILE;
1773 typedef void _IO_lock_t;
1774 struct _IO_marker {
1775 struct _IO_marker *_next;
1776 struct _IO_FILE *_sbuf;
1777 int _pos;
1778 };
1779 enum __codecvt_result
1780 {
1781 __codecvt_ok,
1782 __codecvt_partial,
1783 __codecvt_error,
1784 __codecvt_noconv
1785 };
1786 struct _IO_FILE {
1787 int _flags;
1788 char* _IO_read_ptr;
1789 char* _IO_read_end;
1790 char* _IO_read_base;
1791 char* _IO_write_base;
1792 char* _IO_write_ptr;
1793 char* _IO_write_end;
1794 char* _IO_buf_base;
1795 char* _IO_buf_end;
1796 char *_IO_save_base;
1797 char *_IO_backup_base;
1798 char *_IO_save_end;
1799 struct _IO_marker *_markers;
1800 struct _IO_FILE *_chain;
1801 int _fileno;
1802 int _flags2;
1803 __off_t _old_offset;
1804 unsigned short _cur_column;
1805 signed char _vtable_offset;
1806 char _shortbuf[1];
1807 _IO_lock_t *_lock;
1808 __off64_t _offset;
1809 void *__pad1;
1810 void *__pad2;
1811 void *__pad3;
1812 void *__pad4;
1813 size_t __pad5;
1814 int _mode;
1815 char _unused2[15 * sizeof (int) - 4 * sizeof (void *) - sizeof (size_t)];
1816 };
1817 typedef struct _IO_FILE _IO_FILE;
1818 struct _IO_FILE_plus;
1819 extern struct _IO_FILE_plus _IO_2_1_stdin_;
1820 extern struct _IO_FILE_plus _IO_2_1_stdout_;
1821 extern struct _IO_FILE_plus _IO_2_1_stderr_;
1822 typedef __ssize_t __io_read_fn (void *__cookie, char *__buf, size_t __nbytes);
1823 typedef __ssize_t __io_write_fn (void *__cookie, const char *__buf,
1824 size_t __n);
1825 typedef int __io_seek_fn (void *__cookie, __off64_t *__pos, int __w);
1826 typedef int __io_close_fn (void *__cookie);
1827 typedef __io_read_fn cookie_read_function_t;
1828 typedef __io_write_fn cookie_write_function_t;
1829 typedef __io_seek_fn cookie_seek_function_t;
1830 typedef __io_close_fn cookie_close_function_t;
1831 typedef struct
1832 {
1833 __io_read_fn *read;
1834 __io_write_fn *write;
1835 __io_seek_fn *seek;
1836 __io_close_fn *close;
1837 } _IO_cookie_io_functions_t;
1838 typedef _IO_cookie_io_functions_t cookie_io_functions_t;
1839 struct _IO_cookie_file;
1840 extern void _IO_cookie_init (struct _IO_cookie_file *__cfile, int __read_write,
1841 void *__cookie, _IO_cookie_io_functions_t __fns);
1842 extern int __underflow (_IO_FILE *);
1843 extern int __uflow (_IO_FILE *);
1844 extern int __overflow (_IO_FILE *, int);
1845 extern int _IO_getc (_IO_FILE *__fp);
1846 extern int _IO_putc (int __c, _IO_FILE *__fp);
1847 extern int _IO_feof (_IO_FILE *__fp) __attribute__ ((__nothrow__));
1848 extern int _IO_ferror (_IO_FILE *__fp) __attribute__ ((__nothrow__));
1849 extern int _IO_peekc_locked (_IO_FILE *__fp);
1850 extern void _IO_flockfile (_IO_FILE *) __attribute__ ((__nothrow__));
1851 extern void _IO_funlockfile (_IO_FILE *) __attribute__ ((__nothrow__));
1852 extern int _IO_ftrylockfile (_IO_FILE *) __attribute__ ((__nothrow__));
1853 extern int _IO_vfscanf (_IO_FILE * __restrict, const char * __restrict,
1854 __gnuc_va_list, int *__restrict);
1855 extern int _IO_vfprintf (_IO_FILE *__restrict, const char *__restrict,
1856 __gnuc_va_list);
1857 extern __ssize_t _IO_padn (_IO_FILE *, int, __ssize_t);
1858 extern size_t _IO_sgetn (_IO_FILE *, void *, size_t);
1859 extern __off64_t _IO_seekoff (_IO_FILE *, __off64_t, int, int);
1860 extern __off64_t _IO_seekpos (_IO_FILE *, __off64_t, int);
1861 extern void _IO_free_backup_area (_IO_FILE *) __attribute__ ((__nothrow__));
1862 typedef __gnuc_va_list va_list;
1863 typedef _G_fpos64_t fpos_t;
1864 typedef _G_fpos64_t fpos64_t;
1865 extern struct _IO_FILE *stdin;
1866 extern struct _IO_FILE *stdout;
1867 extern struct _IO_FILE *stderr;
1868 extern int remove (const char *__filename) __attribute__ ((__nothrow__));
1869 extern int rename (const char *__old, const char *__new) __attribute__ ((__nothrow__));
1870 extern int renameat (int __oldfd, const char *__old, int __newfd,
1871 const char *__new) __attribute__ ((__nothrow__));
1872 extern FILE *tmpfile (void) __asm__ ("" "tmpfile64") __attribute__ ((__warn_unused_result__));
1873 extern FILE *tmpfile64 (void) __attribute__ ((__warn_unused_result__));
1874 extern char *tmpnam (char *__s) __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__));
1875 extern char *tmpnam_r (char *__s) __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__));
1876 extern char *tempnam (const char *__dir, const char *__pfx)
1877 __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) __attribute__ ((__warn_unused_result__));
1878 extern int fclose (FILE *__stream);
1879 extern int fflush (FILE *__stream);
1880 extern int fflush_unlocked (FILE *__stream);
1881 extern int fcloseall (void);
1882 extern FILE *fopen (const char *__restrict __filename, const char *__restrict __modes) __asm__ ("" "fopen64")
1883 __attribute__ ((__warn_unused_result__));
1884 extern FILE *freopen (const char *__restrict __filename, const char *__restrict __modes, FILE *__restrict __stream) __asm__ ("" "freopen64")
1885 __attribute__ ((__warn_unused_result__));
1886 extern FILE *fopen64 (const char *__restrict __filename,
1887 const char *__restrict __modes) __attribute__ ((__warn_unused_result__));
1888 extern FILE *freopen64 (const char *__restrict __filename,
1889 const char *__restrict __modes,
1890 FILE *__restrict __stream) __attribute__ ((__warn_unused_result__));
1891 extern FILE *fdopen (int __fd, const char *__modes) __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__));
1892 extern FILE *fopencookie (void *__restrict __magic_cookie,
1893 const char *__restrict __modes,
1894 _IO_cookie_io_functions_t __io_funcs) __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__));
1895 extern FILE *fmemopen (void *__s, size_t __len, const char *__modes)
1896 __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__));
1897 extern FILE *open_memstream (char **__bufloc, size_t *__sizeloc) __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__));
1898 extern void setbuf (FILE *__restrict __stream, char *__restrict __buf) __attribute__ ((__nothrow__));
1899 extern int setvbuf (FILE *__restrict __stream, char *__restrict __buf,
1900 int __modes, size_t __n) __attribute__ ((__nothrow__));
1901 extern void setbuffer (FILE *__restrict __stream, char *__restrict __buf,
1902 size_t __size) __attribute__ ((__nothrow__));
1903 extern void setlinebuf (FILE *__stream) __attribute__ ((__nothrow__));
1904 extern int fprintf (FILE *__restrict __stream,
1905 const char *__restrict __format, ...);
1906 extern int printf (const char *__restrict __format, ...);
1907 extern int sprintf (char *__restrict __s,
1908 const char *__restrict __format, ...) __attribute__ ((__nothrow__));
1909 extern int vfprintf (FILE *__restrict __s, const char *__restrict __format,
1910 __gnuc_va_list __arg);
1911 extern int vprintf (const char *__restrict __format, __gnuc_va_list __arg);
1912 extern int vsprintf (char *__restrict __s, const char *__restrict __format,
1913 __gnuc_va_list __arg) __attribute__ ((__nothrow__));
1914 extern int snprintf (char *__restrict __s, size_t __maxlen,
1915 const char *__restrict __format, ...)
1916 __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 3, 4)));
1917 extern int vsnprintf (char *__restrict __s, size_t __maxlen,
1918 const char *__restrict __format, __gnuc_va_list __arg)
1919 __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 3, 0)));
1920 extern int vasprintf (char **__restrict __ptr, const char *__restrict __f,
1921 __gnuc_va_list __arg)
1922 __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 0))) __attribute__ ((__warn_unused_result__));
1923 extern int __asprintf (char **__restrict __ptr,
1924 const char *__restrict __fmt, ...)
1925 __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3))) __attribute__ ((__warn_unused_result__));
1926 extern int asprintf (char **__restrict __ptr,
1927 const char *__restrict __fmt, ...)
1928 __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3))) __attribute__ ((__warn_unused_result__));
1929 extern int vdprintf (int __fd, const char *__restrict __fmt,
1930 __gnuc_va_list __arg)
1931 __attribute__ ((__format__ (__printf__, 2, 0)));
1932 extern int dprintf (int __fd, const char *__restrict __fmt, ...)
1933 __attribute__ ((__format__ (__printf__, 2, 3)));
1934 extern int fscanf (FILE *__restrict __stream,
1935 const char *__restrict __format, ...) __attribute__ ((__warn_unused_result__));
1936 extern int scanf (const char *__restrict __format, ...) __attribute__ ((__warn_unused_result__));
1937 extern int sscanf (const char *__restrict __s,
1938 const char *__restrict __format, ...) __attribute__ ((__nothrow__));
1939 extern int vfscanf (FILE *__restrict __s, const char *__restrict __format,
1940 __gnuc_va_list __arg)
1941 __attribute__ ((__format__ (__scanf__, 2, 0))) __attribute__ ((__warn_unused_result__));
1942 extern int vscanf (const char *__restrict __format, __gnuc_va_list __arg)
1943 __attribute__ ((__format__ (__scanf__, 1, 0))) __attribute__ ((__warn_unused_result__));
1944 extern int vsscanf (const char *__restrict __s,
1945 const char *__restrict __format, __gnuc_va_list __arg)
1946 __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__scanf__, 2, 0)));
1947 extern int fgetc (FILE *__stream);
1948 extern int getc (FILE *__stream);
1949 extern int getchar (void);
1950 extern int getc_unlocked (FILE *__stream);
1951 extern int getchar_unlocked (void);
1952 extern int fgetc_unlocked (FILE *__stream);
1953 extern int fputc (int __c, FILE *__stream);
1954 extern int putc (int __c, FILE *__stream);
1955 extern int putchar (int __c);
1956 extern int fputc_unlocked (int __c, FILE *__stream);
1957 extern int putc_unlocked (int __c, FILE *__stream);
1958 extern int putchar_unlocked (int __c);
1959 extern int getw (FILE *__stream);
1960 extern int putw (int __w, FILE *__stream);
1961 extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
1962 __attribute__ ((__warn_unused_result__));
1963 extern char *gets (char *__s) __attribute__ ((__warn_unused_result__));
1964 extern char *fgets_unlocked (char *__restrict __s, int __n,
1965 FILE *__restrict __stream) __attribute__ ((__warn_unused_result__));
1966 extern __ssize_t __getdelim (char **__restrict __lineptr,
1967 size_t *__restrict __n, int __delimiter,
1968 FILE *__restrict __stream) __attribute__ ((__warn_unused_result__));
1969 extern __ssize_t getdelim (char **__restrict __lineptr,
1970 size_t *__restrict __n, int __delimiter,
1971 FILE *__restrict __stream) __attribute__ ((__warn_unused_result__));
1972 extern __ssize_t getline (char **__restrict __lineptr,
1973 size_t *__restrict __n,
1974 FILE *__restrict __stream) __attribute__ ((__warn_unused_result__));
1975 extern int fputs (const char *__restrict __s, FILE *__restrict __stream);
1976 extern int puts (const char *__s);
1977 extern int ungetc (int __c, FILE *__stream);
1978 extern size_t fread (void *__restrict __ptr, size_t __size,
1979 size_t __n, FILE *__restrict __stream) __attribute__ ((__warn_unused_result__));
1980 extern size_t fwrite (const void *__restrict __ptr, size_t __size,
1981 size_t __n, FILE *__restrict __s) __attribute__ ((__warn_unused_result__));
1982 extern int fputs_unlocked (const char *__restrict __s,
1983 FILE *__restrict __stream);
1984 extern size_t fread_unlocked (void *__restrict __ptr, size_t __size,
1985 size_t __n, FILE *__restrict __stream) __attribute__ ((__warn_unused_result__));
1986 extern size_t fwrite_unlocked (const void *__restrict __ptr, size_t __size,
1987 size_t __n, FILE *__restrict __stream) __attribute__ ((__warn_unused_result__));
1988 extern int fseek (FILE *__stream, long int __off, int __whence);
1989 extern long int ftell (FILE *__stream) __attribute__ ((__warn_unused_result__));
1990 extern void rewind (FILE *__stream);
1991 extern int fseeko (FILE *__stream, __off64_t __off, int __whence) __asm__ ("" "fseeko64")
1992 ;
1993 extern __off64_t ftello (FILE *__stream) __asm__ ("" "ftello64");
1994 extern int fgetpos (FILE *__restrict __stream, fpos_t *__restrict __pos) __asm__ ("" "fgetpos64")
1995 ;
1996 extern int fsetpos (FILE *__stream, const fpos_t *__pos) __asm__ ("" "fsetpos64")
1997 ;
1998 extern int fseeko64 (FILE *__stream, __off64_t __off, int __whence);
1999 extern __off64_t ftello64 (FILE *__stream) __attribute__ ((__warn_unused_result__));
2000 extern int fgetpos64 (FILE *__restrict __stream, fpos64_t *__restrict __pos);
2001 extern int fsetpos64 (FILE *__stream, const fpos64_t *__pos);
2002 extern void clearerr (FILE *__stream) __attribute__ ((__nothrow__));
2003 extern int feof (FILE *__stream) __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__));
2004 extern int ferror (FILE *__stream) __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__));
2005 extern void clearerr_unlocked (FILE *__stream) __attribute__ ((__nothrow__));
2006 extern int feof_unlocked (FILE *__stream) __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__));
2007 extern int ferror_unlocked (FILE *__stream) __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__));
2008 extern void perror (const char *__s);
2009 extern int sys_nerr;
2010 extern const char *const sys_errlist[];
2011 extern int _sys_nerr;
2012 extern const char *const _sys_errlist[];
2013 extern int fileno (FILE *__stream) __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__));
2014 extern int fileno_unlocked (FILE *__stream) __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__));
2015 extern FILE *popen (const char *__command, const char *__modes) __attribute__ ((__warn_unused_result__));
2016 extern int pclose (FILE *__stream);
2017 extern char *ctermid (char *__s) __attribute__ ((__nothrow__));
2018 extern char *cuserid (char *__s);
2019 struct obstack;
2020 extern int obstack_printf (struct obstack *__restrict __obstack,
2021 const char *__restrict __format, ...)
2022 __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3)));
2023 extern int obstack_vprintf (struct obstack *__restrict __obstack,
2024 const char *__restrict __format,
2025 __gnuc_va_list __args)
2026 __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 0)));
2027 extern void flockfile (FILE *__stream) __attribute__ ((__nothrow__));
2028 extern int ftrylockfile (FILE *__stream) __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__));
2029 extern void funlockfile (FILE *__stream) __attribute__ ((__nothrow__));
2030 extern __inline __attribute__ ((__gnu_inline__)) int
2031 getchar (void)
2032 {
2033 return _IO_getc (stdin);
2034 }
2035 extern __inline __attribute__ ((__gnu_inline__)) int
2036 fgetc_unlocked (FILE *__fp)
2037 {
2038 return (__builtin_expect (((__fp)->_IO_read_ptr >= (__fp)->_IO_read_end), 0) ? __uflow (__fp) : *(unsigned char *) (__fp)->_IO_read_ptr++);
2039 }
2040 extern __inline __attribute__ ((__gnu_inline__)) int
2041 getc_unlocked (FILE *__fp)
2042 {
2043 return (__builtin_expect (((__fp)->_IO_read_ptr >= (__fp)->_IO_read_end), 0) ? __uflow (__fp) : *(unsigned char *) (__fp)->_IO_read_ptr++);
2044 }
2045 extern __inline __attribute__ ((__gnu_inline__)) int
2046 getchar_unlocked (void)
2047 {
2048 return (__builtin_expect (((stdin)->_IO_read_ptr >= (stdin)->_IO_read_end), 0) ? __uflow (stdin) : *(unsigned char *) (stdin)->_IO_read_ptr++);
2049 }
2050 extern __inline __attribute__ ((__gnu_inline__)) int
2051 putchar (int __c)
2052 {
2053 return _IO_putc (__c, stdout);
2054 }
2055 extern __inline __attribute__ ((__gnu_inline__)) int
2056 fputc_unlocked (int __c, FILE *__stream)
2057 {
2058 return (__builtin_expect (((__stream)->_IO_write_ptr >= (__stream)->_IO_write_end), 0) ? __overflow (__stream, (unsigned char) (__c)) : (unsigned char) (*(__stream)->_IO_write_ptr++ = (__c)));
2059 }
2060 extern __inline __attribute__ ((__gnu_inline__)) int
2061 putc_unlocked (int __c, FILE *__stream)
2062 {
2063 return (__builtin_expect (((__stream)->_IO_write_ptr >= (__stream)->_IO_write_end), 0) ? __overflow (__stream, (unsigned char) (__c)) : (unsigned char) (*(__stream)->_IO_write_ptr++ = (__c)));
2064 }
2065 extern __inline __attribute__ ((__gnu_inline__)) int
2066 putchar_unlocked (int __c)
2067 {
2068 return (__builtin_expect (((stdout)->_IO_write_ptr >= (stdout)->_IO_write_end), 0) ? __overflow (stdout, (unsigned char) (__c)) : (unsigned char) (*(stdout)->_IO_write_ptr++ = (__c)));
2069 }
2070 extern __inline __attribute__ ((__gnu_inline__)) __ssize_t
2071 getline (char **__lineptr, size_t *__n, FILE *__stream)
2072 {
2073 return __getdelim (__lineptr, __n, '\n', __stream);
2074 }
2075 extern __inline __attribute__ ((__gnu_inline__)) int
2076 __attribute__ ((__nothrow__)) feof_unlocked (FILE *__stream)
2077 {
2078 return (((__stream)->_flags & 0x10) != 0);
2079 }
2080 extern __inline __attribute__ ((__gnu_inline__)) int
2081 __attribute__ ((__nothrow__)) ferror_unlocked (FILE *__stream)
2082 {
2083 return (((__stream)->_flags & 0x20) != 0);
2084 }
2085 extern int __sprintf_chk (char *__restrict __s, int __flag, size_t __slen,
2086 const char *__restrict __format, ...) __attribute__ ((__nothrow__));
2087 extern int __vsprintf_chk (char *__restrict __s, int __flag, size_t __slen,
2088 const char *__restrict __format,
2089 __gnuc_va_list __ap) __attribute__ ((__nothrow__));
2090 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) int
2091 __attribute__ ((__nothrow__)) sprintf (char *__restrict __s, const char *__restrict __fmt, ...)
2092 {
2093 return __builtin___sprintf_chk (__s, 2 - 1,
2094 __builtin_object_size (__s, 2 > 1), __fmt, __builtin_va_arg_pack ());
2095 }
2096 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) int
2097 __attribute__ ((__nothrow__)) vsprintf (char *__restrict __s, const char *__restrict __fmt, __gnuc_va_list __ap)
2098 {
2099 return __builtin___vsprintf_chk (__s, 2 - 1,
2100 __builtin_object_size (__s, 2 > 1), __fmt, __ap);
2101 }
2102 extern int __snprintf_chk (char *__restrict __s, size_t __n, int __flag,
2103 size_t __slen, const char *__restrict __format,
2104 ...) __attribute__ ((__nothrow__));
2105 extern int __vsnprintf_chk (char *__restrict __s, size_t __n, int __flag,
2106 size_t __slen, const char *__restrict __format,
2107 __gnuc_va_list __ap) __attribute__ ((__nothrow__));
2108 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) int
2109 __attribute__ ((__nothrow__)) snprintf (char *__restrict __s, size_t __n, const char *__restrict __fmt, ...)
2110 {
2111 return __builtin___snprintf_chk (__s, __n, 2 - 1,
2112 __builtin_object_size (__s, 2 > 1), __fmt, __builtin_va_arg_pack ());
2113 }
2114 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) int
2115 __attribute__ ((__nothrow__)) vsnprintf (char *__restrict __s, size_t __n, const char *__restrict __fmt, __gnuc_va_list __ap)
2116 {
2117 return __builtin___vsnprintf_chk (__s, __n, 2 - 1,
2118 __builtin_object_size (__s, 2 > 1), __fmt, __ap);
2119 }
2120 extern int __fprintf_chk (FILE *__restrict __stream, int __flag,
2121 const char *__restrict __format, ...);
2122 extern int __printf_chk (int __flag, const char *__restrict __format, ...);
2123 extern int __vfprintf_chk (FILE *__restrict __stream, int __flag,
2124 const char *__restrict __format, __gnuc_va_list __ap);
2125 extern int __vprintf_chk (int __flag, const char *__restrict __format,
2126 __gnuc_va_list __ap);
2127 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) int
2128 fprintf (FILE *__restrict __stream, const char *__restrict __fmt, ...)
2129 {
2130 return __fprintf_chk (__stream, 2 - 1, __fmt,
2131 __builtin_va_arg_pack ());
2132 }
2133 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) int
2134 printf (const char *__restrict __fmt, ...)
2135 {
2136 return __printf_chk (2 - 1, __fmt, __builtin_va_arg_pack ());
2137 }
2138 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) int
2139 vprintf (const char *__restrict __fmt, __gnuc_va_list __ap)
2140 {
2141 return __vfprintf_chk (stdout, 2 - 1, __fmt, __ap);
2142 }
2143 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) int
2144 vfprintf (FILE *__restrict __stream,
2145 const char *__restrict __fmt, __gnuc_va_list __ap)
2146 {
2147 return __vfprintf_chk (__stream, 2 - 1, __fmt, __ap);
2148 }
2149 extern int __asprintf_chk (char **__restrict __ptr, int __flag,
2150 const char *__restrict __fmt, ...)
2151 __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 3, 4))) __attribute__ ((__warn_unused_result__));
2152 extern int __vasprintf_chk (char **__restrict __ptr, int __flag,
2153 const char *__restrict __fmt, __gnuc_va_list __arg)
2154 __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 3, 0))) __attribute__ ((__warn_unused_result__));
2155 extern int __dprintf_chk (int __fd, int __flag, const char *__restrict __fmt,
2156 ...) __attribute__ ((__format__ (__printf__, 3, 4)));
2157 extern int __vdprintf_chk (int __fd, int __flag,
2158 const char *__restrict __fmt, __gnuc_va_list __arg)
2159 __attribute__ ((__format__ (__printf__, 3, 0)));
2160 extern int __obstack_printf_chk (struct obstack *__restrict __obstack,
2161 int __flag, const char *__restrict __format,
2162 ...)
2163 __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 3, 4)));
2164 extern int __obstack_vprintf_chk (struct obstack *__restrict __obstack,
2165 int __flag,
2166 const char *__restrict __format,
2167 __gnuc_va_list __args)
2168 __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 3, 0)));
2169 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) int
2170 __attribute__ ((__nothrow__)) asprintf (char **__restrict __ptr, const char *__restrict __fmt, ...)
2171 {
2172 return __asprintf_chk (__ptr, 2 - 1, __fmt,
2173 __builtin_va_arg_pack ());
2174 }
2175 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) int
2176 __attribute__ ((__nothrow__)) __asprintf (char **__restrict __ptr, const char *__restrict __fmt, ...)
2177 {
2178 return __asprintf_chk (__ptr, 2 - 1, __fmt,
2179 __builtin_va_arg_pack ());
2180 }
2181 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) int
2182 dprintf (int __fd, const char *__restrict __fmt, ...)
2183 {
2184 return __dprintf_chk (__fd, 2 - 1, __fmt,
2185 __builtin_va_arg_pack ());
2186 }
2187 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) int
2188 __attribute__ ((__nothrow__)) obstack_printf (struct obstack *__restrict __obstack, const char *__restrict __fmt, ...)
2189 {
2190 return __obstack_printf_chk (__obstack, 2 - 1, __fmt,
2191 __builtin_va_arg_pack ());
2192 }
2193 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) int
2194 __attribute__ ((__nothrow__)) vasprintf (char **__restrict __ptr, const char *__restrict __fmt, __gnuc_va_list __ap)
2195 {
2196 return __vasprintf_chk (__ptr, 2 - 1, __fmt, __ap);
2197 }
2198 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) int
2199 vdprintf (int __fd, const char *__restrict __fmt, __gnuc_va_list __ap)
2200 {
2201 return __vdprintf_chk (__fd, 2 - 1, __fmt, __ap);
2202 }
2203 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) int
2204 __attribute__ ((__nothrow__)) obstack_vprintf (struct obstack *__restrict __obstack, const char *__restrict __fmt, __gnuc_va_list __ap)
2205 {
2206 return __obstack_vprintf_chk (__obstack, 2 - 1, __fmt,
2207 __ap);
2208 }
2209 extern char *__gets_chk (char *__str, size_t) __attribute__ ((__warn_unused_result__));
2210 extern char *__gets_warn (char *__str) __asm__ ("" "gets")
2211 __attribute__ ((__warn_unused_result__)) __attribute__((__warning__ ("please use fgets or getline instead, gets can't " "specify buffer size")))
2212 ;
2213 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) __attribute__ ((__warn_unused_result__)) char *
2214 gets (char *__str)
2215 {
2216 if (__builtin_object_size (__str, 2 > 1) != (size_t) -1)
2217 return __gets_chk (__str, __builtin_object_size (__str, 2 > 1));
2218 return __gets_warn (__str);
2219 }
2220 extern char *__fgets_chk (char *__restrict __s, size_t __size, int __n,
2221 FILE *__restrict __stream) __attribute__ ((__warn_unused_result__));
2222 extern char *__fgets_alias (char *__restrict __s, int __n, FILE *__restrict __stream) __asm__ ("" "fgets")
2223 __attribute__ ((__warn_unused_result__));
2224 extern char *__fgets_chk_warn (char *__restrict __s, size_t __size, int __n, FILE *__restrict __stream) __asm__ ("" "__fgets_chk")
2225 __attribute__ ((__warn_unused_result__)) __attribute__((__warning__ ("fgets called with bigger size than length " "of destination buffer")))
2226 ;
2227 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) __attribute__ ((__warn_unused_result__)) char *
2228 fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
2229 {
2230 if (__builtin_object_size (__s, 2 > 1) != (size_t) -1)
2231 {
2232 if (!__builtin_constant_p (__n) || __n <= 0)
2233 return __fgets_chk (__s, __builtin_object_size (__s, 2 > 1), __n, __stream);
2234 if ((size_t) __n > __builtin_object_size (__s, 2 > 1))
2235 return __fgets_chk_warn (__s, __builtin_object_size (__s, 2 > 1), __n, __stream);
2236 }
2237 return __fgets_alias (__s, __n, __stream);
2238 }
2239 extern size_t __fread_chk (void *__restrict __ptr, size_t __ptrlen,
2240 size_t __size, size_t __n,
2241 FILE *__restrict __stream) __attribute__ ((__warn_unused_result__));
2242 extern size_t __fread_alias (void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __stream) __asm__ ("" "fread")
2243 __attribute__ ((__warn_unused_result__));
2244 extern size_t __fread_chk_warn (void *__restrict __ptr, size_t __ptrlen, size_t __size, size_t __n, FILE *__restrict __stream) __asm__ ("" "__fread_chk")
2245 __attribute__ ((__warn_unused_result__)) __attribute__((__warning__ ("fread called with bigger size * nmemb than length " "of destination buffer")))
2246 ;
2247 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) __attribute__ ((__warn_unused_result__)) size_t
2248 fread (void *__restrict __ptr, size_t __size, size_t __n,
2249 FILE *__restrict __stream)
2250 {
2251 if (__builtin_object_size (__ptr, 0) != (size_t) -1)
2252 {
2253 if (!__builtin_constant_p (__size)
2254 || !__builtin_constant_p (__n)
2255 || (__size | __n) >= (((size_t) 1) << (8 * sizeof (size_t) / 2)))
2256 return __fread_chk (__ptr, __builtin_object_size (__ptr, 0), __size, __n, __stream);
2257 if (__size * __n > __builtin_object_size (__ptr, 0))
2258 return __fread_chk_warn (__ptr, __builtin_object_size (__ptr, 0), __size, __n, __stream);
2259 }
2260 return __fread_alias (__ptr, __size, __n, __stream);
2261 }
2262 extern char *__fgets_unlocked_chk (char *__restrict __s, size_t __size,
2263 int __n, FILE *__restrict __stream) __attribute__ ((__warn_unused_result__));
2264 extern char *__fgets_unlocked_alias (char *__restrict __s, int __n, FILE *__restrict __stream) __asm__ ("" "fgets_unlocked")
2265 __attribute__ ((__warn_unused_result__));
2266 extern char *__fgets_unlocked_chk_warn (char *__restrict __s, size_t __size, int __n, FILE *__restrict __stream) __asm__ ("" "__fgets_unlocked_chk")
2267 __attribute__ ((__warn_unused_result__)) __attribute__((__warning__ ("fgets_unlocked called with bigger size than length " "of destination buffer")))
2268 ;
2269 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) __attribute__ ((__warn_unused_result__)) char *
2270 fgets_unlocked (char *__restrict __s, int __n, FILE *__restrict __stream)
2271 {
2272 if (__builtin_object_size (__s, 2 > 1) != (size_t) -1)
2273 {
2274 if (!__builtin_constant_p (__n) || __n <= 0)
2275 return __fgets_unlocked_chk (__s, __builtin_object_size (__s, 2 > 1), __n, __stream);
2276 if ((size_t) __n > __builtin_object_size (__s, 2 > 1))
2277 return __fgets_unlocked_chk_warn (__s, __builtin_object_size (__s, 2 > 1), __n, __stream);
2278 }
2279 return __fgets_unlocked_alias (__s, __n, __stream);
2280 }
2281 extern size_t __fread_unlocked_chk (void *__restrict __ptr, size_t __ptrlen,
2282 size_t __size, size_t __n,
2283 FILE *__restrict __stream) __attribute__ ((__warn_unused_result__));
2284 extern size_t __fread_unlocked_alias (void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __stream) __asm__ ("" "fread_unlocked")
2285 __attribute__ ((__warn_unused_result__));
2286 extern size_t __fread_unlocked_chk_warn (void *__restrict __ptr, size_t __ptrlen, size_t __size, size_t __n, FILE *__restrict __stream) __asm__ ("" "__fread_unlocked_chk")
2287 __attribute__ ((__warn_unused_result__)) __attribute__((__warning__ ("fread_unlocked called with bigger size * nmemb than " "length of destination buffer")))
2288 ;
2289 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) __attribute__ ((__warn_unused_result__)) size_t
2290 fread_unlocked (void *__restrict __ptr, size_t __size, size_t __n,
2291 FILE *__restrict __stream)
2292 {
2293 if (__builtin_object_size (__ptr, 0) != (size_t) -1)
2294 {
2295 if (!__builtin_constant_p (__size)
2296 || !__builtin_constant_p (__n)
2297 || (__size | __n) >= (((size_t) 1) << (8 * sizeof (size_t) / 2)))
2298 return __fread_unlocked_chk (__ptr, __builtin_object_size (__ptr, 0), __size, __n,
2299 __stream);
2300 if (__size * __n > __builtin_object_size (__ptr, 0))
2301 return __fread_unlocked_chk_warn (__ptr, __builtin_object_size (__ptr, 0), __size, __n,
2302 __stream);
2303 }
2304 if (__builtin_constant_p (__size)
2305 && __builtin_constant_p (__n)
2306 && (__size | __n) < (((size_t) 1) << (8 * sizeof (size_t) / 2))
2307 && __size * __n <= 8)
2308 {
2309 size_t __cnt = __size * __n;
2310 char *__cptr = (char *) __ptr;
2311 if (__cnt == 0)
2312 return 0;
2313 for (; __cnt > 0; --__cnt)
2314 {
2315 int __c = (__builtin_expect (((__stream)->_IO_read_ptr >= (__stream)->_IO_read_end), 0) ? __uflow (__stream) : *(unsigned char *) (__stream)->_IO_read_ptr++);
2316 if (__c == (-1))
2317 break;
2318 *__cptr++ = __c;
2319 }
2320 return (__cptr - (char *) __ptr) / __size;
2321 }
2322 return __fread_unlocked_alias (__ptr, __size, __n, __stream);
2323 }
2324 typedef int wchar_t;
2325 union wait
2326 {
2327 int w_status;
2328 struct
2329 {
2330 unsigned int __w_termsig:7;
2331 unsigned int __w_coredump:1;
2332 unsigned int __w_retcode:8;
2333 unsigned int:16;
2334 } __wait_terminated;
2335 struct
2336 {
2337 unsigned int __w_stopval:8;
2338 unsigned int __w_stopsig:8;
2339 unsigned int:16;
2340 } __wait_stopped;
2341 };
2342 typedef union
2343 {
2344 union wait *__uptr;
2345 int *__iptr;
2346 } __WAIT_STATUS __attribute__ ((__transparent_union__));
2347 typedef struct
2348 {
2349 int quot;
2350 int rem;
2351 } div_t;
2352 typedef struct
2353 {
2354 long int quot;
2355 long int rem;
2356 } ldiv_t;
2357 __extension__ typedef struct
2358 {
2359 long long int quot;
2360 long long int rem;
2361 } lldiv_t;
2362 extern size_t __ctype_get_mb_cur_max (void) __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__));
2363 extern double atof (const char *__nptr)
2364 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
2365 extern int atoi (const char *__nptr)
2366 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
2367 extern long int atol (const char *__nptr)
2368 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
2369 __extension__ extern long long int atoll (const char *__nptr)
2370 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
2371 extern double strtod (const char *__restrict __nptr,
2372 char **__restrict __endptr)
2373 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
2374 extern float strtof (const char *__restrict __nptr,
2375 char **__restrict __endptr) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
2376 extern long double strtold (const char *__restrict __nptr,
2377 char **__restrict __endptr)
2378 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
2379 extern long int strtol (const char *__restrict __nptr,
2380 char **__restrict __endptr, int __base)
2381 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
2382 extern unsigned long int strtoul (const char *__restrict __nptr,
2383 char **__restrict __endptr, int __base)
2384 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
2385 __extension__
2386 extern long long int strtoq (const char *__restrict __nptr,
2387 char **__restrict __endptr, int __base)
2388 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
2389 __extension__
2390 extern unsigned long long int strtouq (const char *__restrict __nptr,
2391 char **__restrict __endptr, int __base)
2392 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
2393 __extension__
2394 extern long long int strtoll (const char *__restrict __nptr,
2395 char **__restrict __endptr, int __base)
2396 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
2397 __extension__
2398 extern unsigned long long int strtoull (const char *__restrict __nptr,
2399 char **__restrict __endptr, int __base)
2400 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
2401 extern long int strtol_l (const char *__restrict __nptr,
2402 char **__restrict __endptr, int __base,
2403 __locale_t __loc) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 4))) __attribute__ ((__warn_unused_result__));
2404 extern unsigned long int strtoul_l (const char *__restrict __nptr,
2405 char **__restrict __endptr,
2406 int __base, __locale_t __loc)
2407 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 4))) __attribute__ ((__warn_unused_result__));
2408 __extension__
2409 extern long long int strtoll_l (const char *__restrict __nptr,
2410 char **__restrict __endptr, int __base,
2411 __locale_t __loc)
2412 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 4))) __attribute__ ((__warn_unused_result__));
2413 __extension__
2414 extern unsigned long long int strtoull_l (const char *__restrict __nptr,
2415 char **__restrict __endptr,
2416 int __base, __locale_t __loc)
2417 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 4))) __attribute__ ((__warn_unused_result__));
2418 extern double strtod_l (const char *__restrict __nptr,
2419 char **__restrict __endptr, __locale_t __loc)
2420 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 3))) __attribute__ ((__warn_unused_result__));
2421 extern float strtof_l (const char *__restrict __nptr,
2422 char **__restrict __endptr, __locale_t __loc)
2423 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 3))) __attribute__ ((__warn_unused_result__));
2424 extern long double strtold_l (const char *__restrict __nptr,
2425 char **__restrict __endptr,
2426 __locale_t __loc)
2427 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 3))) __attribute__ ((__warn_unused_result__));
2428 extern __inline __attribute__ ((__gnu_inline__)) double
2429 __attribute__ ((__nothrow__)) atof (const char *__nptr)
2430 {
2431 return strtod (__nptr, (char **) ((void *)0));
2432 }
2433 extern __inline __attribute__ ((__gnu_inline__)) int
2434 __attribute__ ((__nothrow__)) atoi (const char *__nptr)
2435 {
2436 return (int) strtol (__nptr, (char **) ((void *)0), 10);
2437 }
2438 extern __inline __attribute__ ((__gnu_inline__)) long int
2439 __attribute__ ((__nothrow__)) atol (const char *__nptr)
2440 {
2441 return strtol (__nptr, (char **) ((void *)0), 10);
2442 }
2443 __extension__ extern __inline __attribute__ ((__gnu_inline__)) long long int
2444 __attribute__ ((__nothrow__)) atoll (const char *__nptr)
2445 {
2446 return strtoll (__nptr, (char **) ((void *)0), 10);
2447 }
2448 extern char *l64a (long int __n) __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__));
2449 extern long int a64l (const char *__s)
2450 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
2451 extern long int random (void) __attribute__ ((__nothrow__));
2452 extern void srandom (unsigned int __seed) __attribute__ ((__nothrow__));
2453 extern char *initstate (unsigned int __seed, char *__statebuf,
2454 size_t __statelen) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));
2455 extern char *setstate (char *__statebuf) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2456 struct random_data
2457 {
2458 int32_t *fptr;
2459 int32_t *rptr;
2460 int32_t *state;
2461 int rand_type;
2462 int rand_deg;
2463 int rand_sep;
2464 int32_t *end_ptr;
2465 };
2466 extern int random_r (struct random_data *__restrict __buf,
2467 int32_t *__restrict __result) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
2468 extern int srandom_r (unsigned int __seed, struct random_data *__buf)
2469 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));
2470 extern int initstate_r (unsigned int __seed, char *__restrict __statebuf,
2471 size_t __statelen,
2472 struct random_data *__restrict __buf)
2473 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 4)));
2474 extern int setstate_r (char *__restrict __statebuf,
2475 struct random_data *__restrict __buf)
2476 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
2477 extern int rand (void) __attribute__ ((__nothrow__));
2478 extern void srand (unsigned int __seed) __attribute__ ((__nothrow__));
2479 extern int rand_r (unsigned int *__seed) __attribute__ ((__nothrow__));
2480 extern double drand48 (void) __attribute__ ((__nothrow__));
2481 extern double erand48 (unsigned short int __xsubi[3]) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2482 extern long int lrand48 (void) __attribute__ ((__nothrow__));
2483 extern long int nrand48 (unsigned short int __xsubi[3])
2484 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2485 extern long int mrand48 (void) __attribute__ ((__nothrow__));
2486 extern long int jrand48 (unsigned short int __xsubi[3])
2487 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2488 extern void srand48 (long int __seedval) __attribute__ ((__nothrow__));
2489 extern unsigned short int *seed48 (unsigned short int __seed16v[3])
2490 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2491 extern void lcong48 (unsigned short int __param[7]) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2492 struct drand48_data
2493 {
2494 unsigned short int __x[3];
2495 unsigned short int __old_x[3];
2496 unsigned short int __c;
2497 unsigned short int __init;
2498 unsigned long long int __a;
2499 };
2500 extern int drand48_r (struct drand48_data *__restrict __buffer,
2501 double *__restrict __result) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
2502 extern int erand48_r (unsigned short int __xsubi[3],
2503 struct drand48_data *__restrict __buffer,
2504 double *__restrict __result) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
2505 extern int lrand48_r (struct drand48_data *__restrict __buffer,
2506 long int *__restrict __result)
2507 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
2508 extern int nrand48_r (unsigned short int __xsubi[3],
2509 struct drand48_data *__restrict __buffer,
2510 long int *__restrict __result)
2511 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
2512 extern int mrand48_r (struct drand48_data *__restrict __buffer,
2513 long int *__restrict __result)
2514 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
2515 extern int jrand48_r (unsigned short int __xsubi[3],
2516 struct drand48_data *__restrict __buffer,
2517 long int *__restrict __result)
2518 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
2519 extern int srand48_r (long int __seedval, struct drand48_data *__buffer)
2520 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));
2521 extern int seed48_r (unsigned short int __seed16v[3],
2522 struct drand48_data *__buffer) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
2523 extern int lcong48_r (unsigned short int __param[7],
2524 struct drand48_data *__buffer)
2525 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
2526 extern void *malloc (size_t __size) __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) __attribute__ ((__warn_unused_result__));
2527 extern void *calloc (size_t __nmemb, size_t __size)
2528 __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) __attribute__ ((__warn_unused_result__));
2529 extern void *realloc (void *__ptr, size_t __size)
2530 __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__));
2531 extern void free (void *__ptr) __attribute__ ((__nothrow__));
2532 extern void cfree (void *__ptr) __attribute__ ((__nothrow__));
2533 extern void *alloca (size_t __size) __attribute__ ((__nothrow__));
2534 extern void *valloc (size_t __size) __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) __attribute__ ((__warn_unused_result__));
2535 extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size)
2536 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
2537 extern void abort (void) __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));
2538 extern int atexit (void (*__func) (void)) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2539 extern int at_quick_exit (void (*__func) (void)) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2540 extern int on_exit (void (*__func) (int __status, void *__arg), void *__arg)
2541 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2542 extern void exit (int __status) __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));
2543 extern void quick_exit (int __status) __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));
2544 extern void _Exit (int __status) __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));
2545 extern char *getenv (const char *__name) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
2546 extern char *__secure_getenv (const char *__name)
2547 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
2548 extern int putenv (char *__string) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2549 extern int setenv (const char *__name, const char *__value, int __replace)
2550 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));
2551 extern int unsetenv (const char *__name) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2552 extern int clearenv (void) __attribute__ ((__nothrow__));
2553 extern char *mktemp (char *__template) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
2554 extern int mkstemp (char *__template) __asm__ ("" "mkstemp64")
2555 __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
2556 extern int mkstemp64 (char *__template) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
2557 extern int mkstemps (char *__template, int __suffixlen) __asm__ ("" "mkstemps64")
2558 __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
2559 extern int mkstemps64 (char *__template, int __suffixlen)
2560 __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
2561 extern char *mkdtemp (char *__template) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
2562 extern int mkostemp (char *__template, int __flags) __asm__ ("" "mkostemp64")
2563 __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
2564 extern int mkostemp64 (char *__template, int __flags) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
2565 extern int mkostemps (char *__template, int __suffixlen, int __flags) __asm__ ("" "mkostemps64")
2566 __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
2567 extern int mkostemps64 (char *__template, int __suffixlen, int __flags)
2568 __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
2569 extern int system (const char *__command) __attribute__ ((__warn_unused_result__));
2570 extern char *canonicalize_file_name (const char *__name)
2571 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
2572 extern char *realpath (const char *__restrict __name,
2573 char *__restrict __resolved) __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__));
2574 typedef int (*__compar_fn_t) (const void *, const void *);
2575 typedef __compar_fn_t comparison_fn_t;
2576 typedef int (*__compar_d_fn_t) (const void *, const void *, void *);
2577 extern void *bsearch (const void *__key, const void *__base,
2578 size_t __nmemb, size_t __size, __compar_fn_t __compar)
2579 __attribute__ ((__nonnull__ (1, 2, 5))) __attribute__ ((__warn_unused_result__));
2580 extern void qsort (void *__base, size_t __nmemb, size_t __size,
2581 __compar_fn_t __compar) __attribute__ ((__nonnull__ (1, 4)));
2582 extern void qsort_r (void *__base, size_t __nmemb, size_t __size,
2583 __compar_d_fn_t __compar, void *__arg)
2584 __attribute__ ((__nonnull__ (1, 4)));
2585 extern int abs (int __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)) __attribute__ ((__warn_unused_result__));
2586 extern long int labs (long int __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)) __attribute__ ((__warn_unused_result__));
2587 __extension__ extern long long int llabs (long long int __x)
2588 __attribute__ ((__nothrow__)) __attribute__ ((__const__)) __attribute__ ((__warn_unused_result__));
2589 extern div_t div (int __numer, int __denom)
2590 __attribute__ ((__nothrow__)) __attribute__ ((__const__)) __attribute__ ((__warn_unused_result__));
2591 extern ldiv_t ldiv (long int __numer, long int __denom)
2592 __attribute__ ((__nothrow__)) __attribute__ ((__const__)) __attribute__ ((__warn_unused_result__));
2593 __extension__ extern lldiv_t lldiv (long long int __numer,
2594 long long int __denom)
2595 __attribute__ ((__nothrow__)) __attribute__ ((__const__)) __attribute__ ((__warn_unused_result__));
2596 extern char *ecvt (double __value, int __ndigit, int *__restrict __decpt,
2597 int *__restrict __sign) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4))) __attribute__ ((__warn_unused_result__));
2598 extern char *fcvt (double __value, int __ndigit, int *__restrict __decpt,
2599 int *__restrict __sign) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4))) __attribute__ ((__warn_unused_result__));
2600 extern char *gcvt (double __value, int __ndigit, char *__buf)
2601 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3))) __attribute__ ((__warn_unused_result__));
2602 extern char *qecvt (long double __value, int __ndigit,
2603 int *__restrict __decpt, int *__restrict __sign)
2604 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4))) __attribute__ ((__warn_unused_result__));
2605 extern char *qfcvt (long double __value, int __ndigit,
2606 int *__restrict __decpt, int *__restrict __sign)
2607 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4))) __attribute__ ((__warn_unused_result__));
2608 extern char *qgcvt (long double __value, int __ndigit, char *__buf)
2609 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3))) __attribute__ ((__warn_unused_result__));
2610 extern int ecvt_r (double __value, int __ndigit, int *__restrict __decpt,
2611 int *__restrict __sign, char *__restrict __buf,
2612 size_t __len) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4, 5)));
2613 extern int fcvt_r (double __value, int __ndigit, int *__restrict __decpt,
2614 int *__restrict __sign, char *__restrict __buf,
2615 size_t __len) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4, 5)));
2616 extern int qecvt_r (long double __value, int __ndigit,
2617 int *__restrict __decpt, int *__restrict __sign,
2618 char *__restrict __buf, size_t __len)
2619 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4, 5)));
2620 extern int qfcvt_r (long double __value, int __ndigit,
2621 int *__restrict __decpt, int *__restrict __sign,
2622 char *__restrict __buf, size_t __len)
2623 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4, 5)));
2624 extern int mblen (const char *__s, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__));
2625 extern int mbtowc (wchar_t *__restrict __pwc,
2626 const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__));
2627 extern int wctomb (char *__s, wchar_t __wchar) __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__));
2628 extern size_t mbstowcs (wchar_t *__restrict __pwcs,
2629 const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__));
2630 extern size_t wcstombs (char *__restrict __s,
2631 const wchar_t *__restrict __pwcs, size_t __n)
2632 __attribute__ ((__nothrow__));
2633 extern int rpmatch (const char *__response) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
2634 extern int getsubopt (char **__restrict __optionp,
2635 char *const *__restrict __tokens,
2636 char **__restrict __valuep)
2637 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2, 3))) __attribute__ ((__warn_unused_result__));
2638 extern void setkey (const char *__key) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2639 extern int posix_openpt (int __oflag) __attribute__ ((__warn_unused_result__));
2640 extern int grantpt (int __fd) __attribute__ ((__nothrow__));
2641 extern int unlockpt (int __fd) __attribute__ ((__nothrow__));
2642 extern char *ptsname (int __fd) __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__));
2643 extern int ptsname_r (int __fd, char *__buf, size_t __buflen)
2644 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));
2645 extern int getpt (void);
2646 extern int getloadavg (double __loadavg[], int __nelem)
2647 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2648 extern char *__realpath_chk (const char *__restrict __name,
2649 char *__restrict __resolved,
2650 size_t __resolvedlen) __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__));
2651 extern char *__realpath_alias (const char *__restrict __name, char *__restrict __resolved) __asm__ ("" "realpath") __attribute__ ((__nothrow__))
2652 __attribute__ ((__warn_unused_result__));
2653 extern char *__realpath_chk_warn (const char *__restrict __name, char *__restrict __resolved, size_t __resolvedlen) __asm__ ("" "__realpath_chk") __attribute__ ((__nothrow__))
2654 __attribute__ ((__warn_unused_result__))
2655 __attribute__((__warning__ ("second argument of realpath must be either NULL or at " "least PATH_MAX bytes long buffer")))
2656 ;
2657 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) __attribute__ ((__warn_unused_result__)) char *
2658 __attribute__ ((__nothrow__)) realpath (const char *__restrict __name, char *__restrict __resolved)
2659 {
2660 if (__builtin_object_size (__resolved, 2 > 1) != (size_t) -1)
2661 {
2662 if (__builtin_object_size (__resolved, 2 > 1) < 4096)
2663 return __realpath_chk_warn (__name, __resolved, __builtin_object_size (__resolved, 2 > 1));
2664 return __realpath_chk (__name, __resolved, __builtin_object_size (__resolved, 2 > 1));
2665 }
2666 return __realpath_alias (__name, __resolved);
2667 }
2668 extern int __ptsname_r_chk (int __fd, char *__buf, size_t __buflen,
2669 size_t __nreal) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));
2670 extern int __ptsname_r_alias (int __fd, char *__buf, size_t __buflen) __asm__ ("" "ptsname_r") __attribute__ ((__nothrow__))
2671 __attribute__ ((__nonnull__ (2)));
2672 extern int __ptsname_r_chk_warn (int __fd, char *__buf, size_t __buflen, size_t __nreal) __asm__ ("" "__ptsname_r_chk") __attribute__ ((__nothrow__))
2673 __attribute__ ((__nonnull__ (2))) __attribute__((__warning__ ("ptsname_r called with buflen bigger than " "size of buf")))
2674 ;
2675 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) int
2676 __attribute__ ((__nothrow__)) ptsname_r (int __fd, char *__buf, size_t __buflen)
2677 {
2678 if (__builtin_object_size (__buf, 2 > 1) != (size_t) -1)
2679 {
2680 if (!__builtin_constant_p (__buflen))
2681 return __ptsname_r_chk (__fd, __buf, __buflen, __builtin_object_size (__buf, 2 > 1));
2682 if (__buflen > __builtin_object_size (__buf, 2 > 1))
2683 return __ptsname_r_chk_warn (__fd, __buf, __buflen, __builtin_object_size (__buf, 2 > 1));
2684 }
2685 return __ptsname_r_alias (__fd, __buf, __buflen);
2686 }
2687 extern int __wctomb_chk (char *__s, wchar_t __wchar, size_t __buflen)
2688 __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__));
2689 extern int __wctomb_alias (char *__s, wchar_t __wchar) __asm__ ("" "wctomb") __attribute__ ((__nothrow__))
2690 __attribute__ ((__warn_unused_result__));
2691 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) __attribute__ ((__warn_unused_result__)) int
2692 __attribute__ ((__nothrow__)) wctomb (char *__s, wchar_t __wchar)
2693 {
2694 if (__builtin_object_size (__s, 2 > 1) != (size_t) -1 && 16 > __builtin_object_size (__s, 2 > 1))
2695 return __wctomb_chk (__s, __wchar, __builtin_object_size (__s, 2 > 1));
2696 return __wctomb_alias (__s, __wchar);
2697 }
2698 extern size_t __mbstowcs_chk (wchar_t *__restrict __dst,
2699 const char *__restrict __src,
2700 size_t __len, size_t __dstlen) __attribute__ ((__nothrow__));
2701 extern size_t __mbstowcs_alias (wchar_t *__restrict __dst, const char *__restrict __src, size_t __len) __asm__ ("" "mbstowcs") __attribute__ ((__nothrow__))
2702 ;
2703 extern size_t __mbstowcs_chk_warn (wchar_t *__restrict __dst, const char *__restrict __src, size_t __len, size_t __dstlen) __asm__ ("" "__mbstowcs_chk") __attribute__ ((__nothrow__))
2704 __attribute__((__warning__ ("mbstowcs called with dst buffer smaller than len " "* sizeof (wchar_t)")))
2705 ;
2706 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) size_t
2707 __attribute__ ((__nothrow__)) mbstowcs (wchar_t *__restrict __dst, const char *__restrict __src, size_t __len)
2708 {
2709 if (__builtin_object_size (__dst, 2 > 1) != (size_t) -1)
2710 {
2711 if (!__builtin_constant_p (__len))
2712 return __mbstowcs_chk (__dst, __src, __len,
2713 __builtin_object_size (__dst, 2 > 1) / sizeof (wchar_t));
2714 if (__len > __builtin_object_size (__dst, 2 > 1) / sizeof (wchar_t))
2715 return __mbstowcs_chk_warn (__dst, __src, __len,
2716 __builtin_object_size (__dst, 2 > 1) / sizeof (wchar_t));
2717 }
2718 return __mbstowcs_alias (__dst, __src, __len);
2719 }
2720 extern size_t __wcstombs_chk (char *__restrict __dst,
2721 const wchar_t *__restrict __src,
2722 size_t __len, size_t __dstlen) __attribute__ ((__nothrow__));
2723 extern size_t __wcstombs_alias (char *__restrict __dst, const wchar_t *__restrict __src, size_t __len) __asm__ ("" "wcstombs") __attribute__ ((__nothrow__))
2724 ;
2725 extern size_t __wcstombs_chk_warn (char *__restrict __dst, const wchar_t *__restrict __src, size_t __len, size_t __dstlen) __asm__ ("" "__wcstombs_chk") __attribute__ ((__nothrow__))
2726 __attribute__((__warning__ ("wcstombs called with dst buffer smaller than len")));
2727 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) size_t
2728 __attribute__ ((__nothrow__)) wcstombs (char *__restrict __dst, const wchar_t *__restrict __src, size_t __len)
2729 {
2730 if (__builtin_object_size (__dst, 2 > 1) != (size_t) -1)
2731 {
2732 if (!__builtin_constant_p (__len))
2733 return __wcstombs_chk (__dst, __src, __len, __builtin_object_size (__dst, 2 > 1));
2734 if (__len > __builtin_object_size (__dst, 2 > 1))
2735 return __wcstombs_chk_warn (__dst, __src, __len, __builtin_object_size (__dst, 2 > 1));
2736 }
2737 return __wcstombs_alias (__dst, __src, __len);
2738 }
2739 typedef long int ptrdiff_t;
2740 extern void *memcpy (void *__restrict __dest,
2741 const void *__restrict __src, size_t __n)
2742 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
2743 extern void *memmove (void *__dest, const void *__src, size_t __n)
2744 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
2745 extern void *memccpy (void *__restrict __dest, const void *__restrict __src,
2746 int __c, size_t __n)
2747 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
2748 extern void *memset (void *__s, int __c, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2749 extern int memcmp (const void *__s1, const void *__s2, size_t __n)
2750 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
2751 extern void *memchr (const void *__s, int __c, size_t __n)
2752 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
2753 extern void *rawmemchr (const void *__s, int __c)
2754 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
2755 extern void *memrchr (const void *__s, int __c, size_t __n)
2756 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
2757 extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
2758 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
2759 extern char *strncpy (char *__restrict __dest,
2760 const char *__restrict __src, size_t __n)
2761 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
2762 extern char *strcat (char *__restrict __dest, const char *__restrict __src)
2763 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
2764 extern char *strncat (char *__restrict __dest, const char *__restrict __src,
2765 size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
2766 extern int strcmp (const char *__s1, const char *__s2)
2767 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
2768 extern int strncmp (const char *__s1, const char *__s2, size_t __n)
2769 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
2770 extern int strcoll (const char *__s1, const char *__s2)
2771 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
2772 extern size_t strxfrm (char *__restrict __dest,
2773 const char *__restrict __src, size_t __n)
2774 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));
2775 extern int strcoll_l (const char *__s1, const char *__s2, __locale_t __l)
2776 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3)));
2777 extern size_t strxfrm_l (char *__dest, const char *__src, size_t __n,
2778 __locale_t __l) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 4)));
2779 extern char *strdup (const char *__s)
2780 __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1)));
2781 extern char *strndup (const char *__string, size_t __n)
2782 __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1)));
2783 extern char *strchr (const char *__s, int __c)
2784 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
2785 extern char *strrchr (const char *__s, int __c)
2786 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
2787 extern char *strchrnul (const char *__s, int __c)
2788 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
2789 extern size_t strcspn (const char *__s, const char *__reject)
2790 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
2791 extern size_t strspn (const char *__s, const char *__accept)
2792 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
2793 extern char *strpbrk (const char *__s, const char *__accept)
2794 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
2795 extern char *strstr (const char *__haystack, const char *__needle)
2796 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
2797 extern char *strtok (char *__restrict __s, const char *__restrict __delim)
2798 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));
2799 extern char *__strtok_r (char *__restrict __s,
2800 const char *__restrict __delim,
2801 char **__restrict __save_ptr)
2802 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 3)));
2803 extern char *strtok_r (char *__restrict __s, const char *__restrict __delim,
2804 char **__restrict __save_ptr)
2805 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 3)));
2806 extern char *strcasestr (const char *__haystack, const char *__needle)
2807 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
2808 extern void *memmem (const void *__haystack, size_t __haystacklen,
2809 const void *__needle, size_t __needlelen)
2810 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 3)));
2811 extern void *__mempcpy (void *__restrict __dest,
2812 const void *__restrict __src, size_t __n)
2813 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
2814 extern void *mempcpy (void *__restrict __dest,
2815 const void *__restrict __src, size_t __n)
2816 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
2817 extern size_t strlen (const char *__s)
2818 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
2819 extern size_t strnlen (const char *__string, size_t __maxlen)
2820 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
2821 extern char *strerror (int __errnum) __attribute__ ((__nothrow__));
2822 extern char *strerror_r (int __errnum, char *__buf, size_t __buflen)
2823 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));
2824 extern char *strerror_l (int __errnum, __locale_t __l) __attribute__ ((__nothrow__));
2825 extern void __bzero (void *__s, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2826 extern void bcopy (const void *__src, void *__dest, size_t __n)
2827 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
2828 extern void bzero (void *__s, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2829 extern int bcmp (const void *__s1, const void *__s2, size_t __n)
2830 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
2831 extern char *index (const char *__s, int __c)
2832 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
2833 extern char *rindex (const char *__s, int __c)
2834 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
2835 extern int ffs (int __i) __attribute__ ((__nothrow__)) __attribute__ ((__const__));
2836 extern int ffsl (long int __l) __attribute__ ((__nothrow__)) __attribute__ ((__const__));
2837 __extension__ extern int ffsll (long long int __ll)
2838 __attribute__ ((__nothrow__)) __attribute__ ((__const__));
2839 extern int strcasecmp (const char *__s1, const char *__s2)
2840 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
2841 extern int strncasecmp (const char *__s1, const char *__s2, size_t __n)
2842 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
2843 extern int strcasecmp_l (const char *__s1, const char *__s2,
2844 __locale_t __loc)
2845 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3)));
2846 extern int strncasecmp_l (const char *__s1, const char *__s2,
2847 size_t __n, __locale_t __loc)
2848 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 4)));
2849 extern char *strsep (char **__restrict __stringp,
2850 const char *__restrict __delim)
2851 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
2852 extern char *strsignal (int __sig) __attribute__ ((__nothrow__));
2853 extern char *__stpcpy (char *__restrict __dest, const char *__restrict __src)
2854 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
2855 extern char *stpcpy (char *__restrict __dest, const char *__restrict __src)
2856 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
2857 extern char *__stpncpy (char *__restrict __dest,
2858 const char *__restrict __src, size_t __n)
2859 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
2860 extern char *stpncpy (char *__restrict __dest,
2861 const char *__restrict __src, size_t __n)
2862 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
2863 extern int strverscmp (const char *__s1, const char *__s2)
2864 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
2865 extern char *strfry (char *__string) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2866 extern void *memfrob (void *__s, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2867 extern char *basename (const char *__filename) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2868 extern void *__rawmemchr (const void *__s, int __c);
2869 extern __inline __attribute__ ((__gnu_inline__)) size_t __strcspn_c1 (const char *__s, int __reject);
2870 extern __inline __attribute__ ((__gnu_inline__)) size_t
2871 __strcspn_c1 (const char *__s, int __reject)
2872 {
2873 register size_t __result = 0;
2874 while (__s[__result] != '\0' && __s[__result] != __reject)
2875 ++__result;
2876 return __result;
2877 }
2878 extern __inline __attribute__ ((__gnu_inline__)) size_t __strcspn_c2 (const char *__s, int __reject1,
2879 int __reject2);
2880 extern __inline __attribute__ ((__gnu_inline__)) size_t
2881 __strcspn_c2 (const char *__s, int __reject1, int __reject2)
2882 {
2883 register size_t __result = 0;
2884 while (__s[__result] != '\0' && __s[__result] != __reject1
2885 && __s[__result] != __reject2)
2886 ++__result;
2887 return __result;
2888 }
2889 extern __inline __attribute__ ((__gnu_inline__)) size_t __strcspn_c3 (const char *__s, int __reject1,
2890 int __reject2, int __reject3);
2891 extern __inline __attribute__ ((__gnu_inline__)) size_t
2892 __strcspn_c3 (const char *__s, int __reject1, int __reject2,
2893 int __reject3)
2894 {
2895 register size_t __result = 0;
2896 while (__s[__result] != '\0' && __s[__result] != __reject1
2897 && __s[__result] != __reject2 && __s[__result] != __reject3)
2898 ++__result;
2899 return __result;
2900 }
2901 extern __inline __attribute__ ((__gnu_inline__)) size_t __strspn_c1 (const char *__s, int __accept);
2902 extern __inline __attribute__ ((__gnu_inline__)) size_t
2903 __strspn_c1 (const char *__s, int __accept)
2904 {
2905 register size_t __result = 0;
2906 while (__s[__result] == __accept)
2907 ++__result;
2908 return __result;
2909 }
2910 extern __inline __attribute__ ((__gnu_inline__)) size_t __strspn_c2 (const char *__s, int __accept1,
2911 int __accept2);
2912 extern __inline __attribute__ ((__gnu_inline__)) size_t
2913 __strspn_c2 (const char *__s, int __accept1, int __accept2)
2914 {
2915 register size_t __result = 0;
2916 while (__s[__result] == __accept1 || __s[__result] == __accept2)
2917 ++__result;
2918 return __result;
2919 }
2920 extern __inline __attribute__ ((__gnu_inline__)) size_t __strspn_c3 (const char *__s, int __accept1,
2921 int __accept2, int __accept3);
2922 extern __inline __attribute__ ((__gnu_inline__)) size_t
2923 __strspn_c3 (const char *__s, int __accept1, int __accept2, int __accept3)
2924 {
2925 register size_t __result = 0;
2926 while (__s[__result] == __accept1 || __s[__result] == __accept2
2927 || __s[__result] == __accept3)
2928 ++__result;
2929 return __result;
2930 }
2931 extern __inline __attribute__ ((__gnu_inline__)) char *__strpbrk_c2 (const char *__s, int __accept1,
2932 int __accept2);
2933 extern __inline __attribute__ ((__gnu_inline__)) char *
2934 __strpbrk_c2 (const char *__s, int __accept1, int __accept2)
2935 {
2936 while (*__s != '\0' && *__s != __accept1 && *__s != __accept2)
2937 ++__s;
2938 return *__s == '\0' ? ((void *)0) : (char *) (size_t) __s;
2939 }
2940 extern __inline __attribute__ ((__gnu_inline__)) char *__strpbrk_c3 (const char *__s, int __accept1,
2941 int __accept2, int __accept3);
2942 extern __inline __attribute__ ((__gnu_inline__)) char *
2943 __strpbrk_c3 (const char *__s, int __accept1, int __accept2,
2944 int __accept3)
2945 {
2946 while (*__s != '\0' && *__s != __accept1 && *__s != __accept2
2947 && *__s != __accept3)
2948 ++__s;
2949 return *__s == '\0' ? ((void *)0) : (char *) (size_t) __s;
2950 }
2951 extern __inline __attribute__ ((__gnu_inline__)) char *__strtok_r_1c (char *__s, char __sep, char **__nextp);
2952 extern __inline __attribute__ ((__gnu_inline__)) char *
2953 __strtok_r_1c (char *__s, char __sep, char **__nextp)
2954 {
2955 char *__result;
2956 if (__s == ((void *)0))
2957 __s = *__nextp;
2958 while (*__s == __sep)
2959 ++__s;
2960 __result = ((void *)0);
2961 if (*__s != '\0')
2962 {
2963 __result = __s++;
2964 while (*__s != '\0')
2965 if (*__s++ == __sep)
2966 {
2967 __s[-1] = '\0';
2968 break;
2969 }
2970 }
2971 *__nextp = __s;
2972 return __result;
2973 }
2974 extern char *__strsep_g (char **__stringp, const char *__delim);
2975 extern __inline __attribute__ ((__gnu_inline__)) char *__strsep_1c (char **__s, char __reject);
2976 extern __inline __attribute__ ((__gnu_inline__)) char *
2977 __strsep_1c (char **__s, char __reject)
2978 {
2979 register char *__retval = *__s;
2980 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))
2981 *(*__s)++ = '\0';
2982 return __retval;
2983 }
2984 extern __inline __attribute__ ((__gnu_inline__)) char *__strsep_2c (char **__s, char __reject1, char __reject2);
2985 extern __inline __attribute__ ((__gnu_inline__)) char *
2986 __strsep_2c (char **__s, char __reject1, char __reject2)
2987 {
2988 register char *__retval = *__s;
2989 if (__retval != ((void *)0))
2990 {
2991 register char *__cp = __retval;
2992 while (1)
2993 {
2994 if (*__cp == '\0')
2995 {
2996 __cp = ((void *)0);
2997 break;
2998 }
2999 if (*__cp == __reject1 || *__cp == __reject2)
3000 {
3001 *__cp++ = '\0';
3002 break;
3003 }
3004 ++__cp;
3005 }
3006 *__s = __cp;
3007 }
3008 return __retval;
3009 }
3010 extern __inline __attribute__ ((__gnu_inline__)) char *__strsep_3c (char **__s, char __reject1, char __reject2,
3011 char __reject3);
3012 extern __inline __attribute__ ((__gnu_inline__)) char *
3013 __strsep_3c (char **__s, char __reject1, char __reject2, char __reject3)
3014 {
3015 register char *__retval = *__s;
3016 if (__retval != ((void *)0))
3017 {
3018 register char *__cp = __retval;
3019 while (1)
3020 {
3021 if (*__cp == '\0')
3022 {
3023 __cp = ((void *)0);
3024 break;
3025 }
3026 if (*__cp == __reject1 || *__cp == __reject2 || *__cp == __reject3)
3027 {
3028 *__cp++ = '\0';
3029 break;
3030 }
3031 ++__cp;
3032 }
3033 *__s = __cp;
3034 }
3035 return __retval;
3036 }
3037 extern char *__strdup (const char *__string) __attribute__ ((__nothrow__)) __attribute__ ((__malloc__));
3038 extern char *__strndup (const char *__string, size_t __n)
3039 __attribute__ ((__nothrow__)) __attribute__ ((__malloc__));
3040 extern void __warn_memset_zero_len (void) __attribute__((__warning__ ("memset used with constant zero length parameter; this could be due to transposed parameters")))
3041 ;
3042 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) void *
3043 __attribute__ ((__nothrow__)) memcpy (void *__restrict __dest, const void *__restrict __src, size_t __len)
3044 {
3045 return __builtin___memcpy_chk (__dest, __src, __len, __builtin_object_size (__dest, 0));
3046 }
3047 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) void *
3048 __attribute__ ((__nothrow__)) memmove (void *__dest, const void *__src, size_t __len)
3049 {
3050 return __builtin___memmove_chk (__dest, __src, __len, __builtin_object_size (__dest, 0));
3051 }
3052 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) void *
3053 __attribute__ ((__nothrow__)) mempcpy (void *__restrict __dest, const void *__restrict __src, size_t __len)
3054 {
3055 return __builtin___mempcpy_chk (__dest, __src, __len, __builtin_object_size (__dest, 0));
3056 }
3057 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) void *
3058 __attribute__ ((__nothrow__)) memset (void *__dest, int __ch, size_t __len)
3059 {
3060 if (__builtin_constant_p (__len) && __len == 0
3061 && (!__builtin_constant_p (__ch) || __ch != 0))
3062 {
3063 __warn_memset_zero_len ();
3064 return __dest;
3065 }
3066 return __builtin___memset_chk (__dest, __ch, __len, __builtin_object_size (__dest, 0));
3067 }
3068 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) void
3069 __attribute__ ((__nothrow__)) bcopy (const void *__src, void *__dest, size_t __len)
3070 {
3071 (void) __builtin___memmove_chk (__dest, __src, __len, __builtin_object_size (__dest, 0));
3072 }
3073 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) void
3074 __attribute__ ((__nothrow__)) bzero (void *__dest, size_t __len)
3075 {
3076 (void) __builtin___memset_chk (__dest, '\0', __len, __builtin_object_size (__dest, 0));
3077 }
3078 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) char *
3079 __attribute__ ((__nothrow__)) strcpy (char *__restrict __dest, const char *__restrict __src)
3080 {
3081 return __builtin___strcpy_chk (__dest, __src, __builtin_object_size (__dest, 2 > 1));
3082 }
3083 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) char *
3084 __attribute__ ((__nothrow__)) stpcpy (char *__restrict __dest, const char *__restrict __src)
3085 {
3086 return __builtin___stpcpy_chk (__dest, __src, __builtin_object_size (__dest, 2 > 1));
3087 }
3088 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) char *
3089 __attribute__ ((__nothrow__)) strncpy (char *__restrict __dest, const char *__restrict __src, size_t __len)
3090 {
3091 return __builtin___strncpy_chk (__dest, __src, __len, __builtin_object_size (__dest, 2 > 1));
3092 }
3093 extern char *__stpncpy_chk (char *__dest, const char *__src, size_t __n,
3094 size_t __destlen) __attribute__ ((__nothrow__));
3095 extern char *__stpncpy_alias (char *__dest, const char *__src, size_t __n) __asm__ ("" "stpncpy") __attribute__ ((__nothrow__))
3096 ;
3097 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) char *
3098 __attribute__ ((__nothrow__)) stpncpy (char *__dest, const char *__src, size_t __n)
3099 {
3100 if (__builtin_object_size (__dest, 2 > 1) != (size_t) -1
3101 && (!__builtin_constant_p (__n) || __n <= __builtin_object_size (__dest, 2 > 1)))
3102 return __stpncpy_chk (__dest, __src, __n, __builtin_object_size (__dest, 2 > 1));
3103 return __stpncpy_alias (__dest, __src, __n);
3104 }
3105 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) char *
3106 __attribute__ ((__nothrow__)) strcat (char *__restrict __dest, const char *__restrict __src)
3107 {
3108 return __builtin___strcat_chk (__dest, __src, __builtin_object_size (__dest, 2 > 1));
3109 }
3110 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) char *
3111 __attribute__ ((__nothrow__)) strncat (char *__restrict __dest, const char *__restrict __src, size_t __len)
3112 {
3113 return __builtin___strncat_chk (__dest, __src, __len, __builtin_object_size (__dest, 2 > 1));
3114 }
3115 typedef unsigned long int nfds_t;
3116 struct pollfd
3117 {
3118 int fd;
3119 short int events;
3120 short int revents;
3121 };
3122 extern int poll (struct pollfd *__fds, nfds_t __nfds, int __timeout);
3123 extern int ppoll (struct pollfd *__fds, nfds_t __nfds,
3124 const struct timespec *__timeout,
3125 const __sigset_t *__ss);
3126 struct winsize
3127 {
3128 unsigned short int ws_row;
3129 unsigned short int ws_col;
3130 unsigned short int ws_xpixel;
3131 unsigned short int ws_ypixel;
3132 };
3133 struct termio
3134 {
3135 unsigned short int c_iflag;
3136 unsigned short int c_oflag;
3137 unsigned short int c_cflag;
3138 unsigned short int c_lflag;
3139 unsigned char c_line;
3140 unsigned char c_cc[8];
3141 };
3142 extern int ioctl (int __fd, unsigned long int __request, ...) __attribute__ ((__nothrow__));
3143 extern void * mmap (void *__addr, size_t __len, int __prot, int __flags, int __fd, __off64_t __offset) __asm__ ("" "mmap64") __attribute__ ((__nothrow__))
3144 ;
3145 extern void *mmap64 (void *__addr, size_t __len, int __prot,
3146 int __flags, int __fd, __off64_t __offset) __attribute__ ((__nothrow__));
3147 extern int munmap (void *__addr, size_t __len) __attribute__ ((__nothrow__));
3148 extern int mprotect (void *__addr, size_t __len, int __prot) __attribute__ ((__nothrow__));
3149 extern int msync (void *__addr, size_t __len, int __flags);
3150 extern int madvise (void *__addr, size_t __len, int __advice) __attribute__ ((__nothrow__));
3151 extern int posix_madvise (void *__addr, size_t __len, int __advice) __attribute__ ((__nothrow__));
3152 extern int mlock (const void *__addr, size_t __len) __attribute__ ((__nothrow__));
3153 extern int munlock (const void *__addr, size_t __len) __attribute__ ((__nothrow__));
3154 extern int mlockall (int __flags) __attribute__ ((__nothrow__));
3155 extern int munlockall (void) __attribute__ ((__nothrow__));
3156 extern int mincore (void *__start, size_t __len, unsigned char *__vec)
3157 __attribute__ ((__nothrow__));
3158 extern void *mremap (void *__addr, size_t __old_len, size_t __new_len,
3159 int __flags, ...) __attribute__ ((__nothrow__));
3160 extern int remap_file_pages (void *__start, size_t __size, int __prot,
3161 size_t __pgoff, int __flags) __attribute__ ((__nothrow__));
3162 extern int shm_open (const char *__name, int __oflag, mode_t __mode);
3163 extern int shm_unlink (const char *__name);
3164 extern int stat (const char *__restrict __file, struct stat *__restrict __buf) __asm__ ("" "stat64") __attribute__ ((__nothrow__))
3165 __attribute__ ((__nonnull__ (1, 2)));
3166 extern int fstat (int __fd, struct stat *__buf) __asm__ ("" "fstat64") __attribute__ ((__nothrow__))
3167 __attribute__ ((__nonnull__ (2)));
3168 extern int stat64 (const char *__restrict __file,
3169 struct stat64 *__restrict __buf) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
3170 extern int fstat64 (int __fd, struct stat64 *__buf) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));
3171 extern int fstatat (int __fd, const char *__restrict __file, struct stat *__restrict __buf, int __flag) __asm__ ("" "fstatat64") __attribute__ ((__nothrow__))
3172 __attribute__ ((__nonnull__ (2, 3)));
3173 extern int fstatat64 (int __fd, const char *__restrict __file,
3174 struct stat64 *__restrict __buf, int __flag)
3175 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 3)));
3176 extern int lstat (const char *__restrict __file, struct stat *__restrict __buf) __asm__ ("" "lstat64") __attribute__ ((__nothrow__))
3177 __attribute__ ((__nonnull__ (1, 2)));
3178 extern int lstat64 (const char *__restrict __file,
3179 struct stat64 *__restrict __buf)
3180 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
3181 extern int chmod (const char *__file, __mode_t __mode)
3182 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
3183 extern int lchmod (const char *__file, __mode_t __mode)
3184 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
3185 extern int fchmod (int __fd, __mode_t __mode) __attribute__ ((__nothrow__));
3186 extern int fchmodat (int __fd, const char *__file, __mode_t __mode,
3187 int __flag)
3188 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2))) __attribute__ ((__warn_unused_result__));
3189 extern __mode_t umask (__mode_t __mask) __attribute__ ((__nothrow__));
3190 extern __mode_t getumask (void) __attribute__ ((__nothrow__));
3191 extern int mkdir (const char *__path, __mode_t __mode)
3192 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
3193 extern int mkdirat (int __fd, const char *__path, __mode_t __mode)
3194 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));
3195 extern int mknod (const char *__path, __mode_t __mode, __dev_t __dev)
3196 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
3197 extern int mknodat (int __fd, const char *__path, __mode_t __mode,
3198 __dev_t __dev) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));
3199 extern int mkfifo (const char *__path, __mode_t __mode)
3200 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
3201 extern int mkfifoat (int __fd, const char *__path, __mode_t __mode)
3202 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));
3203 extern int utimensat (int __fd, const char *__path,
3204 const struct timespec __times[2],
3205 int __flags)
3206 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));
3207 extern int futimens (int __fd, const struct timespec __times[2]) __attribute__ ((__nothrow__));
3208 extern int __fxstat (int __ver, int __fildes, struct stat *__stat_buf) __asm__ ("" "__fxstat64") __attribute__ ((__nothrow__))
3209 __attribute__ ((__nonnull__ (3)));
3210 extern int __xstat (int __ver, const char *__filename, struct stat *__stat_buf) __asm__ ("" "__xstat64") __attribute__ ((__nothrow__))
3211 __attribute__ ((__nonnull__ (2, 3)));
3212 extern int __lxstat (int __ver, const char *__filename, struct stat *__stat_buf) __asm__ ("" "__lxstat64") __attribute__ ((__nothrow__))
3213 __attribute__ ((__nonnull__ (2, 3)));
3214 extern int __fxstatat (int __ver, int __fildes, const char *__filename, struct stat *__stat_buf, int __flag) __asm__ ("" "__fxstatat64") __attribute__ ((__nothrow__))
3215 __attribute__ ((__nonnull__ (3, 4)));
3216 extern int __fxstat64 (int __ver, int __fildes, struct stat64 *__stat_buf)
3217 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3)));
3218 extern int __xstat64 (int __ver, const char *__filename,
3219 struct stat64 *__stat_buf) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 3)));
3220 extern int __lxstat64 (int __ver, const char *__filename,
3221 struct stat64 *__stat_buf) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 3)));
3222 extern int __fxstatat64 (int __ver, int __fildes, const char *__filename,
3223 struct stat64 *__stat_buf, int __flag)
3224 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4)));
3225 extern int __xmknod (int __ver, const char *__path, __mode_t __mode,
3226 __dev_t *__dev) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 4)));
3227 extern int __xmknodat (int __ver, int __fd, const char *__path,
3228 __mode_t __mode, __dev_t *__dev)
3229 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 5)));
3230 extern __inline __attribute__ ((__gnu_inline__)) int
3231 __attribute__ ((__nothrow__)) stat (const char *__path, struct stat *__statbuf)
3232 {
3233 return __xstat (1, __path, __statbuf);
3234 }
3235 extern __inline __attribute__ ((__gnu_inline__)) int
3236 __attribute__ ((__nothrow__)) lstat (const char *__path, struct stat *__statbuf)
3237 {
3238 return __lxstat (1, __path, __statbuf);
3239 }
3240 extern __inline __attribute__ ((__gnu_inline__)) int
3241 __attribute__ ((__nothrow__)) fstat (int __fd, struct stat *__statbuf)
3242 {
3243 return __fxstat (1, __fd, __statbuf);
3244 }
3245 extern __inline __attribute__ ((__gnu_inline__)) int
3246 __attribute__ ((__nothrow__)) fstatat (int __fd, const char *__filename, struct stat *__statbuf, int __flag)
3247 {
3248 return __fxstatat (1, __fd, __filename, __statbuf, __flag);
3249 }
3250 extern __inline __attribute__ ((__gnu_inline__)) int
3251 __attribute__ ((__nothrow__)) mknod (const char *__path, __mode_t __mode, __dev_t __dev)
3252 {
3253 return __xmknod (0, __path, __mode, &__dev);
3254 }
3255 extern __inline __attribute__ ((__gnu_inline__)) int
3256 __attribute__ ((__nothrow__)) mknodat (int __fd, const char *__path, __mode_t __mode, __dev_t __dev)
3257 {
3258 return __xmknodat (0, __fd, __path, __mode, &__dev);
3259 }
3260 extern __inline __attribute__ ((__gnu_inline__)) int
3261 __attribute__ ((__nothrow__)) stat64 (const char *__path, struct stat64 *__statbuf)
3262 {
3263 return __xstat64 (1, __path, __statbuf);
3264 }
3265 extern __inline __attribute__ ((__gnu_inline__)) int
3266 __attribute__ ((__nothrow__)) lstat64 (const char *__path, struct stat64 *__statbuf)
3267 {
3268 return __lxstat64 (1, __path, __statbuf);
3269 }
3270 extern __inline __attribute__ ((__gnu_inline__)) int
3271 __attribute__ ((__nothrow__)) fstat64 (int __fd, struct stat64 *__statbuf)
3272 {
3273 return __fxstat64 (1, __fd, __statbuf);
3274 }
3275 extern __inline __attribute__ ((__gnu_inline__)) int
3276 __attribute__ ((__nothrow__)) fstatat64 (int __fd, const char *__filename, struct stat64 *__statbuf, int __flag)
3277 {
3278 return __fxstatat64 (1, __fd, __filename, __statbuf, __flag);
3279 }
3280 struct timezone
3281 {
3282 int tz_minuteswest;
3283 int tz_dsttime;
3284 };
3285 typedef struct timezone *__restrict __timezone_ptr_t;
3286 extern int gettimeofday (struct timeval *__restrict __tv,
3287 __timezone_ptr_t __tz) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
3288 extern int settimeofday (const struct timeval *__tv,
3289 const struct timezone *__tz)
3290 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
3291 extern int adjtime (const struct timeval *__delta,
3292 struct timeval *__olddelta) __attribute__ ((__nothrow__));
3293 enum __itimer_which
3294 {
3295 ITIMER_REAL = 0,
3296 ITIMER_VIRTUAL = 1,
3297 ITIMER_PROF = 2
3298 };
3299 struct itimerval
3300 {
3301 struct timeval it_interval;
3302 struct timeval it_value;
3303 };
3304 typedef enum __itimer_which __itimer_which_t;
3305 extern int getitimer (__itimer_which_t __which,
3306 struct itimerval *__value) __attribute__ ((__nothrow__));
3307 extern int setitimer (__itimer_which_t __which,
3308 const struct itimerval *__restrict __new,
3309 struct itimerval *__restrict __old) __attribute__ ((__nothrow__));
3310 extern int utimes (const char *__file, const struct timeval __tvp[2])
3311 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
3312 extern int lutimes (const char *__file, const struct timeval __tvp[2])
3313 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
3314 extern int futimes (int __fd, const struct timeval __tvp[2]) __attribute__ ((__nothrow__));
3315 extern int futimesat (int __fd, const char *__file,
3316 const struct timeval __tvp[2]) __attribute__ ((__nothrow__));
3317 enum __rlimit_resource
3318 {
3319 RLIMIT_CPU = 0,
3320 RLIMIT_FSIZE = 1,
3321 RLIMIT_DATA = 2,
3322 RLIMIT_STACK = 3,
3323 RLIMIT_CORE = 4,
3324 __RLIMIT_RSS = 5,
3325 RLIMIT_NOFILE = 7,
3326 __RLIMIT_OFILE = RLIMIT_NOFILE,
3327 RLIMIT_AS = 9,
3328 __RLIMIT_NPROC = 6,
3329 __RLIMIT_MEMLOCK = 8,
3330 __RLIMIT_LOCKS = 10,
3331 __RLIMIT_SIGPENDING = 11,
3332 __RLIMIT_MSGQUEUE = 12,
3333 __RLIMIT_NICE = 13,
3334 __RLIMIT_RTPRIO = 14,
3335 __RLIMIT_NLIMITS = 15,
3336 __RLIM_NLIMITS = __RLIMIT_NLIMITS
3337 };
3338 typedef __rlim64_t rlim_t;
3339 typedef __rlim64_t rlim64_t;
3340 struct rlimit
3341 {
3342 rlim_t rlim_cur;
3343 rlim_t rlim_max;
3344 };
3345 struct rlimit64
3346 {
3347 rlim64_t rlim_cur;
3348 rlim64_t rlim_max;
3349 };
3350 enum __rusage_who
3351 {
3352 RUSAGE_SELF = 0,
3353 RUSAGE_CHILDREN = -1
3354 ,
3355 RUSAGE_THREAD = 1
3356 };
3357 struct rusage
3358 {
3359 struct timeval ru_utime;
3360 struct timeval ru_stime;
3361 long int ru_maxrss;
3362 long int ru_ixrss;
3363 long int ru_idrss;
3364 long int ru_isrss;
3365 long int ru_minflt;
3366 long int ru_majflt;
3367 long int ru_nswap;
3368 long int ru_inblock;
3369 long int ru_oublock;
3370 long int ru_msgsnd;
3371 long int ru_msgrcv;
3372 long int ru_nsignals;
3373 long int ru_nvcsw;
3374 long int ru_nivcsw;
3375 };
3376 enum __priority_which
3377 {
3378 PRIO_PROCESS = 0,
3379 PRIO_PGRP = 1,
3380 PRIO_USER = 2
3381 };
3382 extern int prlimit (__pid_t __pid, enum __rlimit_resource __resource, const struct rlimit *__new_limit, struct rlimit *__old_limit) __asm__ ("" "prlimit64") __attribute__ ((__nothrow__))
3383 ;
3384 extern int prlimit64 (__pid_t __pid, enum __rlimit_resource __resource,
3385 const struct rlimit64 *__new_limit,
3386 struct rlimit64 *__old_limit) __attribute__ ((__nothrow__));
3387 typedef enum __rlimit_resource __rlimit_resource_t;
3388 typedef enum __rusage_who __rusage_who_t;
3389 typedef enum __priority_which __priority_which_t;
3390 extern int getrlimit (__rlimit_resource_t __resource, struct rlimit *__rlimits) __asm__ ("" "getrlimit64") __attribute__ ((__nothrow__))
3391 ;
3392 extern int getrlimit64 (__rlimit_resource_t __resource,
3393 struct rlimit64 *__rlimits) __attribute__ ((__nothrow__));
3394 extern int setrlimit (__rlimit_resource_t __resource, const struct rlimit *__rlimits) __asm__ ("" "setrlimit64") __attribute__ ((__nothrow__))
3395 ;
3396 extern int setrlimit64 (__rlimit_resource_t __resource,
3397 const struct rlimit64 *__rlimits) __attribute__ ((__nothrow__));
3398 extern int getrusage (__rusage_who_t __who, struct rusage *__usage) __attribute__ ((__nothrow__));
3399 extern int getpriority (__priority_which_t __which, id_t __who) __attribute__ ((__nothrow__));
3400 extern int setpriority (__priority_which_t __which, id_t __who, int __prio)
3401 __attribute__ ((__nothrow__));
3402 typedef enum
3403 {
3404 P_ALL,
3405 P_PID,
3406 P_PGID
3407 } idtype_t;
3408 extern __pid_t wait (__WAIT_STATUS __stat_loc);
3409 extern __pid_t waitpid (__pid_t __pid, int *__stat_loc, int __options);
3410 extern int waitid (idtype_t __idtype, __id_t __id, siginfo_t *__infop,
3411 int __options);
3412 struct rusage;
3413 extern __pid_t wait3 (__WAIT_STATUS __stat_loc, int __options,
3414 struct rusage * __usage) __attribute__ ((__nothrow__));
3415 extern __pid_t wait4 (__pid_t __pid, __WAIT_STATUS __stat_loc, int __options,
3416 struct rusage *__usage) __attribute__ ((__nothrow__));
3417 typedef unsigned char cc_t;
3418 typedef unsigned int speed_t;
3419 typedef unsigned int tcflag_t;
3420 struct termios
3421 {
3422 tcflag_t c_iflag;
3423 tcflag_t c_oflag;
3424 tcflag_t c_cflag;
3425 tcflag_t c_lflag;
3426 cc_t c_line;
3427 cc_t c_cc[32];
3428 speed_t c_ispeed;
3429 speed_t c_ospeed;
3430 };
3431 extern speed_t cfgetospeed (const struct termios *__termios_p) __attribute__ ((__nothrow__));
3432 extern speed_t cfgetispeed (const struct termios *__termios_p) __attribute__ ((__nothrow__));
3433 extern int cfsetospeed (struct termios *__termios_p, speed_t __speed) __attribute__ ((__nothrow__));
3434 extern int cfsetispeed (struct termios *__termios_p, speed_t __speed) __attribute__ ((__nothrow__));
3435 extern int cfsetspeed (struct termios *__termios_p, speed_t __speed) __attribute__ ((__nothrow__));
3436 extern int tcgetattr (int __fd, struct termios *__termios_p) __attribute__ ((__nothrow__));
3437 extern int tcsetattr (int __fd, int __optional_actions,
3438 const struct termios *__termios_p) __attribute__ ((__nothrow__));
3439 extern void cfmakeraw (struct termios *__termios_p) __attribute__ ((__nothrow__));
3440 extern int tcsendbreak (int __fd, int __duration) __attribute__ ((__nothrow__));
3441 extern int tcdrain (int __fd);
3442 extern int tcflush (int __fd, int __queue_selector) __attribute__ ((__nothrow__));
3443 extern int tcflow (int __fd, int __action) __attribute__ ((__nothrow__));
3444 extern __pid_t tcgetsid (int __fd) __attribute__ ((__nothrow__));
3445 struct tm
3446 {
3447 int tm_sec;
3448 int tm_min;
3449 int tm_hour;
3450 int tm_mday;
3451 int tm_mon;
3452 int tm_year;
3453 int tm_wday;
3454 int tm_yday;
3455 int tm_isdst;
3456 long int tm_gmtoff;
3457 const char *tm_zone;
3458 };
3459 struct itimerspec
3460 {
3461 struct timespec it_interval;
3462 struct timespec it_value;
3463 };
3464 struct sigevent;
3465 extern clock_t clock (void) __attribute__ ((__nothrow__));
3466 extern time_t time (time_t *__timer) __attribute__ ((__nothrow__));
3467 extern double difftime (time_t __time1, time_t __time0)
3468 __attribute__ ((__nothrow__)) __attribute__ ((__const__));
3469 extern time_t mktime (struct tm *__tp) __attribute__ ((__nothrow__));
3470 extern size_t strftime (char *__restrict __s, size_t __maxsize,
3471 const char *__restrict __format,
3472 const struct tm *__restrict __tp) __attribute__ ((__nothrow__));
3473 extern char *strptime (const char *__restrict __s,
3474 const char *__restrict __fmt, struct tm *__tp)
3475 __attribute__ ((__nothrow__));
3476 extern size_t strftime_l (char *__restrict __s, size_t __maxsize,
3477 const char *__restrict __format,
3478 const struct tm *__restrict __tp,
3479 __locale_t __loc) __attribute__ ((__nothrow__));
3480 extern char *strptime_l (const char *__restrict __s,
3481 const char *__restrict __fmt, struct tm *__tp,
3482 __locale_t __loc) __attribute__ ((__nothrow__));
3483 extern struct tm *gmtime (const time_t *__timer) __attribute__ ((__nothrow__));
3484 extern struct tm *localtime (const time_t *__timer) __attribute__ ((__nothrow__));
3485 extern struct tm *gmtime_r (const time_t *__restrict __timer,
3486 struct tm *__restrict __tp) __attribute__ ((__nothrow__));
3487 extern struct tm *localtime_r (const time_t *__restrict __timer,
3488 struct tm *__restrict __tp) __attribute__ ((__nothrow__));
3489 extern char *asctime (const struct tm *__tp) __attribute__ ((__nothrow__));
3490 extern char *ctime (const time_t *__timer) __attribute__ ((__nothrow__));
3491 extern char *asctime_r (const struct tm *__restrict __tp,
3492 char *__restrict __buf) __attribute__ ((__nothrow__));
3493 extern char *ctime_r (const time_t *__restrict __timer,
3494 char *__restrict __buf) __attribute__ ((__nothrow__));
3495 extern char *__tzname[2];
3496 extern int __daylight;
3497 extern long int __timezone;
3498 extern char *tzname[2];
3499 extern void tzset (void) __attribute__ ((__nothrow__));
3500 extern int daylight;
3501 extern long int timezone;
3502 extern int stime (const time_t *__when) __attribute__ ((__nothrow__));
3503 extern time_t timegm (struct tm *__tp) __attribute__ ((__nothrow__));
3504 extern time_t timelocal (struct tm *__tp) __attribute__ ((__nothrow__));
3505 extern int dysize (int __year) __attribute__ ((__nothrow__)) __attribute__ ((__const__));
3506 extern int nanosleep (const struct timespec *__requested_time,
3507 struct timespec *__remaining);
3508 extern int clock_getres (clockid_t __clock_id, struct timespec *__res) __attribute__ ((__nothrow__));
3509 extern int clock_gettime (clockid_t __clock_id, struct timespec *__tp) __attribute__ ((__nothrow__));
3510 extern int clock_settime (clockid_t __clock_id, const struct timespec *__tp)
3511 __attribute__ ((__nothrow__));
3512 extern int clock_nanosleep (clockid_t __clock_id, int __flags,
3513 const struct timespec *__req,
3514 struct timespec *__rem);
3515 extern int clock_getcpuclockid (pid_t __pid, clockid_t *__clock_id) __attribute__ ((__nothrow__));
3516 extern int timer_create (clockid_t __clock_id,
3517 struct sigevent *__restrict __evp,
3518 timer_t *__restrict __timerid) __attribute__ ((__nothrow__));
3519 extern int timer_delete (timer_t __timerid) __attribute__ ((__nothrow__));
3520 extern int timer_settime (timer_t __timerid, int __flags,
3521 const struct itimerspec *__restrict __value,
3522 struct itimerspec *__restrict __ovalue) __attribute__ ((__nothrow__));
3523 extern int timer_gettime (timer_t __timerid, struct itimerspec *__value)
3524 __attribute__ ((__nothrow__));
3525 extern int timer_getoverrun (timer_t __timerid) __attribute__ ((__nothrow__));
3526 extern int getdate_err;
3527 extern struct tm *getdate (const char *__string);
3528 extern int getdate_r (const char *__restrict __string,
3529 struct tm *__restrict __resbufp);
3530 extern int access (const char *__name, int __type) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
3531 extern int euidaccess (const char *__name, int __type)
3532 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
3533 extern int eaccess (const char *__name, int __type)
3534 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
3535 extern int faccessat (int __fd, const char *__file, int __type, int __flag)
3536 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2))) __attribute__ ((__warn_unused_result__));
3537 extern __off64_t lseek (int __fd, __off64_t __offset, int __whence) __asm__ ("" "lseek64") __attribute__ ((__nothrow__))
3538 ;
3539 extern __off64_t lseek64 (int __fd, __off64_t __offset, int __whence)
3540 __attribute__ ((__nothrow__));
3541 extern int close (int __fd);
3542 extern ssize_t read (int __fd, void *__buf, size_t __nbytes) __attribute__ ((__warn_unused_result__));
3543 extern ssize_t write (int __fd, const void *__buf, size_t __n) __attribute__ ((__warn_unused_result__));
3544 extern ssize_t pread (int __fd, void *__buf, size_t __nbytes, __off64_t __offset) __asm__ ("" "pread64")
3545 __attribute__ ((__warn_unused_result__));
3546 extern ssize_t pwrite (int __fd, const void *__buf, size_t __nbytes, __off64_t __offset) __asm__ ("" "pwrite64")
3547 __attribute__ ((__warn_unused_result__));
3548 extern ssize_t pread64 (int __fd, void *__buf, size_t __nbytes,
3549 __off64_t __offset) __attribute__ ((__warn_unused_result__));
3550 extern ssize_t pwrite64 (int __fd, const void *__buf, size_t __n,
3551 __off64_t __offset) __attribute__ ((__warn_unused_result__));
3552 extern int pipe (int __pipedes[2]) __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__));
3553 extern int pipe2 (int __pipedes[2], int __flags) __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__));
3554 extern unsigned int alarm (unsigned int __seconds) __attribute__ ((__nothrow__));
3555 extern unsigned int sleep (unsigned int __seconds);
3556 extern __useconds_t ualarm (__useconds_t __value, __useconds_t __interval)
3557 __attribute__ ((__nothrow__));
3558 extern int usleep (__useconds_t __useconds);
3559 extern int pause (void);
3560 extern int chown (const char *__file, __uid_t __owner, __gid_t __group)
3561 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
3562 extern int fchown (int __fd, __uid_t __owner, __gid_t __group) __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__));
3563 extern int lchown (const char *__file, __uid_t __owner, __gid_t __group)
3564 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
3565 extern int fchownat (int __fd, const char *__file, __uid_t __owner,
3566 __gid_t __group, int __flag)
3567 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2))) __attribute__ ((__warn_unused_result__));
3568 extern int chdir (const char *__path) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
3569 extern int fchdir (int __fd) __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__));
3570 extern char *getcwd (char *__buf, size_t __size) __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__));
3571 extern char *get_current_dir_name (void) __attribute__ ((__nothrow__));
3572 extern char *getwd (char *__buf)
3573 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__deprecated__)) __attribute__ ((__warn_unused_result__));
3574 extern int dup (int __fd) __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__));
3575 extern int dup2 (int __fd, int __fd2) __attribute__ ((__nothrow__));
3576 extern int dup3 (int __fd, int __fd2, int __flags) __attribute__ ((__nothrow__));
3577 extern char **__environ;
3578 extern char **environ;
3579 extern int execve (const char *__path, char *const __argv[],
3580 char *const __envp[]) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
3581 extern int fexecve (int __fd, char *const __argv[], char *const __envp[])
3582 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));
3583 extern int execv (const char *__path, char *const __argv[])
3584 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
3585 extern int execle (const char *__path, const char *__arg, ...)
3586 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
3587 extern int execl (const char *__path, const char *__arg, ...)
3588 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
3589 extern int execvp (const char *__file, char *const __argv[])
3590 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
3591 extern int execlp (const char *__file, const char *__arg, ...)
3592 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
3593 extern int execvpe (const char *__file, char *const __argv[],
3594 char *const __envp[])
3595 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
3596 extern int nice (int __inc) __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__));
3597 extern void _exit (int __status) __attribute__ ((__noreturn__));
3598 enum
3599 {
3600 _PC_LINK_MAX,
3601 _PC_MAX_CANON,
3602 _PC_MAX_INPUT,
3603 _PC_NAME_MAX,
3604 _PC_PATH_MAX,
3605 _PC_PIPE_BUF,
3606 _PC_CHOWN_RESTRICTED,
3607 _PC_NO_TRUNC,
3608 _PC_VDISABLE,
3609 _PC_SYNC_IO,
3610 _PC_ASYNC_IO,
3611 _PC_PRIO_IO,
3612 _PC_SOCK_MAXBUF,
3613 _PC_FILESIZEBITS,
3614 _PC_REC_INCR_XFER_SIZE,
3615 _PC_REC_MAX_XFER_SIZE,
3616 _PC_REC_MIN_XFER_SIZE,
3617 _PC_REC_XFER_ALIGN,
3618 _PC_ALLOC_SIZE_MIN,
3619 _PC_SYMLINK_MAX,
3620 _PC_2_SYMLINKS
3621 };
3622 enum
3623 {
3624 _SC_ARG_MAX,
3625 _SC_CHILD_MAX,
3626 _SC_CLK_TCK,
3627 _SC_NGROUPS_MAX,
3628 _SC_OPEN_MAX,
3629 _SC_STREAM_MAX,
3630 _SC_TZNAME_MAX,
3631 _SC_JOB_CONTROL,
3632 _SC_SAVED_IDS,
3633 _SC_REALTIME_SIGNALS,
3634 _SC_PRIORITY_SCHEDULING,
3635 _SC_TIMERS,
3636 _SC_ASYNCHRONOUS_IO,
3637 _SC_PRIORITIZED_IO,
3638 _SC_SYNCHRONIZED_IO,
3639 _SC_FSYNC,
3640 _SC_MAPPED_FILES,
3641 _SC_MEMLOCK,
3642 _SC_MEMLOCK_RANGE,
3643 _SC_MEMORY_PROTECTION,
3644 _SC_MESSAGE_PASSING,
3645 _SC_SEMAPHORES,
3646 _SC_SHARED_MEMORY_OBJECTS,
3647 _SC_AIO_LISTIO_MAX,
3648 _SC_AIO_MAX,
3649 _SC_AIO_PRIO_DELTA_MAX,
3650 _SC_DELAYTIMER_MAX,
3651 _SC_MQ_OPEN_MAX,
3652 _SC_MQ_PRIO_MAX,
3653 _SC_VERSION,
3654 _SC_PAGESIZE,
3655 _SC_RTSIG_MAX,
3656 _SC_SEM_NSEMS_MAX,
3657 _SC_SEM_VALUE_MAX,
3658 _SC_SIGQUEUE_MAX,
3659 _SC_TIMER_MAX,
3660 _SC_BC_BASE_MAX,
3661 _SC_BC_DIM_MAX,
3662 _SC_BC_SCALE_MAX,
3663 _SC_BC_STRING_MAX,
3664 _SC_COLL_WEIGHTS_MAX,
3665 _SC_EQUIV_CLASS_MAX,
3666 _SC_EXPR_NEST_MAX,
3667 _SC_LINE_MAX,
3668 _SC_RE_DUP_MAX,
3669 _SC_CHARCLASS_NAME_MAX,
3670 _SC_2_VERSION,
3671 _SC_2_C_BIND,
3672 _SC_2_C_DEV,
3673 _SC_2_FORT_DEV,
3674 _SC_2_FORT_RUN,
3675 _SC_2_SW_DEV,
3676 _SC_2_LOCALEDEF,
3677 _SC_PII,
3678 _SC_PII_XTI,
3679 _SC_PII_SOCKET,
3680 _SC_PII_INTERNET,
3681 _SC_PII_OSI,
3682 _SC_POLL,
3683 _SC_SELECT,
3684 _SC_UIO_MAXIOV,
3685 _SC_IOV_MAX = _SC_UIO_MAXIOV,
3686 _SC_PII_INTERNET_STREAM,
3687 _SC_PII_INTERNET_DGRAM,
3688 _SC_PII_OSI_COTS,
3689 _SC_PII_OSI_CLTS,
3690 _SC_PII_OSI_M,
3691 _SC_T_IOV_MAX,
3692 _SC_THREADS,
3693 _SC_THREAD_SAFE_FUNCTIONS,
3694 _SC_GETGR_R_SIZE_MAX,
3695 _SC_GETPW_R_SIZE_MAX,
3696 _SC_LOGIN_NAME_MAX,
3697 _SC_TTY_NAME_MAX,
3698 _SC_THREAD_DESTRUCTOR_ITERATIONS,
3699 _SC_THREAD_KEYS_MAX,
3700 _SC_THREAD_STACK_MIN,
3701 _SC_THREAD_THREADS_MAX,
3702 _SC_THREAD_ATTR_STACKADDR,
3703 _SC_THREAD_ATTR_STACKSIZE,
3704 _SC_THREAD_PRIORITY_SCHEDULING,
3705 _SC_THREAD_PRIO_INHERIT,
3706 _SC_THREAD_PRIO_PROTECT,
3707 _SC_THREAD_PROCESS_SHARED,
3708 _SC_NPROCESSORS_CONF,
3709 _SC_NPROCESSORS_ONLN,
3710 _SC_PHYS_PAGES,
3711 _SC_AVPHYS_PAGES,
3712 _SC_ATEXIT_MAX,
3713 _SC_PASS_MAX,
3714 _SC_XOPEN_VERSION,
3715 _SC_XOPEN_XCU_VERSION,
3716 _SC_XOPEN_UNIX,
3717 _SC_XOPEN_CRYPT,
3718 _SC_XOPEN_ENH_I18N,
3719 _SC_XOPEN_SHM,
3720 _SC_2_CHAR_TERM,
3721 _SC_2_C_VERSION,
3722 _SC_2_UPE,
3723 _SC_XOPEN_XPG2,
3724 _SC_XOPEN_XPG3,
3725 _SC_XOPEN_XPG4,
3726 _SC_CHAR_BIT,
3727 _SC_CHAR_MAX,
3728 _SC_CHAR_MIN,
3729 _SC_INT_MAX,
3730 _SC_INT_MIN,
3731 _SC_LONG_BIT,
3732 _SC_WORD_BIT,
3733 _SC_MB_LEN_MAX,
3734 _SC_NZERO,
3735 _SC_SSIZE_MAX,
3736 _SC_SCHAR_MAX,
3737 _SC_SCHAR_MIN,
3738 _SC_SHRT_MAX,
3739 _SC_SHRT_MIN,
3740 _SC_UCHAR_MAX,
3741 _SC_UINT_MAX,
3742 _SC_ULONG_MAX,
3743 _SC_USHRT_MAX,
3744 _SC_NL_ARGMAX,
3745 _SC_NL_LANGMAX,
3746 _SC_NL_MSGMAX,
3747 _SC_NL_NMAX,
3748 _SC_NL_SETMAX,
3749 _SC_NL_TEXTMAX,
3750 _SC_XBS5_ILP32_OFF32,
3751 _SC_XBS5_ILP32_OFFBIG,
3752 _SC_XBS5_LP64_OFF64,
3753 _SC_XBS5_LPBIG_OFFBIG,
3754 _SC_XOPEN_LEGACY,
3755 _SC_XOPEN_REALTIME,
3756 _SC_XOPEN_REALTIME_THREADS,
3757 _SC_ADVISORY_INFO,
3758 _SC_BARRIERS,
3759 _SC_BASE,
3760 _SC_C_LANG_SUPPORT,
3761 _SC_C_LANG_SUPPORT_R,
3762 _SC_CLOCK_SELECTION,
3763 _SC_CPUTIME,
3764 _SC_THREAD_CPUTIME,
3765 _SC_DEVICE_IO,
3766 _SC_DEVICE_SPECIFIC,
3767 _SC_DEVICE_SPECIFIC_R,
3768 _SC_FD_MGMT,
3769 _SC_FIFO,
3770 _SC_PIPE,
3771 _SC_FILE_ATTRIBUTES,
3772 _SC_FILE_LOCKING,
3773 _SC_FILE_SYSTEM,
3774 _SC_MONOTONIC_CLOCK,
3775 _SC_MULTI_PROCESS,
3776 _SC_SINGLE_PROCESS,
3777 _SC_NETWORKING,
3778 _SC_READER_WRITER_LOCKS,
3779 _SC_SPIN_LOCKS,
3780 _SC_REGEXP,
3781 _SC_REGEX_VERSION,
3782 _SC_SHELL,
3783 _SC_SIGNALS,
3784 _SC_SPAWN,
3785 _SC_SPORADIC_SERVER,
3786 _SC_THREAD_SPORADIC_SERVER,
3787 _SC_SYSTEM_DATABASE,
3788 _SC_SYSTEM_DATABASE_R,
3789 _SC_TIMEOUTS,
3790 _SC_TYPED_MEMORY_OBJECTS,
3791 _SC_USER_GROUPS,
3792 _SC_USER_GROUPS_R,
3793 _SC_2_PBS,
3794 _SC_2_PBS_ACCOUNTING,
3795 _SC_2_PBS_LOCATE,
3796 _SC_2_PBS_MESSAGE,
3797 _SC_2_PBS_TRACK,
3798 _SC_SYMLOOP_MAX,
3799 _SC_STREAMS,
3800 _SC_2_PBS_CHECKPOINT,
3801 _SC_V6_ILP32_OFF32,
3802 _SC_V6_ILP32_OFFBIG,
3803 _SC_V6_LP64_OFF64,
3804 _SC_V6_LPBIG_OFFBIG,
3805 _SC_HOST_NAME_MAX,
3806 _SC_TRACE,
3807 _SC_TRACE_EVENT_FILTER,
3808 _SC_TRACE_INHERIT,
3809 _SC_TRACE_LOG,
3810 _SC_LEVEL1_ICACHE_SIZE,
3811 _SC_LEVEL1_ICACHE_ASSOC,
3812 _SC_LEVEL1_ICACHE_LINESIZE,
3813 _SC_LEVEL1_DCACHE_SIZE,
3814 _SC_LEVEL1_DCACHE_ASSOC,
3815 _SC_LEVEL1_DCACHE_LINESIZE,
3816 _SC_LEVEL2_CACHE_SIZE,
3817 _SC_LEVEL2_CACHE_ASSOC,
3818 _SC_LEVEL2_CACHE_LINESIZE,
3819 _SC_LEVEL3_CACHE_SIZE,
3820 _SC_LEVEL3_CACHE_ASSOC,
3821 _SC_LEVEL3_CACHE_LINESIZE,
3822 _SC_LEVEL4_CACHE_SIZE,
3823 _SC_LEVEL4_CACHE_ASSOC,
3824 _SC_LEVEL4_CACHE_LINESIZE,
3825 _SC_IPV6 = _SC_LEVEL1_ICACHE_SIZE + 50,
3826 _SC_RAW_SOCKETS,
3827 _SC_V7_ILP32_OFF32,
3828 _SC_V7_ILP32_OFFBIG,
3829 _SC_V7_LP64_OFF64,
3830 _SC_V7_LPBIG_OFFBIG,
3831 _SC_SS_REPL_MAX,
3832 _SC_TRACE_EVENT_NAME_MAX,
3833 _SC_TRACE_NAME_MAX,
3834 _SC_TRACE_SYS_MAX,
3835 _SC_TRACE_USER_EVENT_MAX,
3836 _SC_XOPEN_STREAMS,
3837 _SC_THREAD_ROBUST_PRIO_INHERIT,
3838 _SC_THREAD_ROBUST_PRIO_PROTECT
3839 };
3840 enum
3841 {
3842 _CS_PATH,
3843 _CS_V6_WIDTH_RESTRICTED_ENVS,
3844 _CS_GNU_LIBC_VERSION,
3845 _CS_GNU_LIBPTHREAD_VERSION,
3846 _CS_V5_WIDTH_RESTRICTED_ENVS,
3847 _CS_V7_WIDTH_RESTRICTED_ENVS,
3848 _CS_LFS_CFLAGS = 1000,
3849 _CS_LFS_LDFLAGS,
3850 _CS_LFS_LIBS,
3851 _CS_LFS_LINTFLAGS,
3852 _CS_LFS64_CFLAGS,
3853 _CS_LFS64_LDFLAGS,
3854 _CS_LFS64_LIBS,
3855 _CS_LFS64_LINTFLAGS,
3856 _CS_XBS5_ILP32_OFF32_CFLAGS = 1100,
3857 _CS_XBS5_ILP32_OFF32_LDFLAGS,
3858 _CS_XBS5_ILP32_OFF32_LIBS,
3859 _CS_XBS5_ILP32_OFF32_LINTFLAGS,
3860 _CS_XBS5_ILP32_OFFBIG_CFLAGS,
3861 _CS_XBS5_ILP32_OFFBIG_LDFLAGS,
3862 _CS_XBS5_ILP32_OFFBIG_LIBS,
3863 _CS_XBS5_ILP32_OFFBIG_LINTFLAGS,
3864 _CS_XBS5_LP64_OFF64_CFLAGS,
3865 _CS_XBS5_LP64_OFF64_LDFLAGS,
3866 _CS_XBS5_LP64_OFF64_LIBS,
3867 _CS_XBS5_LP64_OFF64_LINTFLAGS,
3868 _CS_XBS5_LPBIG_OFFBIG_CFLAGS,
3869 _CS_XBS5_LPBIG_OFFBIG_LDFLAGS,
3870 _CS_XBS5_LPBIG_OFFBIG_LIBS,
3871 _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS,
3872 _CS_POSIX_V6_ILP32_OFF32_CFLAGS,
3873 _CS_POSIX_V6_ILP32_OFF32_LDFLAGS,
3874 _CS_POSIX_V6_ILP32_OFF32_LIBS,
3875 _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS,
3876 _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS,
3877 _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS,
3878 _CS_POSIX_V6_ILP32_OFFBIG_LIBS,
3879 _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS,
3880 _CS_POSIX_V6_LP64_OFF64_CFLAGS,
3881 _CS_POSIX_V6_LP64_OFF64_LDFLAGS,
3882 _CS_POSIX_V6_LP64_OFF64_LIBS,
3883 _CS_POSIX_V6_LP64_OFF64_LINTFLAGS,
3884 _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS,
3885 _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS,
3886 _CS_POSIX_V6_LPBIG_OFFBIG_LIBS,
3887 _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS,
3888 _CS_POSIX_V7_ILP32_OFF32_CFLAGS,
3889 _CS_POSIX_V7_ILP32_OFF32_LDFLAGS,
3890 _CS_POSIX_V7_ILP32_OFF32_LIBS,
3891 _CS_POSIX_V7_ILP32_OFF32_LINTFLAGS,
3892 _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS,
3893 _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS,
3894 _CS_POSIX_V7_ILP32_OFFBIG_LIBS,
3895 _CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS,
3896 _CS_POSIX_V7_LP64_OFF64_CFLAGS,
3897 _CS_POSIX_V7_LP64_OFF64_LDFLAGS,
3898 _CS_POSIX_V7_LP64_OFF64_LIBS,
3899 _CS_POSIX_V7_LP64_OFF64_LINTFLAGS,
3900 _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS,
3901 _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS,
3902 _CS_POSIX_V7_LPBIG_OFFBIG_LIBS,
3903 _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS,
3904 _CS_V6_ENV,
3905 _CS_V7_ENV
3906 };
3907 extern long int pathconf (const char *__path, int __name)
3908 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
3909 extern long int fpathconf (int __fd, int __name) __attribute__ ((__nothrow__));
3910 extern long int sysconf (int __name) __attribute__ ((__nothrow__));
3911 extern size_t confstr (int __name, char *__buf, size_t __len) __attribute__ ((__nothrow__));
3912 extern __pid_t getpid (void) __attribute__ ((__nothrow__));
3913 extern __pid_t getppid (void) __attribute__ ((__nothrow__));
3914 extern __pid_t getpgrp (void) __attribute__ ((__nothrow__));
3915 extern __pid_t __getpgid (__pid_t __pid) __attribute__ ((__nothrow__));
3916 extern __pid_t getpgid (__pid_t __pid) __attribute__ ((__nothrow__));
3917 extern int setpgid (__pid_t __pid, __pid_t __pgid) __attribute__ ((__nothrow__));
3918 extern int setpgrp (void) __attribute__ ((__nothrow__));
3919 extern __pid_t setsid (void) __attribute__ ((__nothrow__));
3920 extern __pid_t getsid (__pid_t __pid) __attribute__ ((__nothrow__));
3921 extern __uid_t getuid (void) __attribute__ ((__nothrow__));
3922 extern __uid_t geteuid (void) __attribute__ ((__nothrow__));
3923 extern __gid_t getgid (void) __attribute__ ((__nothrow__));
3924 extern __gid_t getegid (void) __attribute__ ((__nothrow__));
3925 extern int getgroups (int __size, __gid_t __list[]) __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__));
3926 extern int group_member (__gid_t __gid) __attribute__ ((__nothrow__));
3927 extern int setuid (__uid_t __uid) __attribute__ ((__nothrow__));
3928 extern int setreuid (__uid_t __ruid, __uid_t __euid) __attribute__ ((__nothrow__));
3929 extern int seteuid (__uid_t __uid) __attribute__ ((__nothrow__));
3930 extern int setgid (__gid_t __gid) __attribute__ ((__nothrow__));
3931 extern int setregid (__gid_t __rgid, __gid_t __egid) __attribute__ ((__nothrow__));
3932 extern int setegid (__gid_t __gid) __attribute__ ((__nothrow__));
3933 extern int getresuid (__uid_t *__ruid, __uid_t *__euid, __uid_t *__suid)
3934 __attribute__ ((__nothrow__));
3935 extern int getresgid (__gid_t *__rgid, __gid_t *__egid, __gid_t *__sgid)
3936 __attribute__ ((__nothrow__));
3937 extern int setresuid (__uid_t __ruid, __uid_t __euid, __uid_t __suid)
3938 __attribute__ ((__nothrow__));
3939 extern int setresgid (__gid_t __rgid, __gid_t __egid, __gid_t __sgid)
3940 __attribute__ ((__nothrow__));
3941 extern __pid_t fork (void) __attribute__ ((__nothrow__));
3942 extern __pid_t vfork (void) __attribute__ ((__nothrow__));
3943 extern char *ttyname (int __fd) __attribute__ ((__nothrow__));
3944 extern int ttyname_r (int __fd, char *__buf, size_t __buflen)
3945 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2))) __attribute__ ((__warn_unused_result__));
3946 extern int isatty (int __fd) __attribute__ ((__nothrow__));
3947 extern int ttyslot (void) __attribute__ ((__nothrow__));
3948 extern int link (const char *__from, const char *__to)
3949 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))) __attribute__ ((__warn_unused_result__));
3950 extern int linkat (int __fromfd, const char *__from, int __tofd,
3951 const char *__to, int __flags)
3952 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 4))) __attribute__ ((__warn_unused_result__));
3953 extern int symlink (const char *__from, const char *__to)
3954 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))) __attribute__ ((__warn_unused_result__));
3955 extern ssize_t readlink (const char *__restrict __path,
3956 char *__restrict __buf, size_t __len)
3957 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))) __attribute__ ((__warn_unused_result__));
3958 extern int symlinkat (const char *__from, int __tofd,
3959 const char *__to) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 3))) __attribute__ ((__warn_unused_result__));
3960 extern ssize_t readlinkat (int __fd, const char *__restrict __path,
3961 char *__restrict __buf, size_t __len)
3962 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 3))) __attribute__ ((__warn_unused_result__));
3963 extern int unlink (const char *__name) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
3964 extern int unlinkat (int __fd, const char *__name, int __flag)
3965 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));
3966 extern int rmdir (const char *__path) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
3967 extern __pid_t tcgetpgrp (int __fd) __attribute__ ((__nothrow__));
3968 extern int tcsetpgrp (int __fd, __pid_t __pgrp_id) __attribute__ ((__nothrow__));
3969 extern char *getlogin (void);
3970 extern int getlogin_r (char *__name, size_t __name_len) __attribute__ ((__nonnull__ (1)));
3971 extern int setlogin (const char *__name) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
3972 extern char *optarg;
3973 extern int optind;
3974 extern int opterr;
3975 extern int optopt;
3976 extern int getopt (int ___argc, char *const *___argv, const char *__shortopts)
3977 __attribute__ ((__nothrow__));
3978 extern int gethostname (char *__name, size_t __len) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
3979 extern int sethostname (const char *__name, size_t __len)
3980 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
3981 extern int sethostid (long int __id) __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__));
3982 extern int getdomainname (char *__name, size_t __len)
3983 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
3984 extern int setdomainname (const char *__name, size_t __len)
3985 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
3986 extern int vhangup (void) __attribute__ ((__nothrow__));
3987 extern int revoke (const char *__file) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
3988 extern int profil (unsigned short int *__sample_buffer, size_t __size,
3989 size_t __offset, unsigned int __scale)
3990 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
3991 extern int acct (const char *__name) __attribute__ ((__nothrow__));
3992 extern char *getusershell (void) __attribute__ ((__nothrow__));
3993 extern void endusershell (void) __attribute__ ((__nothrow__));
3994 extern void setusershell (void) __attribute__ ((__nothrow__));
3995 extern int daemon (int __nochdir, int __noclose) __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__));
3996 extern int chroot (const char *__path) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
3997 extern char *getpass (const char *__prompt) __attribute__ ((__nonnull__ (1)));
3998 extern int fsync (int __fd);
3999 extern long int gethostid (void);
4000 extern void sync (void) __attribute__ ((__nothrow__));
4001 extern int getpagesize (void) __attribute__ ((__nothrow__)) __attribute__ ((__const__));
4002 extern int getdtablesize (void) __attribute__ ((__nothrow__));
4003 extern int truncate (const char *__file, __off64_t __length) __asm__ ("" "truncate64") __attribute__ ((__nothrow__))
4004 __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
4005 extern int truncate64 (const char *__file, __off64_t __length)
4006 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
4007 extern int ftruncate (int __fd, __off64_t __length) __asm__ ("" "ftruncate64") __attribute__ ((__nothrow__))
4008 __attribute__ ((__warn_unused_result__));
4009 extern int ftruncate64 (int __fd, __off64_t __length) __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__));
4010 extern int brk (void *__addr) __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__));
4011 extern void *sbrk (intptr_t __delta) __attribute__ ((__nothrow__));
4012 extern long int syscall (long int __sysno, ...) __attribute__ ((__nothrow__));
4013 extern int fdatasync (int __fildes);
4014 extern char *crypt (const char *__key, const char *__salt)
4015 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
4016 extern void encrypt (char *__block, int __edflag) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
4017 extern void swab (const void *__restrict __from, void *__restrict __to,
4018 ssize_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
4019 extern char *ctermid (char *__s) __attribute__ ((__nothrow__));
4020 extern ssize_t __read_chk (int __fd, void *__buf, size_t __nbytes,
4021 size_t __buflen) __attribute__ ((__warn_unused_result__));
4022 extern ssize_t __read_alias (int __fd, void *__buf, size_t __nbytes) __asm__ ("" "read")
4023 __attribute__ ((__warn_unused_result__));
4024 extern ssize_t __read_chk_warn (int __fd, void *__buf, size_t __nbytes, size_t __buflen) __asm__ ("" "__read_chk")
4025 __attribute__ ((__warn_unused_result__)) __attribute__((__warning__ ("read called with bigger length than size of " "the destination buffer")))
4026 ;
4027 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) __attribute__ ((__warn_unused_result__)) ssize_t
4028 read (int __fd, void *__buf, size_t __nbytes)
4029 {
4030 if (__builtin_object_size (__buf, 0) != (size_t) -1)
4031 {
4032 if (!__builtin_constant_p (__nbytes))
4033 return __read_chk (__fd, __buf, __nbytes, __builtin_object_size (__buf, 0));
4034 if (__nbytes > __builtin_object_size (__buf, 0))
4035 return __read_chk_warn (__fd, __buf, __nbytes, __builtin_object_size (__buf, 0));
4036 }
4037 return __read_alias (__fd, __buf, __nbytes);
4038 }
4039 extern ssize_t __pread_chk (int __fd, void *__buf, size_t __nbytes,
4040 __off_t __offset, size_t __bufsize) __attribute__ ((__warn_unused_result__));
4041 extern ssize_t __pread64_chk (int __fd, void *__buf, size_t __nbytes,
4042 __off64_t __offset, size_t __bufsize) __attribute__ ((__warn_unused_result__));
4043 extern ssize_t __pread_alias (int __fd, void *__buf, size_t __nbytes, __off_t __offset) __asm__ ("" "pread")
4044 __attribute__ ((__warn_unused_result__));
4045 extern ssize_t __pread64_alias (int __fd, void *__buf, size_t __nbytes, __off64_t __offset) __asm__ ("" "pread64")
4046 __attribute__ ((__warn_unused_result__));
4047 extern ssize_t __pread_chk_warn (int __fd, void *__buf, size_t __nbytes, __off_t __offset, size_t __bufsize) __asm__ ("" "__pread_chk")
4048 __attribute__ ((__warn_unused_result__)) __attribute__((__warning__ ("pread called with bigger length than size of " "the destination buffer")))
4049 ;
4050 extern ssize_t __pread64_chk_warn (int __fd, void *__buf, size_t __nbytes, __off64_t __offset, size_t __bufsize) __asm__ ("" "__pread64_chk")
4051 __attribute__ ((__warn_unused_result__)) __attribute__((__warning__ ("pread64 called with bigger length than size of " "the destination buffer")))
4052 ;
4053 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) __attribute__ ((__warn_unused_result__)) ssize_t
4054 pread (int __fd, void *__buf, size_t __nbytes, __off64_t __offset)
4055 {
4056 if (__builtin_object_size (__buf, 0) != (size_t) -1)
4057 {
4058 if (!__builtin_constant_p (__nbytes))
4059 return __pread64_chk (__fd, __buf, __nbytes, __offset, __builtin_object_size (__buf, 0));
4060 if ( __nbytes > __builtin_object_size (__buf, 0))
4061 return __pread64_chk_warn (__fd, __buf, __nbytes, __offset,
4062 __builtin_object_size (__buf, 0));
4063 }
4064 return __pread64_alias (__fd, __buf, __nbytes, __offset);
4065 }
4066 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) __attribute__ ((__warn_unused_result__)) ssize_t
4067 pread64 (int __fd, void *__buf, size_t __nbytes, __off64_t __offset)
4068 {
4069 if (__builtin_object_size (__buf, 0) != (size_t) -1)
4070 {
4071 if (!__builtin_constant_p (__nbytes))
4072 return __pread64_chk (__fd, __buf, __nbytes, __offset, __builtin_object_size (__buf, 0));
4073 if ( __nbytes > __builtin_object_size (__buf, 0))
4074 return __pread64_chk_warn (__fd, __buf, __nbytes, __offset,
4075 __builtin_object_size (__buf, 0));
4076 }
4077 return __pread64_alias (__fd, __buf, __nbytes, __offset);
4078 }
4079 extern ssize_t __readlink_chk (const char *__restrict __path,
4080 char *__restrict __buf, size_t __len,
4081 size_t __buflen)
4082 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))) __attribute__ ((__warn_unused_result__));
4083 extern ssize_t __readlink_alias (const char *__restrict __path, char *__restrict __buf, size_t __len) __asm__ ("" "readlink") __attribute__ ((__nothrow__))
4084 __attribute__ ((__nonnull__ (1, 2))) __attribute__ ((__warn_unused_result__));
4085 extern ssize_t __readlink_chk_warn (const char *__restrict __path, char *__restrict __buf, size_t __len, size_t __buflen) __asm__ ("" "__readlink_chk") __attribute__ ((__nothrow__))
4086 __attribute__ ((__nonnull__ (1, 2))) __attribute__ ((__warn_unused_result__)) __attribute__((__warning__ ("readlink called with bigger length " "than size of destination buffer")))
4087 ;
4088 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) __attribute__ ((__nonnull__ (1, 2))) __attribute__ ((__warn_unused_result__)) ssize_t
4089 __attribute__ ((__nothrow__)) readlink (const char *__restrict __path, char *__restrict __buf, size_t __len)
4090 {
4091 if (__builtin_object_size (__buf, 2 > 1) != (size_t) -1)
4092 {
4093 if (!__builtin_constant_p (__len))
4094 return __readlink_chk (__path, __buf, __len, __builtin_object_size (__buf, 2 > 1));
4095 if ( __len > __builtin_object_size (__buf, 2 > 1))
4096 return __readlink_chk_warn (__path, __buf, __len, __builtin_object_size (__buf, 2 > 1));
4097 }
4098 return __readlink_alias (__path, __buf, __len);
4099 }
4100 extern ssize_t __readlinkat_chk (int __fd, const char *__restrict __path,
4101 char *__restrict __buf, size_t __len,
4102 size_t __buflen)
4103 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 3))) __attribute__ ((__warn_unused_result__));
4104 extern ssize_t __readlinkat_alias (int __fd, const char *__restrict __path, char *__restrict __buf, size_t __len) __asm__ ("" "readlinkat") __attribute__ ((__nothrow__))
4105 __attribute__ ((__nonnull__ (2, 3))) __attribute__ ((__warn_unused_result__));
4106 extern ssize_t __readlinkat_chk_warn (int __fd, const char *__restrict __path, char *__restrict __buf, size_t __len, size_t __buflen) __asm__ ("" "__readlinkat_chk") __attribute__ ((__nothrow__))
4107 __attribute__ ((__nonnull__ (2, 3))) __attribute__ ((__warn_unused_result__)) __attribute__((__warning__ ("readlinkat called with bigger " "length than size of destination " "buffer")))
4108 ;
4109 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) __attribute__ ((__nonnull__ (2, 3))) __attribute__ ((__warn_unused_result__)) ssize_t
4110 __attribute__ ((__nothrow__)) readlinkat (int __fd, const char *__restrict __path, char *__restrict __buf, size_t __len)
4111 {
4112 if (__builtin_object_size (__buf, 2 > 1) != (size_t) -1)
4113 {
4114 if (!__builtin_constant_p (__len))
4115 return __readlinkat_chk (__fd, __path, __buf, __len, __builtin_object_size (__buf, 2 > 1));
4116 if (__len > __builtin_object_size (__buf, 2 > 1))
4117 return __readlinkat_chk_warn (__fd, __path, __buf, __len,
4118 __builtin_object_size (__buf, 2 > 1));
4119 }
4120 return __readlinkat_alias (__fd, __path, __buf, __len);
4121 }
4122 extern char *__getcwd_chk (char *__buf, size_t __size, size_t __buflen)
4123 __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__));
4124 extern char *__getcwd_alias (char *__buf, size_t __size) __asm__ ("" "getcwd") __attribute__ ((__nothrow__))
4125 __attribute__ ((__warn_unused_result__));
4126 extern char *__getcwd_chk_warn (char *__buf, size_t __size, size_t __buflen) __asm__ ("" "__getcwd_chk") __attribute__ ((__nothrow__))
4127 __attribute__ ((__warn_unused_result__)) __attribute__((__warning__ ("getcwd caller with bigger length than size of " "destination buffer")))
4128 ;
4129 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) __attribute__ ((__warn_unused_result__)) char *
4130 __attribute__ ((__nothrow__)) getcwd (char *__buf, size_t __size)
4131 {
4132 if (__builtin_object_size (__buf, 2 > 1) != (size_t) -1)
4133 {
4134 if (!__builtin_constant_p (__size))
4135 return __getcwd_chk (__buf, __size, __builtin_object_size (__buf, 2 > 1));
4136 if (__size > __builtin_object_size (__buf, 2 > 1))
4137 return __getcwd_chk_warn (__buf, __size, __builtin_object_size (__buf, 2 > 1));
4138 }
4139 return __getcwd_alias (__buf, __size);
4140 }
4141 extern char *__getwd_chk (char *__buf, size_t buflen)
4142 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
4143 extern char *__getwd_warn (char *__buf) __asm__ ("" "getwd") __attribute__ ((__nothrow__))
4144 __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__)) __attribute__((__warning__ ("please use getcwd instead, as getwd " "doesn't specify buffer size")))
4145 ;
4146 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__deprecated__)) __attribute__ ((__warn_unused_result__)) char *
4147 __attribute__ ((__nothrow__)) getwd (char *__buf)
4148 {
4149 if (__builtin_object_size (__buf, 2 > 1) != (size_t) -1)
4150 return __getwd_chk (__buf, __builtin_object_size (__buf, 2 > 1));
4151 return __getwd_warn (__buf);
4152 }
4153 extern size_t __confstr_chk (int __name, char *__buf, size_t __len,
4154 size_t __buflen) __attribute__ ((__nothrow__));
4155 extern size_t __confstr_alias (int __name, char *__buf, size_t __len) __asm__ ("" "confstr") __attribute__ ((__nothrow__))
4156 ;
4157 extern size_t __confstr_chk_warn (int __name, char *__buf, size_t __len, size_t __buflen) __asm__ ("" "__confstr_chk") __attribute__ ((__nothrow__))
4158 __attribute__((__warning__ ("confstr called with bigger length than size of destination " "buffer")))
4159 ;
4160 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) size_t
4161 __attribute__ ((__nothrow__)) confstr (int __name, char *__buf, size_t __len)
4162 {
4163 if (__builtin_object_size (__buf, 2 > 1) != (size_t) -1)
4164 {
4165 if (!__builtin_constant_p (__len))
4166 return __confstr_chk (__name, __buf, __len, __builtin_object_size (__buf, 2 > 1));
4167 if (__builtin_object_size (__buf, 2 > 1) < __len)
4168 return __confstr_chk_warn (__name, __buf, __len, __builtin_object_size (__buf, 2 > 1));
4169 }
4170 return __confstr_alias (__name, __buf, __len);
4171 }
4172 extern int __getgroups_chk (int __size, __gid_t __list[], size_t __listlen)
4173 __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__));
4174 extern int __getgroups_alias (int __size, __gid_t __list[]) __asm__ ("" "getgroups") __attribute__ ((__nothrow__))
4175 __attribute__ ((__warn_unused_result__));
4176 extern int __getgroups_chk_warn (int __size, __gid_t __list[], size_t __listlen) __asm__ ("" "__getgroups_chk") __attribute__ ((__nothrow__))
4177 __attribute__ ((__warn_unused_result__)) __attribute__((__warning__ ("getgroups called with bigger group count than what " "can fit into destination buffer")))
4178 ;
4179 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) int
4180 __attribute__ ((__nothrow__)) getgroups (int __size, __gid_t __list[])
4181 {
4182 if (__builtin_object_size (__list, 2 > 1) != (size_t) -1)
4183 {
4184 if (!__builtin_constant_p (__size) || __size < 0)
4185 return __getgroups_chk (__size, __list, __builtin_object_size (__list, 2 > 1));
4186 if (__size * sizeof (__gid_t) > __builtin_object_size (__list, 2 > 1))
4187 return __getgroups_chk_warn (__size, __list, __builtin_object_size (__list, 2 > 1));
4188 }
4189 return __getgroups_alias (__size, __list);
4190 }
4191 extern int __ttyname_r_chk (int __fd, char *__buf, size_t __buflen,
4192 size_t __nreal) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));
4193 extern int __ttyname_r_alias (int __fd, char *__buf, size_t __buflen) __asm__ ("" "ttyname_r") __attribute__ ((__nothrow__))
4194 __attribute__ ((__nonnull__ (2)));
4195 extern int __ttyname_r_chk_warn (int __fd, char *__buf, size_t __buflen, size_t __nreal) __asm__ ("" "__ttyname_r_chk") __attribute__ ((__nothrow__))
4196 __attribute__ ((__nonnull__ (2))) __attribute__((__warning__ ("ttyname_r called with bigger buflen than " "size of destination buffer")))
4197 ;
4198 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) int
4199 __attribute__ ((__nothrow__)) ttyname_r (int __fd, char *__buf, size_t __buflen)
4200 {
4201 if (__builtin_object_size (__buf, 2 > 1) != (size_t) -1)
4202 {
4203 if (!__builtin_constant_p (__buflen))
4204 return __ttyname_r_chk (__fd, __buf, __buflen, __builtin_object_size (__buf, 2 > 1));
4205 if (__buflen > __builtin_object_size (__buf, 2 > 1))
4206 return __ttyname_r_chk_warn (__fd, __buf, __buflen, __builtin_object_size (__buf, 2 > 1));
4207 }
4208 return __ttyname_r_alias (__fd, __buf, __buflen);
4209 }
4210 extern int __getlogin_r_chk (char *__buf, size_t __buflen, size_t __nreal)
4211 __attribute__ ((__nonnull__ (1)));
4212 extern int __getlogin_r_alias (char *__buf, size_t __buflen) __asm__ ("" "getlogin_r")
4213 __attribute__ ((__nonnull__ (1)));
4214 extern int __getlogin_r_chk_warn (char *__buf, size_t __buflen, size_t __nreal) __asm__ ("" "__getlogin_r_chk")
4215 __attribute__ ((__nonnull__ (1))) __attribute__((__warning__ ("getlogin_r called with bigger buflen than " "size of destination buffer")))
4216 ;
4217 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) int
4218 getlogin_r (char *__buf, size_t __buflen)
4219 {
4220 if (__builtin_object_size (__buf, 2 > 1) != (size_t) -1)
4221 {
4222 if (!__builtin_constant_p (__buflen))
4223 return __getlogin_r_chk (__buf, __buflen, __builtin_object_size (__buf, 2 > 1));
4224 if (__buflen > __builtin_object_size (__buf, 2 > 1))
4225 return __getlogin_r_chk_warn (__buf, __buflen, __builtin_object_size (__buf, 2 > 1));
4226 }
4227 return __getlogin_r_alias (__buf, __buflen);
4228 }
4229 extern int __gethostname_chk (char *__buf, size_t __buflen, size_t __nreal)
4230 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
4231 extern int __gethostname_alias (char *__buf, size_t __buflen) __asm__ ("" "gethostname") __attribute__ ((__nothrow__))
4232 __attribute__ ((__nonnull__ (1)));
4233 extern int __gethostname_chk_warn (char *__buf, size_t __buflen, size_t __nreal) __asm__ ("" "__gethostname_chk") __attribute__ ((__nothrow__))
4234 __attribute__ ((__nonnull__ (1))) __attribute__((__warning__ ("gethostname called with bigger buflen than " "size of destination buffer")))
4235 ;
4236 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) int
4237 __attribute__ ((__nothrow__)) gethostname (char *__buf, size_t __buflen)
4238 {
4239 if (__builtin_object_size (__buf, 2 > 1) != (size_t) -1)
4240 {
4241 if (!__builtin_constant_p (__buflen))
4242 return __gethostname_chk (__buf, __buflen, __builtin_object_size (__buf, 2 > 1));
4243 if (__buflen > __builtin_object_size (__buf, 2 > 1))
4244 return __gethostname_chk_warn (__buf, __buflen, __builtin_object_size (__buf, 2 > 1));
4245 }
4246 return __gethostname_alias (__buf, __buflen);
4247 }
4248 extern int __getdomainname_chk (char *__buf, size_t __buflen, size_t __nreal)
4249 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
4250 extern int __getdomainname_alias (char *__buf, size_t __buflen) __asm__ ("" "getdomainname") __attribute__ ((__nothrow__))
4251 __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
4252 extern int __getdomainname_chk_warn (char *__buf, size_t __buflen, size_t __nreal) __asm__ ("" "__getdomainname_chk") __attribute__ ((__nothrow__))
4253 __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__)) __attribute__((__warning__ ("getdomainname called with bigger " "buflen than size of destination " "buffer")))
4254 ;
4255 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) int
4256 __attribute__ ((__nothrow__)) getdomainname (char *__buf, size_t __buflen)
4257 {
4258 if (__builtin_object_size (__buf, 2 > 1) != (size_t) -1)
4259 {
4260 if (!__builtin_constant_p (__buflen))
4261 return __getdomainname_chk (__buf, __buflen, __builtin_object_size (__buf, 2 > 1));
4262 if (__buflen > __builtin_object_size (__buf, 2 > 1))
4263 return __getdomainname_chk_warn (__buf, __buflen, __builtin_object_size (__buf, 2 > 1));
4264 }
4265 return __getdomainname_alias (__buf, __buflen);
4266 }
4267 struct mntent
4268 {
4269 char *mnt_fsname;
4270 char *mnt_dir;
4271 char *mnt_type;
4272 char *mnt_opts;
4273 int mnt_freq;
4274 int mnt_passno;
4275 };
4276 extern FILE *setmntent (const char *__file, const char *__mode) __attribute__ ((__nothrow__));
4277 extern struct mntent *getmntent (FILE *__stream) __attribute__ ((__nothrow__));
4278 extern struct mntent *getmntent_r (FILE *__restrict __stream,
4279 struct mntent *__restrict __result,
4280 char *__restrict __buffer,
4281 int __bufsize) __attribute__ ((__nothrow__));
4282 extern int addmntent (FILE *__restrict __stream,
4283 const struct mntent *__restrict __mnt) __attribute__ ((__nothrow__));
4284 extern int endmntent (FILE *__stream) __attribute__ ((__nothrow__));
4285 extern char *hasmntopt (const struct mntent *__mnt,
4286 const char *__opt) __attribute__ ((__nothrow__));
4287 struct statfs
4288 {
4289 long int f_type;
4290 long int f_bsize;
4291 __fsblkcnt64_t f_blocks;
4292 __fsblkcnt64_t f_bfree;
4293 __fsblkcnt64_t f_bavail;
4294 __fsfilcnt64_t f_files;
4295 __fsfilcnt64_t f_ffree;
4296 __fsid_t f_fsid;
4297 long int f_namelen;
4298 long int f_frsize;
4299 long int f_flags;
4300 long int f_spare[4];
4301 };
4302 struct statfs64
4303 {
4304 long int f_type;
4305 long int f_bsize;
4306 __fsblkcnt64_t f_blocks;
4307 __fsblkcnt64_t f_bfree;
4308 __fsblkcnt64_t f_bavail;
4309 __fsfilcnt64_t f_files;
4310 __fsfilcnt64_t f_ffree;
4311 __fsid_t f_fsid;
4312 long int f_namelen;
4313 long int f_frsize;
4314 long int f_flags;
4315 long int f_spare[4];
4316 };
4317 extern int statfs (const char *__file, struct statfs *__buf) __asm__ ("" "statfs64") __attribute__ ((__nothrow__))
4318 __attribute__ ((__nonnull__ (1, 2)));
4319 extern int statfs64 (const char *__file, struct statfs64 *__buf)
4320 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
4321 extern int fstatfs (int __fildes, struct statfs *__buf) __asm__ ("" "fstatfs64") __attribute__ ((__nothrow__))
4322 __attribute__ ((__nonnull__ (2)));
4323 extern int fstatfs64 (int __fildes, struct statfs64 *__buf)
4324 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));
4325 struct passwd
4326 {
4327 char *pw_name;
4328 char *pw_passwd;
4329 __uid_t pw_uid;
4330 __gid_t pw_gid;
4331 char *pw_gecos;
4332 char *pw_dir;
4333 char *pw_shell;
4334 };
4335 extern void setpwent (void);
4336 extern void endpwent (void);
4337 extern struct passwd *getpwent (void);
4338 extern struct passwd *fgetpwent (FILE *__stream);
4339 extern int putpwent (const struct passwd *__restrict __p,
4340 FILE *__restrict __f);
4341 extern struct passwd *getpwuid (__uid_t __uid);
4342 extern struct passwd *getpwnam (const char *__name);
4343 extern int getpwent_r (struct passwd *__restrict __resultbuf,
4344 char *__restrict __buffer, size_t __buflen,
4345 struct passwd **__restrict __result);
4346 extern int getpwuid_r (__uid_t __uid,
4347 struct passwd *__restrict __resultbuf,
4348 char *__restrict __buffer, size_t __buflen,
4349 struct passwd **__restrict __result);
4350 extern int getpwnam_r (const char *__restrict __name,
4351 struct passwd *__restrict __resultbuf,
4352 char *__restrict __buffer, size_t __buflen,
4353 struct passwd **__restrict __result);
4354 extern int fgetpwent_r (FILE *__restrict __stream,
4355 struct passwd *__restrict __resultbuf,
4356 char *__restrict __buffer, size_t __buflen,
4357 struct passwd **__restrict __result);
4358 extern int getpw (__uid_t __uid, char *__buffer);
4359 struct group
4360 {
4361 char *gr_name;
4362 char *gr_passwd;
4363 __gid_t gr_gid;
4364 char **gr_mem;
4365 };
4366 extern void setgrent (void);
4367 extern void endgrent (void);
4368 extern struct group *getgrent (void);
4369 extern struct group *fgetgrent (FILE *__stream);
4370 extern int putgrent (const struct group *__restrict __p,
4371 FILE *__restrict __f);
4372 extern struct group *getgrgid (__gid_t __gid);
4373 extern struct group *getgrnam (const char *__name);
4374 extern int getgrent_r (struct group *__restrict __resultbuf,
4375 char *__restrict __buffer, size_t __buflen,
4376 struct group **__restrict __result);
4377 extern int getgrgid_r (__gid_t __gid, struct group *__restrict __resultbuf,
4378 char *__restrict __buffer, size_t __buflen,
4379 struct group **__restrict __result);
4380 extern int getgrnam_r (const char *__restrict __name,
4381 struct group *__restrict __resultbuf,
4382 char *__restrict __buffer, size_t __buflen,
4383 struct group **__restrict __result);
4384 extern int fgetgrent_r (FILE *__restrict __stream,
4385 struct group *__restrict __resultbuf,
4386 char *__restrict __buffer, size_t __buflen,
4387 struct group **__restrict __result);
4388 extern int setgroups (size_t __n, const __gid_t *__groups) __attribute__ ((__nothrow__));
4389 extern int getgrouplist (const char *__user, __gid_t __group,
4390 __gid_t *__groups, int *__ngroups);
4391 extern int initgroups (const char *__user, __gid_t __group);
4392 extern in_addr_t inet_addr (const char *__cp) __attribute__ ((__nothrow__));
4393 extern in_addr_t inet_lnaof (struct in_addr __in) __attribute__ ((__nothrow__));
4394 extern struct in_addr inet_makeaddr (in_addr_t __net, in_addr_t __host)
4395 __attribute__ ((__nothrow__));
4396 extern in_addr_t inet_netof (struct in_addr __in) __attribute__ ((__nothrow__));
4397 extern in_addr_t inet_network (const char *__cp) __attribute__ ((__nothrow__));
4398 extern char *inet_ntoa (struct in_addr __in) __attribute__ ((__nothrow__));
4399 extern int inet_pton (int __af, const char *__restrict __cp,
4400 void *__restrict __buf) __attribute__ ((__nothrow__));
4401 extern const char *inet_ntop (int __af, const void *__restrict __cp,
4402 char *__restrict __buf, socklen_t __len)
4403 __attribute__ ((__nothrow__));
4404 extern int inet_aton (const char *__cp, struct in_addr *__inp) __attribute__ ((__nothrow__));
4405 extern char *inet_neta (in_addr_t __net, char *__buf, size_t __len) __attribute__ ((__nothrow__));
4406 extern char *inet_net_ntop (int __af, const void *__cp, int __bits,
4407 char *__buf, size_t __len) __attribute__ ((__nothrow__));
4408 extern int inet_net_pton (int __af, const char *__cp,
4409 void *__buf, size_t __len) __attribute__ ((__nothrow__));
4410 extern unsigned int inet_nsap_addr (const char *__cp,
4411 unsigned char *__buf, int __len) __attribute__ ((__nothrow__));
4412 extern char *inet_nsap_ntoa (int __len, const unsigned char *__cp,
4413 char *__buf) __attribute__ ((__nothrow__));
4414 extern char **environ;
4415 int klogctl(int type, char *b, int len);
4416 char *dirname(char *path);
4417 struct sysinfo {
4418 long uptime;
4419 unsigned long loads[3];
4420 unsigned long totalram;
4421 unsigned long freeram;
4422 unsigned long sharedram;
4423 unsigned long bufferram;
4424 unsigned long totalswap;
4425 unsigned long freeswap;
4426 unsigned short procs;
4427 unsigned short pad;
4428 unsigned long totalhigh;
4429 unsigned long freehigh;
4430 unsigned int mem_unit;
4431 char _f[20 - 2 * sizeof(long) - sizeof(int)];
4432 };
4433 int sysinfo(struct sysinfo* info);
4434 typedef unsigned long uoff_t;
4435 extern int *const bb_errno;
4436 unsigned long long monotonic_ns(void) ;
4437 unsigned long long monotonic_us(void) ;
4438 unsigned long long monotonic_ms(void) ;
4439 unsigned monotonic_sec(void) ;
4440 extern void chomp(char *s) ;
4441 extern void trim(char *s) ;
4442 extern char *skip_whitespace(const char *) ;
4443 extern char *skip_non_whitespace(const char *) ;
4444 extern char *skip_dev_pfx(const char *tty_name) ;
4445 extern char *strrstr(const char *haystack, const char *needle) ;
4446 extern const char *bb_mode_string(mode_t mode) ;
4447 extern int is_directory(const char *name, int followLinks, struct stat *statBuf) ;
4448 enum {
4449 FILEUTILS_PRESERVE_STATUS = 1 << 0,
4450 FILEUTILS_DEREFERENCE = 1 << 1,
4451 FILEUTILS_RECUR = 1 << 2,
4452 FILEUTILS_FORCE = 1 << 3,
4453 FILEUTILS_INTERACTIVE = 1 << 4,
4454 FILEUTILS_MAKE_HARDLINK = 1 << 5,
4455 FILEUTILS_MAKE_SOFTLINK = 1 << 6,
4456 FILEUTILS_DEREF_SOFTLINK = 1 << 7,
4457 FILEUTILS_DEREFERENCE_L0 = 1 << 8,
4458 };
4459 extern int remove_file(const char *path, int flags) ;
4460 extern int copy_file(const char *source, const char *dest, int flags) ;
4461 enum {
4462 ACTION_RECURSE = (1 << 0),
4463 ACTION_FOLLOWLINKS = (1 << 1),
4464 ACTION_FOLLOWLINKS_L0 = (1 << 2),
4465 ACTION_DEPTHFIRST = (1 << 3),
4466 ACTION_QUIET = (1 << 5),
4467 ACTION_DANGLING_OK = (1 << 6),
4468 };
4469 typedef uint8_t recurse_flags_t;
4470 extern int recursive_action(const char *fileName, unsigned flags,
4471 int (*fileAction)(const char *fileName, struct stat* statbuf, void* userData, int depth),
4472 int (*dirAction)(const char *fileName, struct stat* statbuf, void* userData, int depth),
4473 void* userData, unsigned depth) ;
4474 extern int device_open(const char *device, int mode) ;
4475 enum { GETPTY_BUFSIZE = 16 };
4476 extern int xgetpty(char *line) ;
4477 extern int get_console_fd_or_die(void) ;
4478 extern void console_make_active(int fd, const int vt_num) ;
4479 extern char *find_block_device(const char *path) ;
4480 extern off_t bb_copyfd_eof(int fd1, int fd2) ;
4481 extern off_t bb_copyfd_size(int fd1, int fd2, off_t size) ;
4482 extern void bb_copyfd_exact_size(int fd1, int fd2, off_t size) ;
4483 extern void complain_copyfd_and_die(off_t sz) __attribute__ ((__noreturn__)) ;
4484 extern char bb_process_escape_sequence(const char **ptr) ;
4485 char* strcpy_and_process_escape_sequences(char *dst, const char *src) ;
4486 extern char *bb_get_last_path_component_strip(char *path) ;
4487 extern char *bb_get_last_path_component_nostrip(const char *path) ;
4488 int ndelay_on(int fd) ;
4489 int ndelay_off(int fd) ;
4490 int close_on_exec_on(int fd) ;
4491 void xdup2(int, int) ;
4492 void xmove_fd(int, int) ;
4493 DIR *xopendir(const char *path) ;
4494 DIR *warn_opendir(const char *path) ;
4495 char *xmalloc_realpath(const char *path) __attribute__ ((malloc));
4496 char *xmalloc_readlink(const char *path) __attribute__ ((malloc));
4497 char *xmalloc_readlink_or_warn(const char *path) __attribute__ ((malloc));
4498 char *xrealloc_getcwd_or_warn(char *cwd) ;
4499 char *xmalloc_follow_symlinks(const char *path) __attribute__ ((malloc));
4500 enum {
4501 BB_FATAL_SIGS = (int)(0
4502 + (1LL << 1)
4503 + (1LL << 2)
4504 + (1LL << 15)
4505 + (1LL << 13)
4506 + (1LL << 3)
4507 + (1LL << 6)
4508 + (1LL << 14)
4509 + (1LL << 26)
4510 + (1LL << 24)
4511 + (1LL << 25)
4512 + (1LL << 10)
4513 + (1LL << 12)
4514 + 0),
4515 };
4516 void bb_signals(int sigs, void (*f)(int)) ;
4517 void bb_signals_recursive_norestart(int sigs, void (*f)(int)) ;
4518 void signal_no_SA_RESTART_empty_mask(int sig, void (*handler)(int)) ;
4519 void signal_SA_RESTART_empty_mask(int sig, void (*handler)(int)) ;
4520 void wait_for_any_sig(void) ;
4521 void kill_myself_with_sig(int sig) __attribute__ ((__noreturn__)) ;
4522 void sig_block(int sig) ;
4523 void sig_unblock(int sig) ;
4524 int sigaction_set(int sig, const struct sigaction *act) ;
4525 int sigprocmask_allsigs(int how) ;
4526 smallint bb_got_signal;
4527 void record_signo(int signo);
4528 void xsetgid(gid_t gid) ;
4529 void xsetuid(uid_t uid) ;
4530 void xchdir(const char *path) ;
4531 void xchroot(const char *path) ;
4532 void xsetenv(const char *key, const char *value) ;
4533 void bb_unsetenv(const char *key) ;
4534 void bb_unsetenv_and_free(char *key) ;
4535 void xunlink(const char *pathname) ;
4536 void xstat(const char *pathname, struct stat *buf) ;
4537 void xfstat(int fd, struct stat *buf, const char *errmsg) ;
4538 int xopen(const char *pathname, int flags) ;
4539 int xopen_nonblocking(const char *pathname) ;
4540 int xopen3(const char *pathname, int flags, int mode) ;
4541 int open_or_warn(const char *pathname, int flags) ;
4542 int open3_or_warn(const char *pathname, int flags, int mode) ;
4543 int open_or_warn_stdin(const char *pathname) ;
4544 int xopen_stdin(const char *pathname) ;
4545 void xrename(const char *oldpath, const char *newpath) ;
4546 int rename_or_warn(const char *oldpath, const char *newpath) ;
4547 off_t xlseek(int fd, off_t offset, int whence) ;
4548 int xmkstemp(char *template) ;
4549 off_t fdlength(int fd) ;
4550 uoff_t get_volume_size_in_bytes(int fd,
4551 const char *override,
4552 unsigned override_units,
4553 int extend);
4554 void xpipe(int filedes[2]) ;
4555 struct fd_pair { int rd; int wr; };
4556 typedef int8_t socktype_t;
4557 typedef int8_t family_t;
4558 struct BUG_too_small {
4559 char BUG_socktype_t_too_small[(0
4560 | SOCK_STREAM
4561 | SOCK_DGRAM
4562 | SOCK_RDM
4563 | SOCK_SEQPACKET
4564 | SOCK_RAW
4565 ) <= 127 ? 1 : -1];
4566 char BUG_family_t_too_small[(0
4567 | 0
4568 | 2
4569 | 10
4570 | 1
4571 | 17
4572 | 16
4573 ) <= 127 ? 1 : -1];
4574 };
4575 void parse_datestr(const char *date_str, struct tm *ptm) ;
4576 time_t validate_tm_time(const char *date_str, struct tm *ptm) ;
4577 int xsocket(int domain, int type, int protocol) ;
4578 void xbind(int sockfd, struct sockaddr *my_addr, socklen_t addrlen) ;
4579 void xlisten(int s, int backlog) ;
4580 void xconnect(int s, const struct sockaddr *s_addr, socklen_t addrlen) ;
4581 ssize_t xsendto(int s, const void *buf, size_t len, const struct sockaddr *to,
4582 socklen_t tolen) ;
4583 void setsockopt_reuseaddr(int fd) ;
4584 int setsockopt_broadcast(int fd) ;
4585 int setsockopt_bindtodevice(int fd, const char *iface) ;
4586 unsigned bb_lookup_port(const char *port, const char *protocol, unsigned default_port) ;
4587 typedef struct len_and_sockaddr {
4588 socklen_t len;
4589 union {
4590 struct sockaddr sa;
4591 struct sockaddr_in sin;
4592 } u;
4593 } len_and_sockaddr;
4594 enum {
4595 LSA_LEN_SIZE = __builtin_offsetof (len_and_sockaddr, u),
4596 LSA_SIZEOF_SA = sizeof(
4597 union {
4598 struct sockaddr sa;
4599 struct sockaddr_in sin;
4600 }
4601 )
4602 };
4603 int xsocket_type(len_and_sockaddr **lsap, int sock_type) ;
4604 int xsocket_stream(len_and_sockaddr **lsap) ;
4605 int create_and_bind_stream_or_die(const char *bindaddr, int port) ;
4606 int create_and_bind_dgram_or_die(const char *bindaddr, int port) ;
4607 int create_and_connect_stream_or_die(const char *peer, int port) ;
4608 int xconnect_stream(const len_and_sockaddr *lsa) ;
4609 len_and_sockaddr *get_sock_lsa(int fd) __attribute__ ((malloc));
4610 len_and_sockaddr *get_peer_lsa(int fd) __attribute__ ((malloc));
4611 len_and_sockaddr* host2sockaddr(const char *host, int port) __attribute__ ((malloc));
4612 len_and_sockaddr* xhost2sockaddr(const char *host, int port) __attribute__ ((malloc));
4613 len_and_sockaddr* xdotted2sockaddr(const char *host, int port) __attribute__ ((malloc));
4614 void set_nport(len_and_sockaddr *lsa, unsigned port) ;
4615 int get_nport(const struct sockaddr *sa) ;
4616 char* xmalloc_sockaddr2host(const struct sockaddr *sa) __attribute__ ((malloc));
4617 char* xmalloc_sockaddr2host_noport(const struct sockaddr *sa) __attribute__ ((malloc));
4618 char* xmalloc_sockaddr2hostonly_noport(const struct sockaddr *sa) __attribute__ ((malloc));
4619 char* xmalloc_sockaddr2dotted(const struct sockaddr *sa) __attribute__ ((malloc));
4620 char* xmalloc_sockaddr2dotted_noport(const struct sockaddr *sa) __attribute__ ((malloc));
4621 struct hostent *xgethostbyname(const char *name) ;
4622 void socket_want_pktinfo(int fd) ;
4623 ssize_t send_to_from(int fd, void *buf, size_t len, int flags,
4624 const struct sockaddr *to,
4625 const struct sockaddr *from,
4626 socklen_t tolen) ;
4627 ssize_t recv_from_to(int fd, void *buf, size_t len, int flags,
4628 struct sockaddr *from,
4629 struct sockaddr *to,
4630 socklen_t sa_size) ;
4631 char *xstrdup(const char *s) __attribute__ ((malloc));
4632 char *xstrndup(const char *s, int n) __attribute__ ((malloc));
4633 void overlapping_strcpy(char *dst, const char *src) ;
4634 char *safe_strncpy(char *dst, const char *src, size_t size) ;
4635 char *strncpy_IFNAMSIZ(char *dst, const char *src) ;
4636 int bb_putchar(int ch) ;
4637 int bb_putchar_stderr(char ch) ;
4638 char *xasprintf(const char *format, ...) __attribute__ ((format(printf, 1, 2))) __attribute__ ((malloc));
4639 typedef struct uni_stat_t {
4640 unsigned byte_count;
4641 unsigned unicode_count;
4642 unsigned unicode_width;
4643 } uni_stat_t;
4644 const char* printable_string(uni_stat_t *stats, const char *str);
4645 enum { PRINTABLE_META = 0x100 };
4646 void fputc_printable(int ch, FILE *file) ;
4647 void *malloc_or_warn(size_t size) __attribute__ ((malloc));
4648 void *xmalloc(size_t size) __attribute__ ((malloc));
4649 void *xzalloc(size_t size) __attribute__ ((malloc));
4650 void *xrealloc(void *old, size_t size) ;
4651 void* xrealloc_vector_helper(void *vector, unsigned sizeof_and_shift, int idx) ;
4652 extern ssize_t safe_read(int fd, void *buf, size_t count) ;
4653 extern ssize_t nonblock_safe_read(int fd, void *buf, size_t count) ;
4654 extern ssize_t full_read(int fd, void *buf, size_t count) ;
4655 extern void xread(int fd, void *buf, size_t count) ;
4656 extern unsigned char xread_char(int fd) ;
4657 extern ssize_t read_close(int fd, void *buf, size_t maxsz) ;
4658 extern ssize_t open_read_close(const char *filename, void *buf, size_t maxsz) ;
4659 extern char *xmalloc_reads(int fd, char *pfx, size_t *maxsz_p) ;
4660 extern void *xmalloc_read(int fd, size_t *maxsz_p) __attribute__ ((malloc));
4661 extern void *xmalloc_open_read_close(const char *filename, size_t *maxsz_p) __attribute__ ((malloc));
4662 extern void setup_unzip_on_fd(int fd ) ;
4663 extern int open_zipped(const char *fname) ;
4664 extern void *xmalloc_open_zipped_read_close(const char *fname, size_t *maxsz_p) __attribute__ ((malloc));
4665 extern void *xmalloc_xopen_read_close(const char *filename, size_t *maxsz_p) __attribute__ ((malloc));
4666 extern ssize_t safe_write(int fd, const void *buf, size_t count) ;
4667 extern ssize_t full_write(int fd, const void *buf, size_t count) ;
4668 extern void xwrite(int fd, const void *buf, size_t count) ;
4669 extern void xwrite_str(int fd, const char *str) ;
4670 extern ssize_t full_write1_str(const char *str) ;
4671 extern ssize_t full_write2_str(const char *str) ;
4672 extern void xopen_xwrite_close(const char* file, const char *str) ;
4673 extern void xclose(int fd) ;
4674 extern void xprint_and_close_file(FILE *file) ;
4675 extern char *bb_get_chunk_from_file(FILE *file, int *end) ;
4676 extern char *bb_get_chunk_with_continuation(FILE *file, int *end, int *lineno) ;
4677 extern char *xmalloc_fgets_str(FILE *file, const char *terminating_string) __attribute__ ((malloc));
4678 extern char *xmalloc_fgets_str_len(FILE *file, const char *terminating_string, size_t *maxsz_p) __attribute__ ((malloc));
4679 extern char *xmalloc_fgetline_str(FILE *file, const char *terminating_string) __attribute__ ((malloc));
4680 extern char *xmalloc_fgets(FILE *file) __attribute__ ((malloc));
4681 extern char *xmalloc_fgetline(FILE *file) __attribute__ ((malloc));
4682 void die_if_ferror(FILE *file, const char *msg) ;
4683 void die_if_ferror_stdout(void) ;
4684 int fflush_all(void) ;
4685 void fflush_stdout_and_exit(int retval) __attribute__ ((__noreturn__)) ;
4686 int fclose_if_not_stdin(FILE *file) ;
4687 FILE* xfopen(const char *filename, const char *mode) ;
4688 FILE* fopen_or_warn(const char *filename, const char *mode) ;
4689 FILE* xfopen_stdin(const char *filename) ;
4690 FILE* fopen_or_warn_stdin(const char *filename) ;
4691 FILE* fopen_for_read(const char *path) ;
4692 FILE* xfopen_for_read(const char *path) ;
4693 FILE* fopen_for_write(const char *path) ;
4694 FILE* xfopen_for_write(const char *path) ;
4695 FILE* xfdopen_for_read(int fd) ;
4696 FILE* xfdopen_for_write(int fd) ;
4697 int bb_pstrcmp(const void *a, const void *b) ;
4698 void qsort_string_vector(char **sv, unsigned count) ;
4699 int safe_poll(struct pollfd *ufds, nfds_t nfds, int timeout_ms) ;
4700 char *safe_gethostname(void) ;
4701 char *safe_getdomainname(void) ;
4702 char* str_tolower(char *str) ;
4703 char *utoa(unsigned n) ;
4704 char *itoa(int n) ;
4705 char *utoa_to_buf(unsigned n, char *buf, unsigned buflen) ;
4706 char *itoa_to_buf(int n, char *buf, unsigned buflen) ;
4707 void smart_ulltoa4(unsigned long long ul, char buf[4], const char *scale) ;
4708 void smart_ulltoa5(unsigned long long ul, char buf[5], const char *scale) ;
4709 const char *make_human_readable_str(unsigned long long size,
4710 unsigned long block_size, unsigned long display_unit) ;
4711 char *bin2hex(char *buf, const char *cp, int count) ;
4712 char* hex2bin(char *dst, const char *str, int count) ;
4713 void generate_uuid(uint8_t *buf) ;
4714 struct suffix_mult {
4715 char suffix[4];
4716 unsigned mult;
4717 };
4718 unsigned long long xstrtoull_range_sfx(const char *str, int b, unsigned long long l, unsigned long long u, const struct suffix_mult *sfx) ; unsigned long long xstrtoull_range(const char *str, int b, unsigned long long l, unsigned long long u) ; unsigned long long xstrtoull_sfx(const char *str, int b, const struct suffix_mult *sfx) ; unsigned long long xstrtoull(const char *str, int b) ; unsigned long long xatoull_range_sfx(const char *str, unsigned long long l, unsigned long long u, const struct suffix_mult *sfx) ; unsigned long long xatoull_range(const char *str, unsigned long long l, unsigned long long u) ; unsigned long long xatoull_sfx(const char *str, const struct suffix_mult *sfx) ; unsigned long long xatoull(const char *str) ; long long xstrtoll_range_sfx(const char *str, int b, long long l, long long u, const struct suffix_mult *sfx) ; long long xstrtoll_range(const char *str, int b, long long l, long long u) ; long long xstrtoll(const char *str, int b) ; long long xatoll_range_sfx(const char *str, long long l, long long u, const struct suffix_mult *sfx) ; long long xatoll_range(const char *str, long long l, long long u) ; long long xatoll_sfx(const char *str, const struct suffix_mult *sfx) ; long long xatoll(const char *str) ;
4719 static __attribute__ ((always_inline)) __inline__ unsigned long xstrtoul_range_sfx(const char *str, int b, unsigned long l, unsigned long u, const struct suffix_mult *sfx) { return xstrtoull_range_sfx(str, b, l, u, sfx); } static __attribute__ ((always_inline)) __inline__ unsigned long xstrtoul_range(const char *str, int b, unsigned long l, unsigned long u) { return xstrtoull_range(str, b, l, u); } static __attribute__ ((always_inline)) __inline__ unsigned long xstrtoul_sfx(const char *str, int b, const struct suffix_mult *sfx) { return xstrtoull_sfx(str, b, sfx); } static __attribute__ ((always_inline)) __inline__ unsigned long xstrtoul(const char *str, int b) { return xstrtoull(str, b); } static __attribute__ ((always_inline)) __inline__ unsigned long xatoul_range_sfx(const char *str, unsigned long l, unsigned long u, const struct suffix_mult *sfx) { return xatoull_range_sfx(str, l, u, sfx); } static __attribute__ ((always_inline)) __inline__ unsigned long xatoul_range(const char *str, unsigned long l, unsigned long u) { return xatoull_range(str, l, u); } static __attribute__ ((always_inline)) __inline__ unsigned long xatoul_sfx(const char *str, const struct suffix_mult *sfx) { return xatoull_sfx(str, sfx); } static __attribute__ ((always_inline)) __inline__ unsigned long xatoul(const char *str) { return xatoull(str); } static __attribute__ ((always_inline)) __inline__ long xstrtol_range_sfx(const char *str, int b, long l, long u, const struct suffix_mult *sfx) { return xstrtoll_range_sfx(str, b, l, u, sfx); } static __attribute__ ((always_inline)) __inline__ long xstrtol_range(const char *str, int b, long l, long u) { return xstrtoll_range(str, b, l, u); } static __attribute__ ((always_inline)) __inline__ long xstrtol(const char *str, int b) { return xstrtoll(str, b); } static __attribute__ ((always_inline)) __inline__ long xatol_range_sfx(const char *str, long l, long u, const struct suffix_mult *sfx) { return xatoll_range_sfx(str, l, u, sfx); } static __attribute__ ((always_inline)) __inline__ long xatol_range(const char *str, long l, long u) { return xatoll_range(str, l, u); } static __attribute__ ((always_inline)) __inline__ long xatol_sfx(const char *str, const struct suffix_mult *sfx) { return xatoll_sfx(str, sfx); } static __attribute__ ((always_inline)) __inline__ long xatol(const char *str) { return xatoll(str); }
4720 unsigned int xstrtou_range_sfx(const char *str, int b, unsigned int l, unsigned int u, const struct suffix_mult *sfx) ; unsigned int xstrtou_range(const char *str, int b, unsigned int l, unsigned int u) ; unsigned int xstrtou_sfx(const char *str, int b, const struct suffix_mult *sfx) ; unsigned int xstrtou(const char *str, int b) ; unsigned int xatou_range_sfx(const char *str, unsigned int l, unsigned int u, const struct suffix_mult *sfx) ; unsigned int xatou_range(const char *str, unsigned int l, unsigned int u) ; unsigned int xatou_sfx(const char *str, const struct suffix_mult *sfx) ; unsigned int xatou(const char *str) ; int xstrtoi_range_sfx(const char *str, int b, int l, int u, const struct suffix_mult *sfx) ; int xstrtoi_range(const char *str, int b, int l, int u) ; int xstrtoi(const char *str, int b) ; int xatoi_range_sfx(const char *str, int l, int u, const struct suffix_mult *sfx) ; int xatoi_range(const char *str, int l, int u) ; int xatoi_sfx(const char *str, const struct suffix_mult *sfx) ; int xatoi(const char *str) ;
4721 uint32_t BUG_xatou32_unimplemented(void);
4722 static __attribute__ ((always_inline)) __inline__ uint32_t xatou32(const char *numstr)
4723 {
4724 if ((2147483647 * 2U + 1U) == 0xffffffff)
4725 return xatou(numstr);
4726 if ((9223372036854775807L * 2UL + 1UL) == 0xffffffff)
4727 return xatoul(numstr);
4728 return BUG_xatou32_unimplemented();
4729 }
4730 unsigned long long bb_strtoull(const char *arg, char **endp, int base) ;
4731 long long bb_strtoll(const char *arg, char **endp, int base) ;
4732 static __attribute__ ((always_inline)) __inline__
4733 unsigned long bb_strtoul(const char *arg, char **endp, int base)
4734 { return bb_strtoull(arg, endp, base); }
4735 static __attribute__ ((always_inline)) __inline__
4736 long bb_strtol(const char *arg, char **endp, int base)
4737 { return bb_strtoll(arg, endp, base); }
4738 unsigned bb_strtou(const char *arg, char **endp, int base) ;
4739 int bb_strtoi(const char *arg, char **endp, int base) ;
4740 uint32_t BUG_bb_strtou32_unimplemented(void);
4741 static __attribute__ ((always_inline)) __inline__
4742 uint32_t bb_strtou32(const char *arg, char **endp, int base)
4743 {
4744 if (sizeof(uint32_t) == sizeof(unsigned))
4745 return bb_strtou(arg, endp, base);
4746 if (sizeof(uint32_t) == sizeof(unsigned long))
4747 return bb_strtoul(arg, endp, base);
4748 return BUG_bb_strtou32_unimplemented();
4749 }
4750 double bb_strtod(const char *arg, char **endp) ;
4751 int xatoi_positive(const char *numstr) ;
4752 uint16_t xatou16(const char *numstr) ;
4753 long xuname2uid(const char *name) ;
4754 long xgroup2gid(const char *name) ;
4755 unsigned long get_ug_id(const char *s, long (*xname2id)(const char *)) ;
4756 struct bb_uidgid_t {
4757 uid_t uid;
4758 gid_t gid;
4759 };
4760 int get_uidgid(struct bb_uidgid_t*, const char*, int numeric_ok) ;
4761 void xget_uidgid(struct bb_uidgid_t*, const char*) ;
4762 void parse_chown_usergroup_or_die(struct bb_uidgid_t *u, char *user_group) ;
4763 struct passwd* xgetpwnam(const char *name) ;
4764 struct group* xgetgrnam(const char *name) ;
4765 struct passwd* xgetpwuid(uid_t uid) ;
4766 struct group* xgetgrgid(gid_t gid) ;
4767 char* xuid2uname(uid_t uid) ;
4768 char* xgid2group(gid_t gid) ;
4769 char* uid2uname(uid_t uid) ;
4770 char* gid2group(gid_t gid) ;
4771 char* uid2uname_utoa(long uid) ;
4772 char* gid2group_utoa(long gid) ;
4773 const char* get_cached_username(uid_t uid) ;
4774 const char* get_cached_groupname(gid_t gid) ;
4775 void clear_username_cache(void) ;
4776 enum { USERNAME_MAX_SIZE = 16 - sizeof(int) };
4777 void write_new_utmp(pid_t pid, int new_type, const char *tty_name, const char *username, const char *hostname);
4778 void update_utmp(pid_t pid, int new_type, const char *tty_name, const char *username, const char *hostname);
4779 int execable_file(const char *name) ;
4780 char *find_execable(const char *filename, char **PATHp) ;
4781 int exists_execable(const char *filename) ;
4782 int bb_execvp(const char *file, char *const argv[]) ;
4783 int BB_EXECVP_or_die(char **argv) __attribute__ ((__noreturn__)) ;
4784 pid_t xfork(void) ;
4785 pid_t spawn(char **argv) ;
4786 pid_t xspawn(char **argv) ;
4787 pid_t safe_waitpid(pid_t pid, int *wstat, int options) ;
4788 pid_t wait_any_nohang(int *wstat) ;
4789 int wait4pid(pid_t pid) ;
4790 int spawn_and_wait(char **argv) ;
4791 struct nofork_save_area {
4792 jmp_buf die_jmp;
4793 const char *applet_name;
4794 uint32_t option_mask32;
4795 int die_sleep;
4796 uint8_t xfunc_error_retval;
4797 smallint saved;
4798 };
4799 void save_nofork_data(struct nofork_save_area *save) ;
4800 void restore_nofork_data(struct nofork_save_area *save) ;
4801 int run_nofork_applet(int applet_no, char **argv) ;
4802 int run_nofork_applet_prime(struct nofork_save_area *old, int applet_no, char **argv) ;
4803 enum {
4804 DAEMON_CHDIR_ROOT = 1,
4805 DAEMON_DEVNULL_STDIO = 2,
4806 DAEMON_CLOSE_EXTRA_FDS = 4,
4807 DAEMON_ONLY_SANITIZE = 8,
4808 };
4809 enum { re_execed = 0 };
4810 void bb_daemonize_or_rexec(int flags) ;
4811 void bb_sanitize_stdio(void) ;
4812 int sanitize_env_if_suid(void) ;
4813 char* single_argv(char **argv) ;
4814 extern const char *const bb_argv_dash[];
4815 extern const char *opt_complementary;
4816 extern const char *applet_long_options;
4817 extern uint32_t option_mask32;
4818 extern uint32_t getopt32(char **argv, const char *applet_opts, ...) ;
4819 typedef struct llist_t {
4820 char *data;
4821 struct llist_t *link;
4822 } llist_t;
4823 void llist_add_to(llist_t **old_head, void *data) ;
4824 void llist_add_to_end(llist_t **list_head, void *data) ;
4825 void *llist_pop(llist_t **elm) ;
4826 void llist_unlink(llist_t **head, llist_t *elm) ;
4827 void llist_free(llist_t *elm, void (*freeit)(void *data)) ;
4828 llist_t *llist_rev(llist_t *list) ;
4829 llist_t *llist_find_str(llist_t *first, const char *str) ;
4830 extern smallint wrote_pidfile;
4831 void write_pidfile(const char *path) ;
4832 enum {
4833 LOGMODE_NONE = 0,
4834 LOGMODE_STDIO = (1 << 0),
4835 LOGMODE_SYSLOG = (1 << 1) * 0,
4836 LOGMODE_BOTH = LOGMODE_SYSLOG + LOGMODE_STDIO,
4837 };
4838 extern const char *msg_eol;
4839 extern smallint logmode;
4840 extern int die_sleep;
4841 extern uint8_t xfunc_error_retval;
4842 extern jmp_buf die_jmp;
4843 extern void xfunc_die(void) __attribute__ ((__noreturn__)) ;
4844 extern void bb_show_usage(void) __attribute__ ((__noreturn__)) ;
4845 extern void bb_error_msg(const char *s, ...) __attribute__ ((format (printf, 1, 2))) ;
4846 extern void bb_error_msg_and_die(const char *s, ...) __attribute__ ((noreturn, format (printf, 1, 2))) ;
4847 extern void bb_perror_msg(const char *s, ...) __attribute__ ((format (printf, 1, 2))) ;
4848 extern void bb_simple_perror_msg(const char *s) ;
4849 extern void bb_perror_msg_and_die(const char *s, ...) __attribute__ ((noreturn, format (printf, 1, 2))) ;
4850 extern void bb_simple_perror_msg_and_die(const char *s) __attribute__ ((__noreturn__)) ;
4851 extern void bb_herror_msg(const char *s, ...) __attribute__ ((format (printf, 1, 2))) ;
4852 extern void bb_herror_msg_and_die(const char *s, ...) __attribute__ ((noreturn, format (printf, 1, 2))) ;
4853 extern void bb_perror_nomsg_and_die(void) __attribute__ ((__noreturn__)) ;
4854 extern void bb_perror_nomsg(void) ;
4855 extern void bb_info_msg(const char *s, ...) __attribute__ ((format (printf, 1, 2))) ;
4856 extern void bb_verror_msg(const char *s, va_list p, const char *strerr) ;
4857 int bb_cat(char** argv);
4858 int echo_main(int argc, char** argv) ;
4859 int printf_main(int argc, char **argv) ;
4860 int test_main(int argc, char **argv) ;
4861 int kill_main(int argc, char **argv) ;
4862 int chown_main(int argc, char **argv) ;
4863 int ls_main(int argc, char **argv) ;
4864 int gunzip_main(int argc, char **argv) ;
4865 int bunzip2_main(int argc, char **argv) ;
4866 int create_icmp_socket(void) ;
4867 int create_icmp6_socket(void) ;
4868 struct aftype {
4869 const char *name;
4870 const char *title;
4871 int af;
4872 int alen;
4873 char* (*print)(unsigned char *);
4874 const char* (*sprint)(struct sockaddr *, int numeric);
4875 int (*input)( const char *bufp, struct sockaddr *);
4876 void (*herror)(char *text);
4877 int (*rprint)(int options);
4878 int (*rinput)(int typ, int ext, char **argv);
4879 int (*getmask)(char *src, struct sockaddr *mask, char *name);
4880 };
4881 struct hwtype {
4882 const char *name;
4883 const char *title;
4884 int type;
4885 int alen;
4886 char* (*print)(unsigned char *);
4887 int (*input)(const char *, struct sockaddr *);
4888 int (*activate)(int fd);
4889 int suppress_null_addr;
4890 };
4891 extern smallint interface_opt_a;
4892 int display_interfaces(char *ifname) ;
4893 int in_ib(const char *bufp, struct sockaddr *sap) ;
4894 const struct aftype *get_aftype(const char *name) ;
4895 const struct hwtype *get_hwtype(const char *name) ;
4896 const struct hwtype *get_hwntype(int type) ;
4897 extern int find_applet_by_name(const char *name) ;
4898 extern void run_applet_and_exit(const char *name, char **argv) ;
4899 extern void run_applet_no_and_exit(int a, char **argv) __attribute__ ((__noreturn__)) ;
4900 extern int match_fstype(const struct mntent *mt, const char *fstypes) ;
4901 extern struct mntent *find_mount_point(const char *name, int subdir_too) ;
4902 extern void erase_mtab(const char * name) ;
4903 extern unsigned int tty_baud_to_value(speed_t speed) ;
4904 extern speed_t tty_value_to_baud(unsigned int value) ;
4905 extern void bb_warn_ignoring_args(char *arg) ;
4906 extern int get_linux_version_code(void) ;
4907 extern char *query_loop(const char *device) ;
4908 extern int del_loop(const char *device) ;
4909 extern int set_loop(char **devname, const char *file, unsigned long long offset) ;
4910 char *bb_ask_stdin(const char * prompt) ;
4911 char *bb_ask(const int fd, int timeout, const char * prompt) ;
4912 int bb_ask_confirmation(void) ;
4913 int bb_parse_mode(const char* s, mode_t* theMode) ;
4914 enum {
4915 PARSE_COLLAPSE = 0x00010000,
4916 PARSE_TRIM = 0x00020000,
4917 PARSE_GREEDY = 0x00040000,
4918 PARSE_MIN_DIE = 0x00100000,
4919 PARSE_KEEP_COPY = 0x00200000 * 0,
4920 PARSE_NORMAL = PARSE_COLLAPSE | PARSE_TRIM | PARSE_GREEDY,
4921 };
4922 typedef struct parser_t {
4923 FILE *fp;
4924 char *line;
4925 char *data;
4926 int lineno;
4927 } parser_t;
4928 parser_t* config_open(const char *filename) ;
4929 parser_t* config_open2(const char *filename, FILE* (*fopen_func)(const char *path)) ;
4930 int config_read(parser_t *parser, char **tokens, unsigned flags, const char *delims) ;
4931 void config_close(parser_t *parser) ;
4932 char *concat_path_file(const char *path, const char *filename) ;
4933 char *concat_subpath_file(const char *path, const char *filename) ;
4934 const char *bb_basename(const char *name) ;
4935 char *last_char_is(const char *s, int c) ;
4936 int bb_make_directory(char *path, long mode, int flags) ;
4937 int get_signum(const char *name) ;
4938 const char *get_signame(int number) ;
4939 void print_signames(void) ;
4940 char *bb_simplify_path(const char *path) ;
4941 char *bb_simplify_abs_path_inplace(char *path) ;
4942 extern void bb_do_delay(int seconds) ;
4943 extern void change_identity(const struct passwd *pw) ;
4944 extern void run_shell(const char *shell, int loginshell, const char *command, const char **additional_args) __attribute__ ((__noreturn__)) ;
4945 extern void selinux_or_die(void) ;
4946 extern void setup_environment(const char *shell, int flags, const struct passwd *pw) ;
4947 extern int correct_password(const struct passwd *pw) ;
4948 extern char *pw_encrypt(const char *clear, const char *salt) ;
4949 extern int obscure(const char *old, const char *newval, const struct passwd *pwdp) ;
4950 extern int crypt_make_salt(char *p, int cnt, int rnd) ;
4951 extern int update_passwd(const char *filename, const char *username, const char *data)
4952 ;
4953 int index_in_str_array(const char *const string_array[], const char *key) ;
4954 int index_in_strings(const char *strings, const char *key) ;
4955 int index_in_substr_array(const char *const string_array[], const char *key) ;
4956 int index_in_substrings(const char *strings, const char *key) ;
4957 const char *nth_string(const char *strings, int n) ;
4958 extern void print_login_issue(const char *issue_file, const char *tty) ;
4959 extern void print_login_prompt(void) ;
4960 char *xmalloc_ttyname(int fd) __attribute__ ((malloc));
4961 int get_terminal_width_height(int fd, unsigned *width, unsigned *height) ;
4962 int tcsetattr_stdin_TCSANOW(const struct termios *tp) ;
4963 int ioctl_or_perror(int fd, unsigned request, void *argp, const char *fmt,...) __attribute__ ((format (printf, 4, 5))) ;
4964 int ioctl_or_perror_and_die(int fd, unsigned request, void *argp, const char *fmt,...) __attribute__ ((format (printf, 4, 5))) ;
4965 int bb_ioctl_or_warn(int fd, unsigned request, void *argp, const char *ioctl_name) ;
4966 int bb_xioctl(int fd, unsigned request, void *argp, const char *ioctl_name) ;
4967 char *is_in_ino_dev_hashtable(const struct stat *statbuf) ;
4968 void add_to_ino_dev_hashtable(const struct stat *statbuf, const char *name) ;
4969 void reset_ino_dev_hashtable(void) ;
4970 unsigned long long bb_makedev(unsigned int major, unsigned int minor) ;
4971 enum {
4972 KEYCODE_UP = -2,
4973 KEYCODE_DOWN = -3,
4974 KEYCODE_RIGHT = -4,
4975 KEYCODE_LEFT = -5,
4976 KEYCODE_HOME = -6,
4977 KEYCODE_END = -7,
4978 KEYCODE_INSERT = -8,
4979 KEYCODE_DELETE = -9,
4980 KEYCODE_PAGEUP = -10,
4981 KEYCODE_PAGEDOWN = -11,
4982 KEYCODE_CTRL_UP = KEYCODE_UP & ~0x40,
4983 KEYCODE_CTRL_DOWN = KEYCODE_DOWN & ~0x40,
4984 KEYCODE_CTRL_RIGHT = KEYCODE_RIGHT & ~0x40,
4985 KEYCODE_CTRL_LEFT = KEYCODE_LEFT & ~0x40,
4986 KEYCODE_CURSOR_POS = -0x100,
4987 KEYCODE_BUFFER_SIZE = 16
4988 };
4989 int64_t read_key(int fd, char *buffer, int timeout) ;
4990 void read_key_ungets(char *buffer, const char *str, unsigned len) ;
4991 typedef struct line_input_t {
4992 int flags;
4993 const char *path_lookup;
4994 int cnt_history;
4995 int cur_history;
4996 unsigned cnt_history_in_file;
4997 const char *hist_file;
4998 char *history[(255 + 0) + 1];
4999 } line_input_t;
5000 enum {
5001 DO_HISTORY = 1 * ((255 + 0) > 0),
5002 SAVE_HISTORY = 2 * ((255 + 0) > 0) * 1,
5003 TAB_COMPLETION = 4 * 1,
5004 USERNAME_COMPLETION = 8 * 1,
5005 VI_MODE = 0x10 * 1,
5006 WITH_PATH_LOOKUP = 0x20,
5007 FOR_SHELL = DO_HISTORY | SAVE_HISTORY | TAB_COMPLETION | USERNAME_COMPLETION,
5008 };
5009 line_input_t *new_line_input_t(int flags) ;
5010 int read_line_input(const char* prompt, char* command, int maxsize, line_input_t *state) ;
5011 enum { COMM_LEN = 16 };
5012 struct smaprec {
5013 unsigned long mapped_rw;
5014 unsigned long mapped_ro;
5015 unsigned long shared_clean;
5016 unsigned long shared_dirty;
5017 unsigned long private_clean;
5018 unsigned long private_dirty;
5019 unsigned long stack;
5020 unsigned long smap_pss, smap_swap;
5021 unsigned long smap_size;
5022 unsigned long smap_start;
5023 char smap_mode[5];
5024 char *smap_name;
5025 };
5026 int procps_read_smaps(pid_t pid, struct smaprec *total)
5027 ;
5028 typedef struct procps_status_t {
5029 DIR *dir;
5030 uint8_t shift_pages_to_bytes;
5031 uint8_t shift_pages_to_kb;
5032 uint16_t argv_len;
5033 char *argv0;
5034 char *exe;
5035 unsigned long vsz, rss;
5036 unsigned long stime, utime;
5037 unsigned long start_time;
5038 unsigned pid;
5039 unsigned ppid;
5040 unsigned pgid;
5041 unsigned sid;
5042 unsigned uid;
5043 unsigned gid;
5044 unsigned tty_major,tty_minor;
5045 char state[4];
5046 char comm[COMM_LEN];
5047 } procps_status_t;
5048 enum {
5049 PSSCAN_PID = 1 << 0,
5050 PSSCAN_PPID = 1 << 1,
5051 PSSCAN_PGID = 1 << 2,
5052 PSSCAN_SID = 1 << 3,
5053 PSSCAN_UIDGID = 1 << 4,
5054 PSSCAN_COMM = 1 << 5,
5055 PSSCAN_ARGV0 = 1 << 7,
5056 PSSCAN_EXE = 1 << 8,
5057 PSSCAN_STATE = 1 << 9,
5058 PSSCAN_VSZ = 1 << 10,
5059 PSSCAN_RSS = 1 << 11,
5060 PSSCAN_STIME = 1 << 12,
5061 PSSCAN_UTIME = 1 << 13,
5062 PSSCAN_TTY = 1 << 14,
5063 PSSCAN_SMAPS = (1 << 15) * 0,
5064 PSSCAN_ARGVN = (1 << 16) * (0
5065 || 0 || 0
5066 || 0
5067 || 0
5068 ),
5069 PSSCAN_CONTEXT = (1 << 17) * 0,
5070 PSSCAN_START_TIME = 1 << 18,
5071 PSSCAN_CPU = (1 << 19) * 0,
5072 PSSCAN_NICE = (1 << 20) * 0,
5073 PSSCAN_RUIDGID = (1 << 21) * 0,
5074 PSSCAN_TASKS = (1 << 22) * 0,
5075 PSSCAN_STAT = PSSCAN_PPID | PSSCAN_PGID | PSSCAN_SID
5076 | PSSCAN_COMM | PSSCAN_STATE
5077 | PSSCAN_VSZ | PSSCAN_RSS
5078 | PSSCAN_STIME | PSSCAN_UTIME | PSSCAN_START_TIME
5079 | PSSCAN_TTY | PSSCAN_NICE
5080 | PSSCAN_CPU
5081 };
5082 void free_procps_scan(procps_status_t* sp) ;
5083 procps_status_t* procps_scan(procps_status_t* sp, int flags) ;
5084 void read_cmdline(char *buf, int size, unsigned pid, const char *comm) ;
5085 pid_t *find_pid_by_name(const char* procName) ;
5086 pid_t *pidlist_reverse(pid_t *pidList) ;
5087 int starts_with_cpu(const char *str) ;
5088 unsigned get_cpu_count(void) ;
5089 extern const char bb_uuenc_tbl_base64[];
5090 extern const char bb_uuenc_tbl_std[];
5091 void bb_uuencode(char *store, const void *s, int length, const char *tbl) ;
5092 enum {
5093 BASE64_FLAG_UU_STOP = 0x100,
5094 BASE64_FLAG_NO_STOP_CHAR = 0x80,
5095 };
5096 void read_base64(FILE *src_stream, FILE *dst_stream, int flags);
5097 typedef struct md5_ctx_t {
5098 uint8_t wbuffer[64];
5099 void (*process_block)(struct md5_ctx_t*) ;
5100 uint64_t total64;
5101 uint32_t hash[8];
5102 } md5_ctx_t;
5103 typedef struct md5_ctx_t sha1_ctx_t;
5104 typedef struct md5_ctx_t sha256_ctx_t;
5105 typedef struct sha512_ctx_t {
5106 uint64_t total64[2];
5107 uint64_t hash[8];
5108 uint8_t wbuffer[128];
5109 } sha512_ctx_t;
5110 void md5_begin(md5_ctx_t *ctx) ;
5111 void md5_hash(md5_ctx_t *ctx, const void *data, size_t length) ;
5112 void md5_end(md5_ctx_t *ctx, void *resbuf) ;
5113 void sha1_begin(sha1_ctx_t *ctx) ;
5114 void sha1_end(sha1_ctx_t *ctx, void *resbuf) ;
5115 void sha256_begin(sha256_ctx_t *ctx) ;
5116 void sha512_begin(sha512_ctx_t *ctx) ;
5117 void sha512_hash(sha512_ctx_t *ctx, const void *buffer, size_t len) ;
5118 void sha512_end(sha512_ctx_t *ctx, void *resbuf) ;
5119 extern uint32_t *global_crc32_table;
5120 uint32_t *crc32_filltable(uint32_t *tbl256, int endian) ;
5121 uint32_t crc32_block_endian1(uint32_t val, const void *buf, unsigned len, uint32_t *crc_table) ;
5122 uint32_t crc32_block_endian0(uint32_t val, const void *buf, unsigned len, uint32_t *crc_table) ;
5123 typedef struct masks_labels_t {
5124 const char *labels;
5125 const int masks[];
5126 } masks_labels_t;
5127 int print_flags_separated(const int *masks, const char *labels,
5128 int flags, const char *separator) ;
5129 int print_flags(const masks_labels_t *ml, int flags) ;
5130 typedef struct bb_progress_t {
5131 off_t lastsize;
5132 unsigned lastupdate_sec;
5133 unsigned start_sec;
5134 smallint inited;
5135 } bb_progress_t;
5136 void bb_progress_init(bb_progress_t *p) ;
5137 void bb_progress_update(bb_progress_t *p, const char *curfile,
5138 off_t beg_range, off_t transferred,
5139 off_t totalsize) ;
5140 extern const char *applet_name;
5141 extern const char bb_banner[];
5142 extern const char bb_msg_memory_exhausted[];
5143 extern const char bb_msg_invalid_date[];
5144 extern const char bb_msg_unknown[];
5145 extern const char bb_msg_can_not_create_raw_socket[];
5146 extern const char bb_msg_perm_denied_are_you_root[];
5147 extern const char bb_msg_you_must_be_root[];
5148 extern const char bb_msg_requires_arg[];
5149 extern const char bb_msg_invalid_arg[];
5150 extern const char bb_msg_standard_input[];
5151 extern const char bb_msg_standard_output[];
5152 extern const char bb_hexdigits_upcase[];
5153 extern const char bb_path_wtmp_file[];
5154 extern const char bb_busybox_exec_path[];
5155 extern const char bb_PATH_root_path[];
5156 extern const int const_int_0;
5157 extern const int const_int_1;
5158 enum { COMMON_BUFSIZE = (8192 >= 256*sizeof(void*) ? 8192 +1 : 256*sizeof(void*)) };
5159 char bb_common_bufsiz1[COMMON_BUFSIZE];
5160 struct globals;
5161 extern struct globals *const ptr_to_globals;
5162 extern const char bb_default_login_shell[];
5163 static __attribute__ ((always_inline)) __inline__ int bb_ascii_isalnum(unsigned char a)
5164 {
5165 unsigned char b = a - '0';
5166 if (b <= 9)
5167 return (b <= 9);
5168 b = (a|0x20) - 'a';
5169 return b <= 'z' - 'a';
5170 }
5171 static __attribute__ ((always_inline)) __inline__ int bb_ascii_isxdigit(unsigned char a)
5172 {
5173 unsigned char b = a - '0';
5174 if (b <= 9)
5175 return (b <= 9);
5176 b = (a|0x20) - 'a';
5177 return b <= 'f' - 'a';
5178 }
5179 static __attribute__ ((always_inline)) __inline__ unsigned char bb_ascii_toupper(unsigned char a)
5180 {
5181 unsigned char b = a - 'a';
5182 if (b <= ('z' - 'a'))
5183 a -= 'a' - 'A';
5184 return a;
5185 }
5186 static __attribute__ ((always_inline)) __inline__ unsigned char bb_ascii_tolower(unsigned char a)
5187 {
5188 unsigned char b = a - 'A';
5189 if (b <= ('Z' - 'A'))
5190 a += 'a' - 'A';
5191 return a;
5192 }
5193 enum {
5194 ERR_OK = 0,
5195 ERR_MEM,
5196 ERR_IO,
5197 ERR_TIMEOUT,
5198 ERR_ABORT,
5199 };
5200 static void signal_handler(__attribute__ ((__unused__)) int signo)
5201 {
5202 bb_got_signal = ERR_IO;
5203 }
5204 /*
5205 static size_t unescape(char *s)
5206 {
5207 char *start = s;
5208 char *p = s;
5209 while (*s) {
5210 char c = *s;
5211 if ('\\' == c) {
5212 c = *++s;
5213 if (c) {
5214 if ('N' == c) {
5215 c = '\0';
5216 } else if ('s' == c) {
5217 c = ' ';
5218 } else {
5219 c = bb_process_escape_sequence((const char **)&s);
5220 s--;
5221 }
5222 }
5223 } else if ('^' == c) {
5224 c = *++s-'@';
5225 }
5226 *p++ = c;
5227 s++;
5228 }
5229 *p = '\0';
5230 return p - start;
5231 }
5232 */
5233 int main(int argc __attribute__ ((__unused__)), char **argv)
5234 {
5235 int record_fd = -1;
5236 _Bool echo = 0;
5237 llist_t *aborts = ((void *)0);
5238 int timeout = 45*1000;
5239 enum {
5240 DIR_HANGUP = 0,
5241 DIR_ABORT,
5242 DIR_TIMEOUT,
5243 DIR_ECHO,
5244 DIR_SAY,
5245 DIR_RECORD,
5246 };
5247 argv++;
5248 while (*argv) {
5249 int key;
5250 if (key >= 0) {
5251 char *arg = *++argv;
5252 _Bool onoff = (0 != __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ("OFF") && __builtin_constant_p (arg) && (__s1_len = strlen ("OFF"), __s2_len = strlen (arg), (!((size_t)(const void *)(("OFF") + 1) - (size_t)(const void *)("OFF") == 1) || __s1_len >= 4) && (!((size_t)(const void *)((arg) + 1) - (size_t)(const void *)(arg) == 1) || __s2_len >= 4)) ? __builtin_strcmp ("OFF", arg) : (__builtin_constant_p ("OFF") && ((size_t)(const void *)(("OFF") + 1) - (size_t)(const void *)("OFF") == 1) && (__s1_len = strlen ("OFF"), __s1_len < 4) ? (__builtin_constant_p (arg) && ((size_t)(const void *)((arg) + 1) - (size_t)(const void *)(arg) == 1) ? __builtin_strcmp ("OFF", arg) : (__extension__ ({ const unsigned char *__s2 = (const unsigned char *) (const char *) (arg); register int __result = (((const unsigned char *) (const char *) ("OFF"))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((const unsigned char *) (const char *) ("OFF"))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((const unsigned char *) (const char *) ("OFF"))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((const unsigned char *) (const char *) ("OFF"))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p (arg) && ((size_t)(const void *)((arg) + 1) - (size_t)(const void *)(arg) == 1) && (__s2_len = strlen (arg), __s2_len < 4) ? (__builtin_constant_p ("OFF") && ((size_t)(const void *)(("OFF") + 1) - (size_t)(const void *)("OFF") == 1) ? __builtin_strcmp ("OFF", arg) : (__extension__ ({ const unsigned char *__s1 = (const unsigned char *) (const char *) ("OFF"); register int __result = __s1[0] - ((const unsigned char *) (const char *) (arg))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((const unsigned char *) (const char *) (arg))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((const unsigned char *) (const char *) (arg))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((const unsigned char *) (const char *) (arg))[3]); } } __result; }))) : __builtin_strcmp ("OFF", arg)))); }));
5253 if (DIR_HANGUP == key) {
5254 signal(1, onoff ? signal_handler : ((__sighandler_t) 1));
5255
5256 } else if (DIR_TIMEOUT == key) {
5257 timeout = atoi(arg) * 1000;
5258 if (!timeout)
5259 timeout = 45*1000;
5260 } else if (DIR_ECHO == key) {
5261 echo = onoff;
5262 } else if (DIR_RECORD == key) {
5263 if (record_fd > 0)
5264 close(record_fd);
5265 } else if (DIR_SAY == key) {
5266 }
5267 argv++;
5268 } else {
5269 int expect_len;
5270 size_t buf_len = 0;
5271 size_t max_len = 50;
5272 struct pollfd pfd;
5273 char *expect = *argv++;
5274 if (!expect)
5275 goto expect_done;
5276 // expect_len = unescape(expect);
5277 if (expect_len > max_len)
5278 max_len = expect_len;
5279 if (!expect_len)
5280 goto expect_done;
5281 if (max_len >= COMMON_BUFSIZE) {
5282 bb_got_signal = ERR_MEM;
5283 goto expect_done;
5284 }
5285 pfd.fd = 0;
5286 pfd.events = 0x001;
5287 while (!bb_got_signal
5288 && poll(&pfd, 1, timeout) > 0
5289 && (pfd.revents & 0x001)
5290 ) {
5291 llist_t *l;
5292 ssize_t delta;
5293 if (read(0, bb_common_bufsiz1+buf_len, 1) > 0) {
5294 buf_len++;
5295 if (buf_len > COMMON_BUFSIZE) {
5296 memmove(bb_common_bufsiz1, bb_common_bufsiz1+buf_len-max_len, max_len);
5297 buf_len = max_len;
5298 }
5299 }
5300 for (l = aborts, bb_got_signal = ERR_ABORT; l; l = l->link, ++bb_got_signal) {
5301 size_t len = strlen(l->data);
5302 delta = buf_len-len;
5303 if (delta >= 0 && !memcmp(bb_common_bufsiz1+delta, l->data, len))
5304 goto expect_done;
5305 }
5306 bb_got_signal = ERR_OK;
5307 delta = buf_len - expect_len;
5308 if (delta >= 0 && !memcmp(bb_common_bufsiz1+delta, expect, expect_len))
5309 goto expect_done;
5310 }
5311 bb_got_signal = ERR_TIMEOUT;
5312 expect_done:
5313 if (bb_got_signal)
5314 break;
5315 if (*argv) {
5316 char *loaded = ((void *)0);
5317 size_t len;
5318 char *buf = *argv++;
5319 if ('@' == *buf) {
5320 }
5321 // len = unescape(buf);
5322 alarm(timeout);
5323 pfd.fd = 1;
5324 pfd.events = 0x004;
5325 alarm(0);
5326 if (len)
5327 bb_got_signal = ERR_IO;
5328 if (loaded)
5329 free(loaded);
5330 if (bb_got_signal)
5331 break;
5332 }
5333 }
5334 }
5335 return bb_got_signal;
5336 }