How does fork() return for child process

前端 未结 6 1402
天命终不由人
天命终不由人 2020-12-23 15:33

I know that fork() returns differently for the child and parent processes, but I\'m unable to find information on how this happens. How does the child process receive the re

6条回答
  •  臣服心动
    2020-12-23 16:06

    The process appears identical from both sides, except for the differing return value (that's why the return value is there, so that the two processes can tell the difference at all!). As far as the son process is concerned, it will have just been returned to from system_call in the same manner that the parent process was returned to.

提交回复
热议问题