io_uring_prep_bind(3)

πŸ“¦
version 2.15 Β· 2 versions
, in alpine 3.24, arch rolling, fedora 44, nixpkgs unstable, ubuntu resolute, ubuntu stonking

πŸ’– io_uring_prep_bind β€” bestie edition πŸ’–

okay so this is a page from the liburing manual, and we're talking about io_uring_prep_bind(3). yes the whole manual, she's that girl. sit down, grab a strawberry drink πŸ“, we're doing sockets asynchronously and it's gonna be iconic.


✨ NAME ✨

io_uring_prep_bind β€” prep a bind request, no cap


🌸 SYNOPSIS 🌸

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

void io_uring_prep_bind(struct io_uring_sqe *sqe,
                          int sockfd,
                          const struct sockaddr *addr,
                          socklen_t addrlen);

πŸ¦‹ DESCRIPTION πŸ¦‹

so the way that io_uring_prep_bind(3) works is it prepares a bind request. that's it, that's the job. ✨

the submission queue entry sqe gets set up so it assigns the network address at addr, of length addrlen, to the socket descriptor sockfd. like, "hey this socket? this address? they're together now, periodt." πŸ’…

this function is prepping an async bind(2) request, bestie. if you want the actual deets on what binding means, go read that man page β€” this one's just the setup girlie. πŸŽ€


πŸ‘‘ RETURN VALUE πŸ‘‘

None. nada. zero. she returns nothing, she's mysterious like that. πŸ™ˆ


πŸ’€ ERRORS πŸ’€

the CQE res field is where the result of the operation lives, so peek there. go check the related man page for what values are possible, iykyk.

now listen, important part: where synchronous system calls would return -1 on failure and set errno to the actual error value β€” io_uring never uses errno. never ever. instead it returns the negated errno directly in the CQE res field. so like, if you were expecting errno to come through for you, she's not coming. that's just the vibe. 😭


🌈 SEE ALSO 🌈


mwah okay that's the whole page, go slay some async sockets, bestie 🫢

this edition was serving liburing-2.7, dated Jun 3, 2024 β€” so if you're reading this in the future, hi, hope you're thriving, check for a newer version, ily πŸ’œ

πŸ“¦ where this page comes from