io_uring_prep_epoll_ctl(3)

πŸ’… io_uring_prep_epoll_ctl β€” bestie edition

okay so this is a page from the liburing Manual, and it's literally about prepping an epoll_ctl request. no cap, it's short, it's sweet, and it's giving ✨async✨. let's get into it 🫢


✨ NAME ✨

io_uring_prep_epoll_ctl β€” prepare an epoll_ctl request πŸ’–


🌸 SYNOPSIS 🌸

#include <liburing.h>

void io_uring_prep_epoll_ctl(struct io_uring_sqe *sqe,
                             int epfd,
                             int fd,
                             int op,
                             const struct epoll_event *ev);

πŸ¦‹ DESCRIPTION πŸ¦‹

so basically, the io_uring_prep_epoll_ctl(3) function gets an epoll control request all set up and ready to slay. your submission queue entry sqe gets configured to use the epoll instance that epfd points to, and it performs the operation op on the file descriptor fd. and the ev argument? that's a pointer to an epoll_event structure, exactly as it's defined in epoll_ctl(2). periodt πŸ’…

the op argument can be one of these three, and ngl they're all iconic in their own way:

  • EPOLL_CTL_ADD β€” adds fd to the epoll instance πŸ‘‘
  • EPOLL_CTL_MOD β€” modifies the settings for fd ✨
  • EPOLL_CTL_DEL β€” removes fd from the epoll instance. and heads up bestie: ev is ignored for this operation πŸ™ˆ
this function prepares an async epoll_ctl(2) request. so like, go read that man page for the deets, fr fr πŸ“–

🌈 RETURN VALUE 🌈

none. that's it. nothing. the void. πŸ’€ (jk, the actual result shows up in the CQE, keep reading πŸ‘‡)


πŸŽ€ ERRORS πŸŽ€

the res field of the CQE is where the result of the operation lives β€” it's 0 on success πŸŽ‰. and if things go wrong? you get a negative errno value 😭. for the possible error values, check epoll_ctl(2), iykyk.


⭐ SEE ALSO ⭐


and that's the whole page, bestie 🫢 this was liburing-2.4, dated January 18, 2025. go prep some epoll requests, you're doing amazing sweetie πŸ’–βœ¨πŸŒΈ

πŸ“¦ where this page comes from