__aeabi_ldivmod: fix sign logic
[minix.git] / lib / libsys / sys_fork.c
blob811e2301d1699be7c8451c5c6ae72903a6561b2c
1 #include "syslib.h"
3 int sys_fork(parent, child, child_endpoint, flags, msgaddr)
4 endpoint_t parent; /* process doing the fork */
5 endpoint_t child; /* which proc has been created by the fork */
6 endpoint_t *child_endpoint;
7 u32_t flags;
8 vir_bytes *msgaddr;
10 /* A process has forked. Tell the kernel. */
12 message m;
13 int r;
15 m.PR_ENDPT = parent;
16 m.PR_SLOT = child;
17 m.PR_FORK_FLAGS = flags;
18 r = _kernel_call(SYS_FORK, &m);
19 *child_endpoint = m.PR_ENDPT;
20 *msgaddr = (vir_bytes) m.PR_FORK_MSGADDR;
21 return r;