io_uring_register_clock(3)

✨ io_uring_register_clock ✨

ok so bestie, this one is a liburing manual page, and it's literally all about telling io_uring which clock to vibe with when it's out here waiting for event completions πŸ•°οΈπŸ’–


πŸŽ€ NAME πŸŽ€

io_uring_register_clock β€” set the clock source for event waiting. yes that's it, that's the whole job, and it's iconic πŸ’…


🌸 SYNOPSIS 🌸

#include <liburing.h>

int io_uring_register_clock(struct io_uring *ring,
                            struct io_uring_clock_register *arg);

πŸ¦‹ DESCRIPTION πŸ¦‹

okok so the io_uring_register_clock(3) function is the one you call to register which clock source io_uring should use when your app is out here waiting for event completions 🫢

  • the ring argument should point at the ring in question (yk, the ring you're doing the thing with)
  • and the arg argument should be a pointer to a struct io_uring_clock_register

and like, the arg argument has to be actually filled in with the right info, no being lazy about it. here's what it looks like:

struct io_uring_clock_register {
    __u32 clockid;
    __u32 __resv[3];
};

the clockid field must contain the clock source, and the valid sources are, bestie, drumroll pls πŸ₯:

  • CLOCK_MONOTONIC β€” a nonsettable system-wide clock that represents monotonic time. no cap, it just goes forward πŸ’«
  • CLOCK_BOOTTIME β€” a nonsettable system-wide clock that is identical to CLOCK_MONOTONIC, except that it also icnludes any time that the system is suspended 😴 (so like, the nap time counts too)
if you want the full lore, go read clock_gettime(3), it has all the deets πŸ“–

and the __resv fields? they must be filled with zeroes. literally zeros, nothing else, don't get cute with it πŸ™ˆ

Available since 6.12. so if you're on something older, sorry bestie, this is not your era yet πŸ’€


⭐ RETURN VALUE ⭐

  • on success, io_uring_register_clock(3) returns 0 β€” slay, we love a zero πŸ’–
  • on failure it returns -errno β€” sad girl hours 😭

🌈 SEE ALSO 🌈


and that's the whole page, periodt πŸŽ€ this was liburing-2.8, dated Aug 18, 2024, straight out of the liburing Manual β€” mwah, go register a clock, you got this πŸ‘‘πŸ’œ

πŸ“¦ where this page comes from