14 char ill_buf[] = { 0xf0, 0x00, 0x00, 0xf0 };
15 #elif defined(__aarch64__)
16 char ill_buf[] = { 0x22, 0x00, 0x00, 0xf9 };
17 #elif defined(__i386__) || defined(__x86_64__)
18 char ill_buf[] = { 0x06, 0x00, 0x00, 0x00 };
20 #error "Unsupported architecture"
23 int main(int ac, char *av[]);
27 int bar(int a, int b){
44 int allocate(size_t amount) {
46 memory = malloc(amount);
51 for (i=0; i < amount/sizeof(size_t); i++) {
57 int str_ends_with(const char *str, const char *suffix)
61 size_t lenstr = strlen(str);
62 size_t lensuffix = strlen(suffix);
63 if (lensuffix > lenstr)
65 return strncmp(str + lenstr - lensuffix, suffix, lensuffix) == 0;
68 int main(int ac, char* av[])
70 if (str_ends_with(av[0], "-sleep"))
72 else if (str_ends_with(av[0], "-ill"))
74 baz = mmap(0, sizeof(ill_buf), PROT_READ|PROT_WRITE|PROT_EXEC,
75 MAP_PRIVATE|MAP_ANON, -1, 0);
76 memcpy(baz, ill_buf, sizeof(ill_buf));
77 allocate(256*1024*1024);