io_uring_reg...r_sync_cancel(3)

πŸ“¦
version 2.15 Β· 2 versions
, in alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, centos-stream 10, centos-stream 9, debian trixie, fedora 43, fedora 44, nixpkgs unstable, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– NAME πŸ’–

io_uring_register_sync_cancel β€” bestie, this one fires off a synchronous cancelation request. no cap.


✨ SYNOPSIS ✨

#include <liburing.h>

int io_uring_register_sync_cancel(struct io_uring *ring,
                                  struct io_uring_sync_cancel_reg *reg);

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so. The io_uring_register_sync_cancel(3) function does a synchronous cancelation request based on whatever params you dropped into reg. it's giving "cancel it and actually wait for the answer" energy. πŸ’…

The reg argument? You must fill it in with the right info for your cancelation request, bestie. no vibes-only submissions. It looks like this:

struct io_uring_sync_cancel_reg {
    __u64 addr;
    __s32 fd;
    __u32 flags;
    struct __kernel_timespec timeout;
    __u8 opcode;
    __u8 pad[7];
    __u64 pad2[3];
};

The arguments are largely mirroring what the async prep functions support β€” so like, go read io_uring_prep_cancel(3) for the deets. 🌸 And similarly, the return value is the same too, same girl different function.

The exception is the timeout argument, which you can use to limit how long the kernel will wait for cancelations to actually succeed. If the tv_sec and tv_nsec values are set to anything but -1UL, then they indicate a relative timeout that cancelations should be completed by. ticking clock, bestie. ⏰

⚠️ the pad values MUST be zero filled. like actually. zero. filled. don't play. πŸ™ˆ

πŸ’œ RETURN VALUE πŸ’œ

See io_uring_prep_cancel(3) for the details on the return value β€” it's the same story. πŸ‘‘

If timeout is set to indicate a timeout, then -ETIME will be returned if it gets exceeded. 😭

And if an unknown value is set in the request, or if the pad values are not cleared to zero, then -EINVAL is returned. so clean your pads. periodt. πŸ’€


🌈 SEE ALSO 🌈


okay that's the whole page, mwah 🫢 this was the liburing Manual, liburing-2.3, dated September 21 β€” and yes she's an icon, she's a legend, and she is the moment. πŸŽ€βœ¨πŸ’–

πŸ“¦ where this page comes from