wait(null)和wait(& status)C语言和状态 [英] wait(null) and wait(&status) C language and Status
本文介绍了wait(null)和wait(& status)C语言和状态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在c系统编程中wait(null)
和wait(&status)
有什么区别?
What is the difference between wait(null)
and wait(&status)
in c system programming?
指针状态的内容是什么?
And what is the content of the pointer status ?
推荐答案
If you call wait(NULL)
(wait(2)), you only wait for any child to terminate. With wait(&status)
you wait for a child to terminate but you want to know some information about it's termination.
例如,您可以知道孩子是否以WIFEXITED(status)
正常终止.
You can know if the child terminate normally with WIFEXITED(status)
for example.
status
包含有关您可以使用某些已定义的MACRO进行检查的进程的信息.
status
contains information about processes that you can check with some already defined MACRO.
这篇关于wait(null)和wait(& status)C语言和状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文