io_uring_pre...nc_file_range(3)
β¨ io_uring_prep_sync_file_range β bestie edition π
okay so this is a page from the liburing Manual, and it's about the cutest little helper that queues up a sync_file_range request for you. no cap, it's short, it's sweet, it slays. let's get into it π«Ά
πΈ NAME πΈ
io_uring_prep_sync_file_range β prepare a sync_file_range request
π SYNOPSIS π
#include <fcntl.h>
#include <liburing.h>
void io_uring_prep_sync_file_range(struct io_uring_sqe *sqe,
int fd,
unsigned len,
__u64 offset,
int flags);
π DESCRIPTION π
so like. the io_uring_prep_sync_file_range(3) function prepares a sync_file_range request. that's literally its whole job and it does it flawlessly, periodt.
the submission queue entry sqe gets set up to use the file descriptor fd β that's the file that's gonna get len bytes synced, starting at offset offset, with the modifier flags in the flags argument. yes the argument is called flags and it holds flags. iconic naming honestly, we love a self-explanatory king π
this function prepares an async sync_file_range(2) request. so if you wanna know the actual details on what those arguments do, go read that man page bestie, this one is just the setup girlie π§
β RETURN VALUE β
None
that's it. nothing. void. she returns nothing and she's valid for it π
π ERRORS π
the CQE res field will contain the result of the operation. peek at the related man page for details on possible values, iykyk.
important: where synchronous system calls will return-1on failure and seterrnoto the actual error value, io_uring never useserrno. instead it returns the negatederrnodirectly in the CQEresfield. so like, don't go checkingerrno, she doesn't live there anymore. it's giving glow up π
π SEE ALSO π
and that's the whole page bestie!! π¦ this was brought to you by liburing-2.2, dated March 12, 2022 β go sync some file ranges, you absolute main character ππβ¨
π¦ 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 bookworm: liburing-dev 2.3-3
- 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
- opensuse-leap 16.0: liburing-devel 2.8-160000.3.1 Β· (GPL-2.0-only AND LGPL-2.1-or-later) OR MIT
- opensuse-leap 16.0: liburing-devel 2.8-160000.3.1 Β· (GPL-2.0-only AND LGPL-2.1-or-later) OR MIT
- opensuse-leap 16.0: liburing-devel 2.8-160000.3.1 Β· (GPL-2.0-only AND LGPL-2.1-or-later) OR MIT
- opensuse-leap 16.0: liburing-devel 2.8-160000.3.1 Β· (GPL-2.0-only AND LGPL-2.1-or-later) OR MIT
- ubuntu noble: liburing-dev 2.5-1build1
- 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