io_uring_prep_waitid(3)

πŸ’– io_uring_prep_waitid β€” the liburing manual page, bestie edition πŸ’–

okay so you're reading the liburing manual, section 3, and this little icon is called io_uring_prep_waitid(3). sit down, hydrate, let's go ✨


🌸 NAME 🌸

io_uring_prep_waitid β€” bestie, it prepares a waitid request. that's it. that's the whole job. πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

#include <sys/wait.h>
#include <liburing.h>

void io_uring_prep_waitid(struct io_uring_sqe *sqe,
                          idtype_t idtype,
                          id_t id,
                          siginfo_t *infop,
                          int options,
                          unsigned int flags);

copy it exactly like that, no cap. 🫢


✨ DESCRIPTION ✨

so. io_uring_prep_waitid(3) prepares a waitid request, and honestly? it ate.

your submission queue entry sqe gets set up so that the idtype and id arguments pick out which child(ren) we're talking about πŸ‘‘, and options says which child state changes you're waiting on. the moment it comes back successful, it fills infop with info about the child process, if there even is one. and flags? that's the io_uring-specific modifier flags. they are currently unused, so like… pass 0. that's it. don't be extra. πŸ™ˆ

this function prepares an async waitid(2) request. so if you want the actual details, go read that man page, iykyk. πŸ“–

available since kernel 6.7 🌈 β€” yes she's new here and yes she's thriving.


πŸ’« RETURN VALUE πŸ’«

none. literally nothing. void. the girl gives you nothing back and you respect it. 😭


πŸ’€ ERRORS πŸ’€

the CQE res field is where the result of the operation lives. see the related man page for details on possible values, fr fr.

now here's the part that trips people up β€” and it's giving main character energy, so listen: where synchronous system calls will return -1 on failure and set errno to the actual error value, io_uring never uses errno. instead, it returns the negated errno directly in the CQE res field. periodt. no errno, don't look for it, she's not there. πŸ’…


πŸ¦‹ SEE ALSO πŸ¦‹


that's the whole page, bestie, you're so smart for reading it πŸ’– liburing-2.5, dated July 14, 2023 β€” mwah, go forth and await your children responsibly πŸŒΈβœ¨πŸŽ€

πŸ“¦ where this page comes from