All pastes #1736517 Raw Edit

bblum

public text v1 · immutable
#1736517 ·published 2010-01-03 19:39 UTC
rendered paste body
#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);}