linux - poll(NULL, 0, timeout) 是什么意思?

标签 linux kernel

我正在查看 strace 输出,其中包括对系统调用 poll() 的调用:

http://man7.org/linux/man-pages/man2/poll.2.html

(这是在Debian系统上,我忘了内核版本。)

我一直看到看起来像 poll(NULL, 0, intrger_here) 的调用。当您像这样将 pollfd 设置为 NULL 调用 poll() 时会发生什么?为什么程序会这样做?

(我想我应该引用内核源代码。)

最佳答案

这基本上是一种编写 timeout 持续时间的 sleep() 的简单方法。

关于linux - poll(NULL, 0, timeout) 是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48248171/

相关文章:

kernel - 系统调用是否完整地在软件中断处理程序中执行?

c - 为什么我在只读对象中收到错误消息 "assignment of member ‘readdir’”

python - ctime 总是 <= mtime 吗?

c++ - 与 dlopen 的动态链接 : symbol not found

c# - C# 应用程序是否可以与内核驱动程序通信?

linux - Netlink 套接字,libnl - - nl_recvmsgs_default 返回 -22

linux - 内核模块的 CPU 使用率

linux - GNOME 剪贴板是否具有与数据关联的 MIME 类型?

c - opendir:打开的文件太多

c - GDB 在 Linux 中带有 coredump 文件