轮询系统调用超时 [英] poll system call timeout
本文介绍了轮询系统调用超时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
附加strace
会显示很多这样的消息:
Attaching strace
shows a lot of these messages:
poll([{fd=5, events=POLLIN}, {fd=6, events=POLLIN}, {fd=7, events=POLLIN}, {fd=8, events=POLLIN}, {fd=9, events=POLLIN}, {fd=10, events=POLLIN}], 6, 0) = 0 (Timeout)
poll([{fd=5, events=POLLIN}, {fd=6, events=POLLIN}, {fd=7, events=POLLIN}, {fd=8, events=POLLIN}, {fd=9, events=POLLIN}, {fd=10, events=POLLIN}], 6, 0) = 0 (Timeout)
poll([{fd=5, events=POLLIN}, {fd=6, events=POLLIN}, {fd=7, events=POLLIN}, {fd=8, events=POLLIN}, {fd=9, events=POLLIN}, {fd=10, events=POLLIN}], 6, 0) = 0 (Timeout)
poll([{fd=5, events=POLLIN}, {fd=6, events=POLLIN}, {fd=7, events=POLLIN}, {fd=8, events=POLLIN}, {fd=9, events=POLLIN}, {fd=10, events=POLLIN}], 6, 0) = 0 (Timeout)
如何找到程序试图访问的文件,从而导致poll
系统调用超时?
How can I find what file the program is trying to access that causes poll
system call to timeout?
strace
生成大量消息,使调试变得困难
strace
generates a lot of messages which make it hard to debug
推荐答案
如何找到程序试图访问的文件,导致轮询系统调用超时?
How can I find what file the program is trying to access that causes poll system call to timeout?
调用:
lsof -p <pid>
看看有问题的文件描述符指的是什么.
And see what the file descriptors in question refer to.
您还可以查看Linux上的proc
文件系统:
You can also take a look into proc
filesystem on Linux:
ls -l /proc/<pid>/fd
这篇关于轮询系统调用超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文