summaryrefslogtreecommitdiff
path: root/src/user/lib/thread.c
blob: 25d98a9653c2ff511f681b1c6a0c2d4e00ea7d06 (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, NULL)) {
		void *stack = malloc(4096);
		chstack(arg, fn, stack + 4096);
	}
}