io_uring_free_buf_ring(3)
π io_uring_free_buf_ring β the liburing manual, but make it cute π
okay bestie, so this is a page from the liburing Manual, and it's literally the β¨cleanupβ¨ era of your buffer ring's life. no cap.
β¨ NAME β¨
io_uring_free_buf_ring β register and free a buffer ring for provided buffers π
πΈ SYNOPSIS πΈ
#include <liburing.h>
int io_uring_free_buf_ring(struct io_uring *ring,
struct io_uring_buf_ring *br,
unsigned int nentries,
int bgid);
π¦ DESCRIPTION π¦
so the way that io_uring_free_buf_ring(3) works is: it unregisters a shared buffer ring you already registered before. and like, the ring must have previously been handed to you by io_uring_setup_buf_ring(3) β if it didn't come from there, bestie, we're not doing this π
here's the vibe check on the arguments:
ringβ must point to the ring that this provided buffer ring was registered for. πbrβ must point to a buffer ring thatio_uring_setup_buf_ring(3)previously returned. no imposter rings allowed πnentriesβ the number of entries you requested in that buffer ring. π’bgidβ the buffer group ID thatbrwas set up with. gotta match, fr fr. π·οΈ
and under the covers? this function uses io_uring_unregister_buf_ring(3) to unregister the ring, and it handles the freeing of the ring for you instead of making your application open code it. it's giving β¨main character energyβ¨ β you just call it, it does the whole little cleanup routine, and you don't have to write the messy bits yourself. obsessed. π«Ά
Available since 5.19. β (yes, that's kernel 5.19, so check your kernel before you get attached)
π RETURN VALUE π
- On success,
io_uring_free_buf_ring(3)returns zero β slay. β¨ - On failure, it returns
-errnoβ so it's negative, and the value is the errno. read it, don't ignore it. π
π SEE ALSO π
io_uring_setup_buf_ring(3)β the one that gave you the ring in the first place π
and that's the whole page, bestie. this was liburing-2.4, dated Mar 07, 2023 β go forth and free your buffer rings 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 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) 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