io_uring_prep_bind(3)
π 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
- alpine 3.24: liburing-doc 2.14-r0 Β· LGPL-2.1-or-later OR MIT
- arch rolling: liburing 2.15-1 Β· GPL-2.0-only WITH Linux-syscall-note OR MIT AND LGPL-2.0-or-later AND MIT
- fedora 44: liburing-devel 2.13-2.fc44 Β· (GPL-2.0-only WITH Linux-syscall-note OR MIT) AND (LGPL-2.0-or-later OR MIT)
- fedora 44: liburing-devel 2.13-2.fc44 Β· (GPL-2.0-only WITH Linux-syscall-note OR MIT) AND (LGPL-2.0-or-later OR MIT)
- nixpkgs unstable: liburing 2.14
- ubuntu resolute: liburing-dev 2.14-1
- ubuntu stonking: liburing-dev 2.15-1
- π the page's license: LGPL-2.0-or-later
- Copyright (C) 2024 SUSE LLC
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms