


      FFFFOOOORRRRKKKK((((2222))))                     ((((UUUUNNNNIIIIXXXX 5555....0000))))                    FFFFOOOORRRRKKKK((((2222))))



      NNNNAAAAMMMMEEEE
           fork - create a new process

      SSSSYYYYNNNNTTTTAAAAXXXX
           iiiinnnntttt ffffoooorrrrkkkk (((())))

      DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
           _F_o_r_k causes creation of a new process.  The new process
           (child process) is an exact copy of the calling process
           (parent process).  This means the child process inherits the
           following attributes from the parent process:

                environment
                close-on-exec flag (see _e_x_e_c(2))
                signal handling settings (i.e., SSSSIIIIGGGG____DDDDFFFFLLLL, SSSSIIIIGGGG____IIIIGGGGNNNN,
                function address)
                set-user-ID mode bit
                set-group-ID mode bit
                process group ID
                tty group ID (see _e_x_i_t(2) and _s_i_g_n_a_l(2))
                current working directory
                root directory
                file mode creation mask (see _u_m_a_s_k(2))

           The child process differs from the parent process in the
           following ways:

                The child process has a unique process ID.

                The child process has a different parent process ID
                (i.e., the process ID of the parent process).

                The child process has its own copy of the parent's file
                descriptors.  Each of the child's file descriptors
                shares a common file pointer with the corresponding
                file descriptor of the parent.

                The child process's _u_t_i_m_e, _s_t_i_m_e, _c_u_t_i_m_e, and _c_s_t_i_m_e
                are set to 0.

           _F_o_r_k will fail and no child process will be created if one
           or more of the following are true:

                The system-imposed limit on the total number of
                processes under execution would be exceeded.  [EAGAIN]

                The system-imposed limit on the total number of
                processes under execution by a single user would be
                exceeded.  [EAGAIN]

      RRRREEEETTTTUUUURRRRNNNN VVVVAAAALLLLUUUUEEEE
           Upon successful completion, _f_o_r_k returns a value of 0 to the



      Page 1                                                   (9010-E)






      FFFFOOOORRRRKKKK((((2222))))                     ((((UUUUNNNNIIIIXXXX 5555....0000))))                    FFFFOOOORRRRKKKK((((2222))))



           child process and returns the process ID of the child
           process to the parent process.  Otherwise, a value of -1 is
           returned to the parent process, no child process is created,
           and _e_r_r_n_o is set to indicate the error.

      SSSSEEEEEEEE AAAALLLLSSSSOOOO
           exec(2), times(2), wait(2).
















































      Page 2                                                   (9010-E)



