STRUCT SYNC_SET_DEADLINE(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct sync_set_deadline(9) β€” the kernel API manual, but make it make sense

okay bestie, so we're deep in the kernel API manual today, and this one is a struct, not a function β€” it's struct sync_set_deadline, the little guy behind SYNC_IOC_SET_DEADLINE. And what does it do? It sets a deadline hint on a fence. That's the whole vibe. πŸŽ€


✨ SYNOPSIS ✨

here's the shape of it, literally, copy it exactly, no cap:

struct sync_set_deadline {
    __u64 deadline_ns;
    __u64 pad;
 };

πŸ¦‹ Members πŸ¦‹

  • deadline_ns β€” the absolute time of the deadline. absolute, okay? not "in 5 seconds", it's the actual moment. ⏰
  • pad β€” must be zero. that's it, that's the whole job. zero. nada. 🫢

🌸 Description 🌸

so this struct lets userspace set a deadline on a fence β€” and if you wanna know the deep lore, go look at dma_fence_set_deadline. iykyk. πŸ”₯

now the important bit, the timebase for the deadline is CLOCK_MONOTONIC (same as vblank). periodt. πŸ’…

for example:

clock_gettime(CLOCK_MONOTONIC, t); deadline_ns = (t.tv_sec *
1000000000L) + t.tv_nsec + ns_until_deadline

that's the math, bestie β€” take your monotonic clock reading, multiply the seconds by 1000000000L, add the nanoseconds, plus however many ns_until_deadline you got left. slay. ✨


πŸ‘‘ SEE ALSO πŸ‘‘

  • Kernel file ./include/uapi/linux/sync_file.h
  • struct sync_merge_data(9)
  • struct sync_fence_info(9)
  • struct sync_file_info(9)

go read those, they're iconic too. 🌈


lowkey reminder: pad is not decoration, it must be zero β€” don't be the one who breaks it. πŸ’€

and that's the whole page, bestie β€” source lives at ./include/uapi/linux, dated October 2026, πŸ¦‹ mwah, go set some deadlines responsibly πŸ’œ

πŸ“¦ where this page comes from