wait(null) and wait(&status) C language and Status

后端 未结 2 1563
甜味超标
甜味超标 2020-12-31 01:07

What is the difference between wait(null) and wait(&status) in c system programming?

And what is the content of the pointer status ?

2条回答
  •  醉话见心
    2020-12-31 01:22

    wait(NULL) will only wait until the child process is completed. But, wait(&status) will return the process id of the child process that is terminated.

    pid = wait(&status); // the information is returned
    

提交回复
热议问题