panic() cleanup.
[minix.git] / lib / libsys / sys_fork.c
blob0282b0f8460d2ad5f0718487576ad1f073f82bc0
1 #include "syslib.h"
3 PUBLIC int sys_fork(parent, child, child_endpoint, map_ptr, 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 struct mem_map *map_ptr;
8 u32_t flags;
9 vir_bytes *msgaddr;
11 /* A process has forked. Tell the kernel. */
13 message m;
14 int r;
16 m.PR_ENDPT = parent;
17 m.PR_SLOT = child;
18 m.PR_MEM_PTR = (char *) map_ptr;
19 m.PR_FORK_FLAGS = flags;
20 r = _kernel_call(SYS_FORK, &m);
21 *child_endpoint = m.PR_ENDPT;
22 *msgaddr = (vir_bytes) m.PR_FORK_MSGADDR;
23 return r;