io_uring_reg..._alloc_range(3)
π io_uring_reg..._alloc_range(3) π
okay bestie, welcome to the liburing Manual β¨ this is the page for io_uring_register_file_alloc_range, and it's lowkey iconic. sit down, grab a strawberry π, let's get into it.
β¨ NAME β¨
io_uring_register_file_alloc_range β set the range for fixed file allocations, periodt π
πΈ SYNOPSIS πΈ
#include <liburing.h>
int io_uring_register_file_alloc_range(struct io_uring *ring,
unsigned off,
unsigned len);
look at her. three little arguments. she's so clean π
π¦ DESCRIPTION π¦
so here's the tea β β io_uring_register_file_alloc_range(3) sets the allowable range for fixed file index allocations inside the kernel. that's the whole vibe.
now, when you've got requests that can instantiate a brand new fixed file, and you use them together with IORING_FILE_INDEX_ALLOC, your application is basically telling the kernel: "bestie, you pick the descriptor, I'm not giving you a specific value for one." and by default, the kernel will just pick any available fixed file descriptor within the range that's available. no thoughts, head empty, just vibes π
but that's where this function comes in!! if you call it with off set to the starting offset and len set to the number of descriptors, your application can limit the allocated descriptors to that particular range. so cute, so controlled β¨
and honestly? the practical effect is slay: it effectively lets the application set aside a range just for dynamic allocations, while the remainder gets used for specific values. like partitioning your closet but for file descriptors π
important bestie!! π¨ the application must have registered a fixed file table upfront β for example throughio_uring_register_files(3)orio_uring_register_files_sparse(3). no table, no range, no dice. don't skip this step, fr fr π
Available since 6.0. so if you're on something ancient, that's a you problem π
π RETURN VALUE π
- on success,
io_uring_register_file_alloc_range(3)returns0. flawless, no notes π«Ά - on failure, it returns
-errno. the drama π
π SEE ALSO π
io_uring_register_files(3)io_uring_prep_accept_direct(3)io_uring_prep_openat_direct(3)io_uring_prep_socket_direct(3)
go read them, iykyk π
and that's the page!! this whole thing is liburing-2.3, dated Oct 21, 2022 β so it's giving vintage but make it cute π mwah, bye bestie ππ§β¨
π¦ 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