about summary refs log tree commit diff
path: root/src/process/fork.c
blob: 0638ed67db74df731bdfab80f4e4d05e12be7981 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
#include <unistd.h>
#include "syscall.h"
#include "libc.h"

pid_t fork(void)
{
	pid_t ret;
	if (libc.fork_handler) libc.fork_handler(-1);
	ret = syscall0(__NR_fork);
	if (libc.fork_handler) libc.fork_handler(!ret);
	return ret;
}