io_uring_prep_msg_ring_fd(3)
π io_uring_prep_msg_ring_fd β send a direct descriptor to another ring
okay bestie, welcome to the liburing manual π you're reading the page for io_uring_prep_msg_ring_fd(3) and honestly? it's giving ring-to-ring gossip. like, one ring is sliding a whole file descriptor to another ring. telepathy. iconic. π¦
β¨ SYNOPSIS β¨
#include <liburing.h>
void io_uring_prep_msg_ring_fd(struct io_uring_sqe *sqe,
int fd,
int source_fd,
int target_fd,
__u64 data,
unsigned int flags);
void io_uring_prep_msg_ring_fd_alloc(struct io_uring_sqe *sqe,
int fd,
int source_fd,
__u64 data,
unsigned int flags);
two functions, one vibe. let's get into it π
πΈ DESCRIPTION πΈ
io_uring_prep_msg_ring_fd(3)
so this one prepares an SQE that sends a direct file descriptor over to another ring. yes, rings can pass notes. π
here's the tea:
- the submission queue entry
sqegets set up to use the file descriptorfd, andfdmust identify a target io_uring context, no cap - it sends the locally registered file descriptor whose value is
source_fd - that lands in the destination ring at index
target_fd - and
datarides along as the user data in the target CQE π«Ά - the request modifier flags get set by
flags
β οΈ heads up: right now there are no valid flag modifiers. that field has to contain 0. literally zero. don't get creative with it. π
io_uring_prep_msg_ring_fd_alloc(3)
this one is basically the sibling of io_uring_prep_msg_ring_fd(3) but it does not let you pick a target index for the direct descriptor. instead, the index gets allocated in the target ring and handed back to you in the CQE res field. surprise! π main character behavior fr fr.
π« RETURN VALUE π«
None
that's it. nothing. void. the silence after you send the perfect text. π
π ERRORS π
these are the errors that show up in the CQE res field. know them, love them, respect them.
-ENOMEMβ the kernel was unable to allocate memory for the request. out of brain cells, out of memory, same energy π§-EINVALβ one of the fields set in the SQE was invalid. something in there was Not It π-EINVALβ the target ring is identical to the source ring. bestie you cannot text yourself. the rings have to be different π-EBADFDβ the descriptor passed infddoes not refer to an io_uring file descriptor, or the ring is in a disabled state. not a ring, not today π«-EOVERFLOWβ the kernel was unable to fill a CQE on the target ring. this can happen if the target CQ ring is in an overflow state and the kernel wasn't able to allocate memory for a new CQE entry. the target ring's inbox is just... full π¬-ENFILEβ the direct descriptor table in the target ring was full, so no new descriptors could be successfully allocated. no room at the inn, no room in the table π
π§ a lil sign-off π§
this page is from liburing-2.4, dated Mar 16, 2023. go forth and pass descriptors between your rings like the absolute Unix icon you are. slay, periodt, and remember: flags stays 0. ππ
π¦ where this page comes from
- alpine 3.22: liburing-doc 2.9-r0 Β· LGPL-2.1-or-later OR MIT
- alpine 3.23: liburing-doc 2.12-r0 Β· LGPL-2.1-or-later OR MIT
- 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
- centos-stream 10: liburing-devel 2.12-1.el10 Β· (GPLv2 with exceptions and LGPLv2+) or MIT
- centos-stream 9: liburing-devel 2.12-1.el9 Β· (GPLv2 with exceptions and LGPLv2+) or MIT
- centos-stream 9: liburing-devel 2.12-1.el9 Β· (GPLv2 with exceptions and LGPLv2+) or MIT
- debian trixie: liburing-dev 2.9-1
- fedora 43: liburing-devel 2.9-2.fc43 Β· (GPL-2.0-only WITH Linux-syscall-note OR MIT) AND (LGPL-2.0-or-later OR MIT)
- fedora 43: liburing-devel 2.9-2.fc43 Β· (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)
- 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 questing: liburing-dev 2.11-1
- 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) 2022 Jens Axboe <axboe@kernel.dk>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms