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
fork
is 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
exec
to start another process. If that fails, you should probably callexit
.- < 0
- The call to
fork
failed for some reason. You must take evasive action. A system dependent error message will be waiting in msg.