How does Linux fork work?

Như Quỳnh

New member
How does Linux fork work?
Answer
The fork() function is special because it actually returns twice: once to the parent process and once to the child process. In the parent process, fork() returns the pid of the child. In the child process, it returns 0. In the event of an error, no child process is created and -1 is returned to the parent.
 

Tìm kiếm

Back
Top