io_uring_prep_tee(3)

πŸ“¦
version 2.14 Β· 2 versions
  • 2.14 Β· alpine 3.22, alpine 3.23, alpine 3.24, centos-stream 10, centos-stream 9, debian bookworm, debian trixie, fedora 43, fedora 44, nixpkgs unstable, opensuse-leap 16.0, ubuntu noble, ubuntu questing, ubuntu resolute (latest)
  • 2.15 Β· arch rolling, ubuntu stonking
, in alpine 3.22, alpine 3.23, alpine 3.24, centos-stream 10, centos-stream 9, debian bookworm, debian trixie, fedora 43, fedora 44, nixpkgs unstable, opensuse-leap 16.0, ubuntu noble, ubuntu questing, ubuntu resolute

✨ io_uring_prep_tee(3) ✨

okay bestie, welcome to the liburing Manual πŸ’– this one's about io_uring_prep_tee, and no, we're not talking about your favorite oversized t-shirt. we're talking about duplicating pipe data. iconic behavior tbh 🫢


🌸 NAME 🌸

io_uring_prep_tee β€” prepare a tee request πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <fcntl.h>
#include <liburing.h>

void io_uring_prep_tee(struct io_uring_sqe *sqe,
                       int fd_in,
                       int fd_out,
                       unsigned int nbytes,
                       unsigned int splice_flags);

look at her. five whole arguments. main character energy fr fr πŸ‘‘


πŸ’œ DESCRIPTION πŸ’œ

so the io_uring_prep_tee(3) function prepares a tee request. she sets up the submission queue entry sqe so that it uses the file descriptor fd_in as input and the file descriptor fd_out as output, duplicating nbytes bytes worth of data. and then splice_flags? those are the modifier flags for the operation, bestie. if you wanna know the generic splice flags, go check tee(2), she has the lore πŸ“–βœ¨

now here's the tea on the fd_out descriptor β€” IOSQE_FIXED_FILE can be set in the SQE to indicate that it's a fixed file. and for the input file, the io_uring specific SPLICE_F_FD_IN_FIXED can be set, and fd_in gets given as a registered file descriptor offset. yes, that's a mouthful. yes, it's giving very specific. slay πŸ’…

this function prepares an async tee(2) request. see that man page for the deets, i'm not about to gatekeep you from the source 🌈


πŸŽ€ RETURN VALUE πŸŽ€

None. that's it. that's the whole section. she returns nothing and she's unbothered πŸ’€


⭐ ERRORS ⭐

the CQE res field will contain the result of the operation. see the related man page for details on the possible values πŸ‘€

⚠️ okay important thing, listen up: where synchronous system calls will return -1 on failure and set errno to the actual error value, io_uring never uses errno. instead it returns the negated errno directly in the CQE res field. not me being dramatic but this trips people UP. note it. remember it. periodt πŸ’…

πŸ”₯ SEE ALSO πŸ”₯


and that's the whole page bestie!! this was brought to you by liburing-2.2, dated March 13, 2022 β€” yeah she's a lil vintage but she still eats πŸ’– go forth and duplicate your pipe data responsibly, mwah πŸŽ€βœ¨πŸ¦‹

πŸ“¦ where this page comes from