summaryrefslogtreecommitdiff
path: root/src/user/lib/thread.c
blob: f7353adf692ed9a45ddfc649ebea6378bb29b093 (plain)
1
2
3
4
5
6
7
8
9
10
11
#include <camellia/flags.h>
#include <camellia/syscalls.h>
#include <stdlib.h>
#include <user/lib/thread.h>

void thread_create(int flags, void (*fn)(void*), void *arg) {
	if (!_syscall_fork(flags | FORK_SHAREMEM | FORK_SHAREHANDLE, NULL)) {
		void *stack = malloc(4096);
		chstack(arg, fn, stack + 4096);
	}
}