bblum
public text v1 · immutable#define _GNU_SOURCE#include <sched.h>#include <unistd.h>#include <stdio.h>#include <stdlib.h>#include <sys/syscall.h>#define STACK_SIZE 4096char stack[STACK_SIZE];int foobar(void *arg){ printf("thread %lu\n", (unsigned long)arg); fflush(stdout); while (1) pause(); return 0;}int main(){ unsigned long i; clone(foobar, stack, CLONE_THREAD | CLONE_VM | CLONE_SIGHAND, (void *)i); syscall(__NR_exit, 0);}