0

I'm trying to run some tests using IORING_SETUP_SQPOLL, but when it's set and I call io_uring_cqe_get_data(cqe); I get "cqe failed: Bad file descriptor". Reading about Kernel Side Polling in io_uring.pdf, it seems that I might have to call:

/* 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);

but when I try to compile it, gcc cannot find io_uring_enter() (undefined reference to `io_uring_enter')

Does anyone have some experience with this option/flag?

Alberto Pires
  • 319
  • 1
  • 5
  • 10
  • 1
    Please post an [mcve]. Seems you may be missing an include file in your source. – jwdonahue Jan 18 '21 at 23:15
  • A quick google search turned up https://blogs.oracle.com/linux/an-introduction-to-the-io_uring-asynchronous-io-framework. Did you include `liburing.h`? – jwdonahue Jan 18 '21 at 23:19
  • @jwdonahue, yes I did, and also liburing/io_uring.h. It seems that there is no definition in the source code as well. I've included a link to the source code in the question. – Alberto Pires Jan 18 '21 at 23:32
  • Late answer, but for anyone getting the gcc error you have to add liburing as a library: `gcc main.c -luring` – Casper Kuethe Jul 10 '23 at 11:22

0 Answers0