summaryrefslogtreecommitdiff
path: root/src/kernel/syscalls.h
blob: 78a47b22dc448488a8d2dc481494b3789ce7f73e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// note: this file gets included in both kernel and userland
#pragma once
#include <stddef.h>

enum {
	// idc about stable syscall numbers just yet
	_SYSCALL_EXIT,
	_SYSCALL_FORK,

	_SYSCALL_DEBUGLOG
};

/** Kills the current process.
 * TODO: what happens to the children?
 */
_Noreturn void _syscall_exit(const char *msg, size_t len);

/** Creates a copy of the current process, and executes it.
 * All user memory pages get copied too. Doesn't return anything useful.. yet.
 */
int _syscall_fork();

/** Prints a message to the debug console.
 * @return the amount of bytes written (can be less than len)
 */
int _syscall_debuglog(const char *msg, size_t len);