iom_requeue(3)

πŸ’– iom_requeue β€” re-add event to I/O multiplexer πŸ’–

okay bestie, this is the manual page for iom_requeue(3) from the Library Functions Manual and she's a lil icon of the libowfat I/O multiplexer world 🌈


✨ NAME ✨

iom_requeue β€” re-add event to I/O multiplexer 🫢


✨ SYNTAX ✨

#include <libowfat/io.h>

int iom_requeue(iomux_t* c, int64 fd, unsigned int events);

✨ DESCRIPTION ✨

so iom_requeue literally adds an event you're interested in to an I/O multiplexer. that's the whole vibe πŸ’…

fd is the file descriptor (usually a socket, iykyk) that you're interested in, and events is the operation you want to do. it can be IOM_READ or IOM_WRITE. those are your two options, periodt.

if that operation becomes possible on that descriptor, iom_wait will return and tell you the fd and the event. slay πŸŽ€

⚠️ okay important β€” the event registration is removed from the iomux_t context if it occurs. so you'll have to call iom_requeue again if you're interested in more events for this descriptor. it's giving "one and done" energy, fr fr.

and the timing matters, bestie: do this only after you're done handling this event, otherwise iom_wait might indicate a new event to another thread while this thread is still working on the descriptor, leading to unexpected behavior 😭 (we do NOT want unexpected behavior, that's not the vibe).

also bestie, closing a file descriptor with registered events will discard the event registration. she's gone, no cap πŸ’€


✨ LINKING ✨

you may have to add -lpthread to the command line in the linking step. that's it, that's the whole section πŸ”₯


✨ RETURN VALUE ✨

  • 0 β€” success, we ate πŸ‘‘
  • -1 β€” error, and it sets errno πŸ™ˆ

✨ SEE ALSO ✨

  • iom_init
  • iom_add
  • iom_wait
  • iom_abort

the whole friend group, go say hi πŸ¦‹


and that's the tea, bestie πŸ“ this was iom_requeue(3) living in the Library Functions Manual β€” go forth, requeue responsibly, and stay iconic πŸ’–βœ¨

πŸ“¦ where this page comes from