nbd_get_handle_size(3)
β¨ nbd_get_handle_size β bestie, it's literally a size check β¨
okay so this is a page from the libnbd manual (that's the manual name, hi π), and it's about nbd_get_handle_size(3). Buckle up, it's short and sweet and honestly kind of iconic for being so small π
πΈ NAME πΈ
nbd_get_handle_size β returns an estimate of the memory allocated for the handle, no cap π
π¦ SYNOPSIS π¦
#include <libnbd.h>
ssize_t nbd_get_handle_size (
struct nbd_handle *h
);
β DESCRIPTION β
So the tea is: this call returns an estimate of the number of bytes allocated for the handle. That's it. That's the whole vibe β¨
And the main use for it? Honestly kind of niche but lowkey genius: it's for compacting garbage collectors, which can use this info to make a more informed decision about when to free the handle with. Like, they get to know how much memory is actually sitting there before they go yeeting it ποΈ
π RETURN VALUE π
This call returns an integer size β₯ 0. Slay, always non-negative π«Ά
π ERRORS π
On error, -1 is returned. Not the vibe, but okay π
Refer to "ERROR HANDLING" in libnbd(3) for how to get further details of the error.
Also, heads up bestie: the following parameters must not be NULL: "h". For more info, see "Non-NULL parameters" in libnbd(3). Do not pass a null handle, fr fr π
π°οΈ VERSION π°οΈ
This function first appeared in libnbd 1.24 π
If you need to test if this function is available at compile time, check if the following macro is defined:
#define LIBNBD_HAVE_NBD_GET_HANDLE_SIZE 1
π₯ SEE ALSO π₯
π«Ά AUTHORS π«Ά
Eric Blake
Richard W.M. Jones
(absolute legends, we stan π§)
Β©οΈ COPYRIGHT Β©οΈ
Copyright Red Hat
π LICENSE π
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
not me ending on a license paragraph lmaooo but legal stuff is legal stuff π read it, it matters
okay bye bestie, this was libnbd-1.24.4 documented on 2026-10-13 β go forth and estimate your handle sizes responsibly ππ
π¦ where this page comes from
- arch rolling: libnbd 1.24.4-1 Β· LGPL-2.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms