fork() and wait() with two child processes

后端 未结 3 442

I need to use the fork() and wait() functions to complete an assignment. We are modelling non-deterministic behaviour and need the program to fork() if there is more than on

3条回答
  •  北海茫月
    2020-12-02 12:08

    Put your wait() function in a loop and wait for all the child processes. The wait function will return -1 and errno will be equal to ECHILD if no more child processes are available.

提交回复
热议问题