wait&waitpid状态值

[wait&waitpid状态值]

 1.  python 中 os.system 的返回值的format与wait的返回值status一致:

    On Unix, the return value is the exit status of the process encoded in the format specified for wait()

  os.system直到命令进程执行完毕才返回, SIGSTOP把子进程暂停, os.system也依旧阻塞

 2.  os.wait的返回值, 在不同的情况下有不同的含意, 需通过 <sys/wait.h> 头文件中的宏来操作

  

  

 3. 若waitpid加入了WNOHANG选项, 需按如下方式处理ret与status

  

 4.  python os模块中定义了 W* 类似的函数

  

 5.  对于WCONTINUED 和 WIFCONTINUED, 如果waitpid中设置了WCONTINUED, 则有可能WIFCONTINUED为True. 每次的continue只会报告一次.

  

原文地址:https://www.cnblogs.com/tekkaman/p/3356736.html