minix/lib/syslib/sys_fork.c

23 lines
525 B
C
Raw Normal View History

2005-04-21 16:53:53 +02:00
#include "syslib.h"
PUBLIC int sys_fork(parent, child, child_endpoint, map_ptr, flags)
endpoint_t parent; /* process doing the fork */
endpoint_t child; /* which proc has been created by the fork */
int *child_endpoint;
struct mem_map *map_ptr;
u32_t flags;
2005-04-21 16:53:53 +02:00
{
/* A process has forked. Tell the kernel. */
message m;
int r;
2005-04-21 16:53:53 +02:00
m.PR_ENDPT = parent;
m.PR_SLOT = child;
2007-04-02 17:10:07 +02:00
m.PR_MEM_PTR = (char *) map_ptr;
m.PR_FORK_FLAGS = flags;
r = _taskcall(SYSTASK, SYS_FORK, &m);
*child_endpoint = m.PR_ENDPT;
return r;
2005-04-21 16:53:53 +02:00
}