io_waituntil(3)

πŸ“¦
version 0.34 Β· 2 versions
  • 0.34 Β· alpine 3.24, debian bookworm, debian trixie, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking (latest)
  • 0.30 Β· fedora 43, fedora 44, ubuntu jammy
, in alpine 3.24, debian bookworm, debian trixie, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– io_waituntil β€” bestie's guide to waiting (but, like, on a schedule) πŸ’–

okay so real talk, this one lives in the Library Functions Manual, it's io_waituntil(3), and it is so much simpler than it sounds. let's get into it 🫢


✨ NAME ✨

io_waituntil β€” wait for events πŸ¦‹


🌸 SYNTAX 🌸

#include <libowfat/io.h>

void io_waituntil(tai6464 t);

πŸ’… DESCRIPTION πŸ’…

so io_waituntil(t) is basically io_wait()'s more punctual sibling. it waits for events, yes, but the way it will not wait (noticeably) past time t. that's it. that's the whole vibe. it shows up, it does its thing, and it does not overstay its welcome past t. periodt ✨


πŸŽ€ NOTE πŸŽ€

okay bestie, this is the part where we sit down and have a little chat, because depending on the underlying operating system primitive, there's a potential race condition you need to be aware of. not me being dramatic, it's literally in the docs 😭

some event notification mechanisms β€” for example, kqueue on BSD and epoll on Linux β€” will return multiple events. and here's where it gets spicy: if your application operates on pairs of file descriptors (a proxy server maybe?), and an error on one descriptor can lead to closing the other descriptor, then an outstanding event on the other descriptor can still be queued for delivery to you.

so be prepared to receive events for a descriptor that has already been closed. yes, fr fr. it's giving "ghost texted you from beyond the grave" πŸ’€

πŸ”₯ SEE ALSO πŸ”₯


and that's the whole page, babe πŸ’œ this came out of the Library Functions Manual as io_waituntil(3) β€” go forth, wait until t, and don't let any closed descriptors catch you slipping πŸ‘‘πŸŒˆ