Xinu7/man/man2/create.doc




CREATE(2)           Xinu Programmer's Manual            CREATE(2)



NAME
     create - create a new process

SYNOPSIS
     int create(caddr,ssize,prio,name,nargs[,argument]*)
     char *caddr;
     int ssize;
     int prio;
     char *name;
     int nargs;
     int argument;  /* actually, type machine word */

DESCRIPTION
     _C_r_e_a_t_e creates a new process that will begin execution at
     location _c_a_d_d_r, with a stack of _s_s_i_z_e words, initial prior-
     ity _p_r_i_o, and identifying name _n_a_m_e. _C_a_d_d_r should be the
     address of a procedure or main program, If the creation is
     successful, the (nonnegative) process id of the new process
     is returned to the caller.  The created process is left in
     the suspended state; it will not begin execution until
     started by a resume command.  If the arguments are
     incorrect, or if there are no free process slots, the value
     SYSERR is returned.  The new process has its own stack, but
     shares global data with other processes according to the
     scope rules of C.  If the procedure attempts to return, its
     process will be terminated (see KILL(2)).

     The caller can pass a variable number of arguments to the
     created process which are accessed through formal parame-
     ters.  The integer _n_a_r_g_s specifies how many argument values
     follow.  _N_a_r_g_s values from the _a_r_g_u_m_e_n_t_s list will be passed
     to the created process.  The type and number of such argu-
     ments is not checked; each is treated as a single machine
     word.  The user is cautioned against passing the address of
     any dynamically allocated datum to a process because such
     objects may be deallocated from the creator's run-time stack
     even though the created process retains a pointer.

SEE ALSO
     kill(2)















Version 6b               Printed 1/12/87                        1