我正在尝试使用 IORING_SETUP_SQPOLL 运行一些测试,但是当它设置并调用时,io_uring_cqe_get_data(cqe);
我得到“cqe failed: Bad file descriptor”。阅读io_uring.pdf中的内核端轮询,看来我可能不得不打电话:
/* fills in new sqe entries */
add_more_io();
/*
* need to call io_uring_enter() to make the kernel notice the new IO
* if polled and the thread is now sleeping.
*/
if ((*sqring→flags) & IORING_SQ_NEED_WAKEUP)
io_uring_enter(ring_fd, to_submit, to_wait, IORING_ENTER_SQ_WAKEUP);
但是当我尝试编译它时,gcc 找不到 io_uring_enter() (未定义对 `io_uring_enter' 的引用)
- 我正在使用 Ubuntu 18.04.5 LTS - 内核:5.4.0-62-generic。
- 代码可以在这里找到
有没有人对此选项/标志有一些经验?