Create a copy of the current process.
Fork can return one of the following values:
- > 0
- You are in the parent process. The value returned from
forkis the process id of the child process. You should probably arrange to wait for any child processes to exit.- 0
- You are in the child process. You can call
execto start another process. If that fails, you should probably callexit.- < 0
- The call to
forkfailed for some reason. You must take evasive action. A system dependent error message will be waiting in msg.