io_uring_prep_write_fixed(3)
π io_uring_prep_write_fixed(3) π
okay bestie, you know liburing? the liburing Manual? yeah. this is one of those pages. it's giving "registered buffer write energy" and honestly? we're obsessed. π¦
β¨ NAME β¨
io_uring_prep_write_fixed β prepare an I/O write request with a registered buffer, no cap π«Ά
β¨ SYNOPSIS β¨
#include <liburing.h>
void io_uring_prep_write_fixed(struct io_uring_sqe *sqe,
int fd,
const void *buf,
unsigned nbytes,
__u64 offset,
int buf_index);
β¨ DESCRIPTION β¨
so like. io_uring_prep_write_fixed(3) sets you up with an I/O write request that uses a buffer you already registered earlier. the submission queue entry sqe gets all dressed up so it can use the file descriptor fd and start writing nbytes out of the buffer buf, at the offset you picked, with the buffer matching the registered index buf_index. π
basically it works exactly like io_uring_prep_write(3) β same vibe, same energy β except it requires you to use buffers that you registered with io_uring_register_buffers(3). like, mandatory. no registration, no write. periodt. π₯
and listen: buf and nbytes have to fall within a region that's specified by buf_index in the previously registered buffer. that part is non-negotiable. but β and this is the slay part β the buffer does not need to be aligned with the start of the registered buffer. she's flexible like that. β¨
once the write has been prepared, you can submit it with one of the submit functions. that's it, that's the whole thing. go off. π
β¨ RETURN VALUE β¨
None. literally nothing. it returns nothing. that's the whole section bestie π
β¨ ERRORS β¨
the res field of the CQE is where the result of the operation lives. check the related man page for the deets on possible values. π
β οΈ okay important: where synchronous system calls would return-1on failure and seterrnoto the actual error value,io_uringnever useserrno. instead it returns the negated errno directly in the CQEresfield. so don't go looking forerrnoin there, she's not home π
β¨ SEE ALSO β¨
and that's the page!! π this was liburing-2.1, dated February 13, 2022 β yes she's an icon, yes she's from liburing, yes she ate. mwah πβ¨π¦
π¦ 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
- 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
- π 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