2005-04-21 16:53:53 +02:00
|
|
|
#include "syslib.h"
|
|
|
|
|
2006-03-03 10:44:55 +01:00
|
|
|
PUBLIC int sys_fork(parent, child, child_endpoint)
|
2005-04-21 16:53:53 +02:00
|
|
|
int parent; /* process doing the fork */
|
|
|
|
int child; /* which proc has been created by the fork */
|
2006-03-03 10:44:55 +01:00
|
|
|
int *child_endpoint;
|
2005-04-21 16:53:53 +02:00
|
|
|
{
|
|
|
|
/* A process has forked. Tell the kernel. */
|
|
|
|
|
|
|
|
message m;
|
2006-03-03 10:44:55 +01:00
|
|
|
int r;
|
2005-04-21 16:53:53 +02:00
|
|
|
|
2006-03-03 10:44:55 +01:00
|
|
|
m.PR_ENDPT = parent;
|
|
|
|
m.PR_SLOT = child;
|
|
|
|
r = _taskcall(SYSTASK, SYS_FORK, &m);
|
|
|
|
*child_endpoint = m.PR_ENDPT;
|
|
|
|
return r;
|
2005-04-21 16:53:53 +02:00
|
|
|
}
|