iom_add(3)
π iom_add(3) π
okay so bestie, welcome to iom_add from the Library Functions Manual π this is the libowfat girlie that puts an event on your I/O multiplexer's to-do list, and honestly? she's iconic for it β¨
πΈ NAME πΈ
iom_add β add event to I/O multiplexer π«Ά
β¨ SYNTAX β¨
#include <libowfat/io.h>
int iom_add(iomux_t* c, int64 fd, unsigned int events);
like look at that signature. so clean. so slay. π
π DESCRIPTION π
so basically, iom_add adds an event you are interested in to an I/O multiplexer. that's the whole vibe. you're telling the multiplexer "hey girl, keep an eye on this for me" π
fd is the file descriptor (usually a socket) you are interested in, and events is the operation you want to do. it can be IOM_READ or IOM_WRITE. that's it, that's the menu, no secret third option, no cap π
if that operation becomes possible on that descriptor, iom_wait will return and tell you the fd and the event. like it literally shows up and is like "bestie it's happening" πβ¨
β οΈ okay important, real talk: note that the event registration is removed from theiomux_tcontext if it occurs. so once it fires, it's gone. you will have to calliom_requeueafter you handled the event, if you are still interested in it. one-and-done energy fr fr π
π¨ also, closing a file descriptor with registered events will discard the event registration. so like, don't expect the registration to survive that. it's giving "we don't do that here" π
π LINKING π
you may have to add -lpthread to the command line in the linking step. yeah. the linker is picky. she has main character energy and we respect her for it π
π RETURN VALUE π
0on success β ate, no crumbs π-1on error, settingerrnoβ not the vibe, go readerrnoπ
π¦ SEE ALSO π¦
iom_initiom_requeueiom_waitiom_abort
the whole friend group, honestly. go read them next π«Άβ¨
and that's the page bestie!! this one's straight out of the Library Functions Manual, iom_add(3), brought to you by libowfat π no date on this footer so we're just gonna say: it's timeless, like all the best girls π
π periodt β¨
π¦ where this page comes from
- alpine 3.24: libowfat-doc 0.34-r0 Β· GPL-2.0-only
- nixos 26.05: libowfat 0.34
- nixpkgs unstable: libowfat 0.34
- ubuntu resolute: libowfat-dev 0.34-2 Β· GPL-2.0-only
- ubuntu stonking: libowfat-dev 0.34-2 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms