免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 4063 | 回复: 2
打印 上一主题 下一主题

[Linux] linux wait 等待进程状态改变,这里的状态包含哪些? [复制链接]

论坛徽章:
4
白羊座
日期:2013-09-17 21:59:30技术图书徽章
日期:2013-10-12 22:16:03白羊座
日期:2013-10-14 11:01:40双子座
日期:2013-12-17 18:26:39
1 [报告]
发表于 2013-12-15 21:46 |显示全部楼层
回复 1# socay2
文档继续向下看

   

论坛徽章:
4
白羊座
日期:2013-09-17 21:59:30技术图书徽章
日期:2013-10-12 22:16:03白羊座
日期:2013-10-14 11:01:40双子座
日期:2013-12-17 18:26:39
2 [报告]
发表于 2013-12-16 01:11 |显示全部楼层

论坛徽章:
4
白羊座
日期:2013-09-17 21:59:30技术图书徽章
日期:2013-10-12 22:16:03白羊座
日期:2013-10-14 11:01:40双子座
日期:2013-12-17 18:26:39
3 [报告]
发表于 2013-12-16 20:38 |显示全部楼层
本帖最后由 井蛙夏虫 于 2013-12-16 20:42 编辑

回复 5# socay2
这个是posix标准文档。
我的系统上的man文档是有说的,不知道为什么你系统的没有。
  1. The wait() system call suspends execution of the calling process until one of its children terminates.  The call wait(&status) is equivalent to:

  2.            waitpid(-1, &status, 0);
复制代码
wait只能是子进程终止。如果要子进程继续和暂停都可以,要用waitpid
  1. The  waitpid()  system  call  suspends  execution  of the calling process until a child specified by pid argument has changed state.  By default, waitpid() waits only for terminated children, but this
  2.        behavior is modifiable via the options argument, as described below.
复制代码
  1. The value of options is an OR of zero or more of the following constants:

  2.        WNOHANG     return immediately if no child has exited.

  3.        WUNTRACED   also return if a child has stopped (but not traced via ptrace(2)).  Status for traced children which have stopped is provided even if this option is not specified.

  4.        WCONTINUED (since Linux 2.6.10)
  5.                    also return if a stopped child has been resumed by delivery of SIGCONT.
复制代码
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP