Explain fork() system call.A fork() system call in UNIX is used to create processes. It returns a process ID. The process created becomes the child process of the caller. After the child process is created both parent and child will execute the next instruction. Depending on the return values child process can be determined.Explain fork () system call.fork() system call is used to create processes. It returns a process id. After calling fork() system call, it becomes a child process of the caller. After creation of child call, the instruction followed by fork() will be executed after a new child process is created.
Fork() returns a negative value, if the child process creation is unsuccessful, zero if the new child process is created, returns a positive value which is the ‘process id’, to the parent.
|