io_uring_prep_shutdown(3)

πŸ’… io_uring_prep_shutdown β€” bestie, it's a liburing manual page

okay so real talk, this is a page from the liburing Manual and it's about io_uring_prep_shutdown(3). yes the name is a whole mouthful, but it's literally just "get ready to shut a socket down." we love a lowkey overachiever. ✨


πŸŽ€ NAME πŸŽ€

io_uring_prep_shutdown β€” prepare a shutdown request

like... it preps the request. it doesn't do the shutdown itself. it's the planner, not the doer. main character energy but behind the scenes. 🫢


✨ SYNOPSIS ✨

#include <sys/socket.h>
#include <liburing.h>

void io_uring_prep_shutdown(struct io_uring_sqe *sqe,
                            int sockfd,
                            int how);

look at her. three little args. iconic. πŸ’–


🌸 DESCRIPTION 🌸

so the way that io_uring_prep_shutdown(3) works is: it prepares a shutdown request, periodt.

the submission queue entry sqe gets set up to use the file descriptor sockfd β€” that's the socket that should be shut down β€” with the how argument deciding how it goes down.

basically this function preps an async shutdown(2) request. so if you wanna know the actual vibes of what happens, bestie, go read that man page, because this one is just the setup girlie. no cap. πŸ’…


πŸ‘‘ RETURN VALUE πŸ‘‘

None. that's it. nothing. she returns nothing. the void. 🌈


πŸ’€ ERRORS πŸ’€

the CQE res field is where the result of the operation will be chillin'. wanna know the possible values? check the related man page, iykyk.

🚨 okay this part matters, so listen up: normal synchronous system calls will return -1 when they fail and set errno to the actual error value. io_uring never uses errno. never. not once. instead it returns the negated errno directly in the CQE res field. so like if you're out here checking errno you're gonna have a bad time. don't do it. 😭

πŸ¦‹ SEE ALSO πŸ¦‹


okay that's the whole page, you ate it, no crumbs left. πŸ“ this was liburing-2.2, dated March 12, 2022, and that's the vibe check, bye bestie πŸ’œπŸ§š

πŸ“¦ where this page comes from