Operating system process API code:
Article catalog
- Process API
- Code1: RC = fork () the PID of the sub-process, when RC == 0, indicates the child process itself
- Code2: The parent process uses wait () waiting to end the sub-process
- Code3: EXEC () System Call - Make sub-process running with different processes of the parent process
- Code4: Relocation output file
Process API
Code1: RC = fork () the PID of the sub-process, when RC == 0, indicates the child process itself
Code2: The parent process uses wait () waiting to end the sub-process
- What is WAIT () do? : Once the process calls Wait, immediately block yourself, automatically analyze if WAIT is automatically analyzed that the current process has exited, if it finds such a sub-process that has become zombie, Wait will collect this sub-process information, And returned it completely; if you didn't find such a child process, Wait would have been blocked here until there is an emergence.
- return value: If you perform success, the sub-process identification code (PID) is returned if there is an error occurs. Failure caused in Errno.