io_queue_run(3)

πŸ’– io_queue_run(3) β€” Linux AIO, bestie edition πŸ’–

okay so. welcome to the io_queue_run(3) page, part of the Linux AIO manual, and honestly? she's short but she's mighty. grab a snack, we're doing asynchronous I/O together πŸ¦‹


✨ NAME ✨

io_queue_run β€” handle completed io requests πŸ‘‘

like, it deals with the io requests that are already done. the finished ones. the ones that ate and left no crumbs πŸ”₯


🌸 SYNOPSIS 🌸

#include <errno.h>

#include <libaio.h>

int io_queue_run(io_context_t ctx);

that's it. that's the whole signature. one function, one argument, zero drama πŸ’…


πŸŽ€ DESCRIPTION πŸŽ€

okay bestie so here's the vibe: io_queue_run() attempts to read all the events from the completion queue for the aio_context specified by ctx.

all of them. not some. not a few. all. she's thorough, she's committed, she's giving main character energy 🌟


⭐ RETURN VALUES ⭐

  • May return 0 if no events are available. lowkey a mood, honestly β€” sometimes the queue is just empty and that's fine πŸ“
  • Will fail with -ENOSYS if not implemented. 😭

πŸ’€ ERRORS πŸ’€

okay so when things go wrong, they go wrong like this:

  • EFAULT β€” iocbs referenced data outside of the program's accessible address space. not her reaching into places she shouldn't be πŸ™ˆ
  • EINVAL β€” ctx refers to an uninitialized aio context, the iocb pointed to by iocbs contains an improperly initialized iocb. bestie the context is NOT ready, do not pass go 🚫
  • ENOSYS β€” Not implemented. it's giving "sorry babe, this feature didn't make it" πŸ’€

🫢 SEE ALSO 🫢

the whole friend group, no cap:

io(3), io_cancel(3), io_fsync(3), io_getevents(3), io_prep_fsync(3), io_prep_pread(3), io_prep_pwrite(3), io_queue_init(3), io_queue_release(3), io_queue_wait(3), io_set_callback(3), io_submit(3), errno(3).


reminder bestie: keep your ctx initialized and your iocbs inside your own address space, or the errors section will come for you πŸ’…

and that's the page!! ✨ this one came from the Linux manual, dated 2019-07-23 β€” so yes, she's an older icon but she still slays. mwah, go handle those completed io requests, ily πŸŽ€πŸ’–