]> git.wh0rd.org Git - ICEs.git/blob - 353816/busybox.i.1
more
[ICEs.git] / 353816 / busybox.i.1
1
2 typedef long unsigned int size_t;
3 extern __inline __attribute__ ((__always_inline__))
4     __attribute__ ((__gnu_inline__, __artificial__))
5 void *
6     __attribute__ ((__nothrow__)) memmove(void *__dest, const void *__src,
7                                           size_t __len)
8 {
9         return __builtin___memmove_chk(__dest, __src, __len,
10                                        __builtin_object_size(__dest, 0));
11 }
12
13 struct pollfd {
14         short int revents;
15 };
16 char bb_got_signal;
17 char bb_common_bufsiz1[8192];
18 int main(int argc __attribute__ ((__unused__)), char **argv)
19 {
20         int timeout = 45 * 1000;
21         while (*argv) {
22                         char *arg = *++argv;
23                         size_t buf_len = 0;
24                         size_t max_len = 50;
25                         struct pollfd pfd;
26                         while (!bb_got_signal && poll(&pfd, 1, timeout) > 0
27                                && (pfd.revents & 0x001)) {
28                                 if (read(0, bb_common_bufsiz1 + buf_len, 1) > 0) {
29                                         if (buf_len > sizeof(bb_common_bufsiz1)) {
30                                                 memmove(bb_common_bufsiz1,
31                                                         bb_common_bufsiz1 +
32                                                         buf_len - max_len,
33                                                         max_len);
34                                         }
35                                 }
36                 }
37         }
38 }