io_uring_register_reg_wait(3)

✨ NAME ✨

io_uring_register_reg_wait β€” registers fixed wait regions πŸŽ€

okay bestie, welcome to the liburing manual (yes, that manual, the one that lives in section 3, we love her) β€” let's get into it πŸ’…


🌸 SYNOPSIS 🌸

#include <liburing.h>

int io_uring_register_reg_wait(struct io_uring *ring,
                               struct io_uring_reg_wait *reg,
                               int nr);

πŸ¦‹ DESCRIPTION πŸ¦‹

So io_uring_register_reg_wait(3) does one thing and it does it well: it registers a fixed wait region that starts at reg and holds nentries entries, on the ring you pass in as ring. Periodt. πŸ’–

She's giving very much the same energy as io_uring_setup_reg_wait(3), with one iconic difference: she does not allocate any memory on behalf of your application. Nope, not a single byte. That's your job, bestie. You have to hand her memory you already allocated in reg, and that memory needs to be:

  • the right size to hold nr entries, and
  • suitably aligned on a page boundary ✨
🫢 Lowkey important: that registered memory should not be freed until the ring it's registered for is closed. Don't do it. She will know.

Once a wait region has been setup, it persists for the life time of the ring. And rn? It's currently not possible to unregister or resize a wait region β€” so pick your layout like the main character you are πŸ‘‘

Also, a wait region may currently only use a single page of memory. On a 4k page size system, that means an application is limited to 64 wait regions. And honestly? That should be enough, because each wait index may be modified as needed. With at least 64 indices available, hopefully applications can just use the appropriately setup wait region for each specific type of wait, with different indices having different wait settings. Ate. πŸ”₯

Available since kernel 6.13. iykyk πŸ’€


πŸ’€ RETURN VALUE πŸ’€


🌈 SEE ALSO 🌈


and that's the whole vibe check, bestie 🧚 this was liburing-2.9, dated November 2, 2024 β€” go forth and register your wait regions responsibly, mwah πŸ’œπŸ’…βœ¨

πŸ“¦ where this page comes from