io_uring_prep_fallocate(3)
β¨ io_uring_prep_fallocate β¨
okay bestie, welcome to the liburing manual π this is the page for io_uring_prep_fallocate, and yes it's exactly as iconic as it sounds.
π NAME π
io_uring_prep_fallocate</purl> β get a fallocate request ready to go π
πΈ SYNOPSIS πΈ
#include <fcntl.h>
#include <liburing.h>
void io_uring_prep_fallocate(struct io_uring_sqe *sqe,
int fd,
int mode,
__u64 offset,
__u64 len);
like. look at that signature. she's serving. no return value, she just does things. periodt.
π¦ DESCRIPTION π¦
so the function io_uring_prep_fallocate(3) does one job and does it gorgeously: she preps a fallocate request. that's it, that's the whole vibe.
the submission queue entry sqe gets set up to use the file descriptor that fd points to, and it kicks off a fallocate operation. that operation is described by mode, and it happens at offset offset, stretching for len length in bytes. (yes, offset is both the parameter name and the word describing where it starts. she contains multitudes. we stan. π)
what you're actually cooking here is an async version of fallocate(2) β so like, the real one, just not blocking your whole life waiting on it. go read that man page if you want the details, bestie, because this one's just the setup girlie.
π RETURN VALUE π
None. she returns nothing. she's mysterious like that. π
π₯ ERRORS π₯
okay so this is the part where you don't go looking for a return value, because there isn't one. instead, the res field of the CQE will hold the result of the operation. head to the related man page for what values might show up there. π
and here's the big one, the thing that trips people up literally every time, so listen up:
where synchronous system calls will return-1on failure and seterrnoto the actual error value, io_uring never useserrno. instead it returns the negated errno directly in the CQEresfield.
so no errno hunting, no perror spirals. the answer is right there in res, just negative. iykyk. π
π SEE ALSO π
and that's the whole page, bestie!! π«Ά this was liburing-2.2, from March 13, 2022, out of the liburing Manual β thank you for coming to my ted talk, go forth and prep your SQEs responsibly πβ¨ππ¦πΈπ πβ
π¦ 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
- 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