Fork system call is used for creating a new process, which is called child process, which runs concurrently with the process that makes the fork() call (parent process). After a new child process is created, both processes will execute the next instruction following the fork() system call. A child process uses the same pc(program counter), same CPU registers, same open files which use in the parent process.
It takes no parameters and returns an integer value. Below are different values returned by fork().
~Negative Value: creation of a child process was unsuccessful.
~Zero: Returned to the newly created child process.
~Positive value: Returned to parent or caller. The value contains process ID of newly created child process
Basic Commands of shell Script
[ Ссылка ]
How to use CD, MKDIR, RMDIR in shell script
[ Ссылка ]
Hello World program in shell script
[ Ссылка ]
fork() method in C
Теги
which is called child processsame CPU registersNegative Value: creation of a child process was unsuccessful.Zero: Returned to the newly created child process.Positive value: Returned to parent or callerThe value contains process ID of newly created child processmake two process which run sameprogram after this instructionTotal Number of Processesnew child processes and one original processThe main processC programmingbabun softwarebabunfork method