io_uring_prep_ftruncate(3)
β¨ io_uring_prep_ftruncate β prepare an ftruncate request β¨
okay so bestie, this is page 3 of the liburing Manual for io_uring_prep_ftruncate, and I am so ready to tell you about it π
π NAME π
io_uring_prep_ftruncate β prepare an ftruncate request
like. that's it. that's the whole job. and she does it flawlessly π
πΈ SYNOPSIS πΈ
#include <liburing.h>
void io_uring_prep_ftruncate(struct io_uring_sqe *sqe,
int fd,
loff_t len);
π¦ DESCRIPTION π¦
so the io_uring_prep_ftruncate(3) function prepares an ftruncate request, no cap. The submission queue entry sqe gets set up to use the file descriptor fd β that's the one that should get truncated β down (or up, we don't judge) to the length indicated by the len argument. iconic behaviour honestly β¨
π¨ important bestie alert π¨ Applications must define_GNU_SOURCEto obtain the definition of this helper, becauseloff_twill not be defined without it. and ifloff_tisn't defined, nothing compiles, and we simply cannot have that π
π RETURN VALUE π
None. she returns nothing. she's mysterious like that π
π₯ ERRORS π₯
The CQE res field will contain the result of the operation. See the related man page for the details on possible values, fr fr β I'm not about to make up numbers that aren't in the original, that's not the vibe. π
Now here's the part you need to know: where synchronous system calls will return -1 on failure and set errno to the actual error value, io_uring never uses errno. periodt. Instead it returns the negated errno directly in the CQE res field. so like, negative number = your error code, just flipped. remember that or you'll be debugging for three business days π«Ά
π SEE ALSO π
and that's the whole page!! go truncate something responsibly, bestie πβ¨πΈπ¦ππ
this was page io_uring_prep_ftruncate(3) from liburing-2.6, dated January 23, 2024 β ty for coming to my ted talk, 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
- 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 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) 2024 Tony Solomonik <tony.solomonik@gmail.com>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms