哪些系统不支持 waitpid 的 WNOHANG 选项?
我有一个用于管理子进程的库,它依赖于将 POSIX WNOHANG 选项传递给 waitpid 以对进程执行非阻塞等待。据说并非所有系统都支持此选项,但我已经有一段时间没有在任何这些系统上工作了。哪些系统不支持此选项?我想知道,以便我可以尝试找到这些系统的解决方法,或者可以决定不以这些系统为目标。
I have a library for managing child processes that relies on passing the POSIX WNOHANG option to waitpid to perform a non-blocking wait on a process. It is said that not all systems support this option, but it has been a while since I have worked on any of those systems. What systems don't support this option? I'd like to know so that either I can try to find workarounds for those systems or so I can decide not to target those systems.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我相信 waitpid 是在 POSIX.1 中指定的,因此您将很难找到不兼容的系统。根据您要构建的库类型,您可能需要查看以下符合 POSIX 的系统列表:
http://en.wikipedia.org/wiki/POSIX#Fully_POSIX 兼容
在 Google 上快速搜索发现了不合规的系统,这让我认为您的图书馆对于 1988 年之后的任何事情都应该是安全的。
如果您确实遇到不合规的系统,将其发布到 SO 上以便将其存档可能不是一个坏主意。祝你好运!
waitpid was specified in POSIX.1 I believe, so you'll have a tough time finding a system that isn't compliant. Depending on what sort of library you're building, you might want to take a look at this list of POSIX-Compliant systems:
http://en.wikipedia.org/wiki/POSIX#Fully_POSIX-compliant
A quick search on Google turned up non-compliant systems, which leads me to think that you should be safe with your library on anything post-1988.
If you do come across a non-compliant system, it might not be a bad idea to post it on SO so it's archived. Good luck!