io_uring_prep_remove_buffers(3)
π io_uring_prep_remove_buffers β the liburing manual, but make it cute π
okay bestie so this is a page from the liburing Manual, and it's about io_uring_prep_remove_buffers(3). yes the name is a whole mouthful, we're gonna get through it together π«Ά
β¨ NAME β¨
io_uring_prep_remove_buffers β prepare a remove buffers request
like, it preps a request. that removes buffers. the name is not being mysterious, it's being honest π
πΈ SYNOPSIS πΈ
#include <liburing.h>
void io_uring_prep_remove_buffers(struct io_uring_sqe *sqe,
int nr,
int bgid);
there she is. three arguments, zero drama, returns nothing π
π¦ DESCRIPTION π¦
so the io_uring_prep_remove_buffers(3) function prepares a request for removing previously supplied buffers. you're literally telling the kernel "hey, take some of those buffers back" π§
the submission queue entry sqe gets set up to remove nr number of buffers from the buffer group ID indicated by bgid.
that's it. that's the whole job. sqe = which entry, nr = how many, bgid = which buffer group. three little numbers and a whole vibe β¨
heads up: the buffers have to be previously supplied ones β you can't remove what was never there, iykyk π
π RETURN VALUE π
None
literally nothing. this function returns void. the β¨realβ¨ answer shows up later in the CQE, so keep reading, bestie π
π ERRORS π
okay so these are the errors that are reported in the CQE res field. not a return value, the CQE res field. important distinction, don't come for me.
on success, res will contain the number of successfully removed buffers. so like, you get a little receipt π§Ύ
on error, the following errors can occur:
-ENOMEMβ the kernel was unable to allocate memory for the request. it's giving broke energy, the kernel simply could not π₯²-EINVALβ one of the fields set in the SQE was invalid. you put something in there that it did not want π check your fields, bestie-ENOENTβ no buffers exist at the specifiedbgidbuffer group ID. there's nothing at that address. empty. ghost town. the group ID said "never heard of her" π»
π SEE ALSO π
go read these next, fr fr, they're the whole friend group:
π ok that's the page π
this whole thing came out of liburing-2.2, dated March 13, 2022 β so yes, she's a little vintage but she still ate π β¨ thanks for reading, go remove some buffers responsibly, 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 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