io_uring_sq_ready(3)

io_uring_sq_ready πŸ’…βœ¨

okay bestie, so this is a page from the liburing manual (that's the userspace crew for io_uring, iykyk), and it's literally just one tiny little function that tells you how much stuff is still chillin' in your submission queue. that's it. that's the whole vibe. πŸŽ€


✨ NAME ✨

io_uring_sq_ready β€” the number of unconsumed or unsubmitted entries in the SQ ring πŸ¦‹


🌸 SYNOPSIS 🌸

#include <liburing.h>

unsigned io_uring_sq_ready(const struct io_uring *ring);

πŸ’– DESCRIPTION πŸ’–

so the io_uring_sq_ready(3) function returns the number of unconsumed (that's the SQPOLL case, hold on) or unsubmitted entries that exist in the SQ ring belonging to the ring param. like, how many requests are sitting there waiting for their moment. main character energy, but make it a queue. πŸ’€

now the important part, and I mean IMPORTANT:

usage of this function only applies if the ring has been setup with IORING_SETUP_SQPOLL, where request submissions β€” and therefore consumption from the SQ ring β€” happens through a polling thread. no SQPOLL, no relevance, periodt. 🫢

⭐ RETURN VALUE ⭐

returns the number of unconsumed or unsubmitted entries in the SQ ring. that's the number, that's the tea, that's the whole return. 🌈


πŸ‘‘ SEE ALSO πŸ‘‘

  • io_uring_cq_ready(3) β€” go read that one too bestie, it's the completion queue counterpart and it ate πŸ’…

okay that's the page!! this one comes from liburing-2.1 and it's dated January 25, 2022 β€” a whole little time capsule, iconic of it honestly. love u, go check your SQ ring, mwah πŸ’œπŸ§š

πŸ“¦ where this page comes from