fork means you start a new process. The new process is [almost] exactly the same as the original one. To find out which one is the current process you can use the return value of fork (0 means it is the child process, >0 means the parent process and the returned value is the pid of the child, <0 means error and also no child was created)
|