nbd_get_meta_context(3)
β¨ nbd_get_meta_context(3) β¨
okay bestie, this is a page from libnbd and honestly it's a little cutie π β it hands you back the i'th meta context request you asked for. Let's get into it π
π NAME π
nbd_get_meta_context β return the i'th meta context request β¨
πΈ SYNOPSIS πΈ
#include <libnbd.h>
char * nbd_get_meta_context (
struct nbd_handle *h, size_t i
);
like, that's the whole vibe π«Ά
π¦ DESCRIPTION π¦
so during connection, libnbd can negotiate zero or more metadata contexts with the server. no cap β zero is allowed, it's not a typo π
metadata contexts are features (like base:allocation) that describe the info returned by the nbd_block_status_64(3) command. and for base:allocation specifically? that one's telling you whether blocks of data are allocated, zero, or sparse. icon material honestly π
this command returns the i'th meta context request β as added by nbd_add_meta_context(3), and bounded by nbd_get_nr_meta_contexts(3). so like, i has a ceiling, bestie, respect the ceiling π
π RETURN VALUE π
this call returns a string. β
not me about to let you leak memory β the caller must free the returned string to avoid a memory leak. that's a free() on your tab, not mine π
π₯ ERRORS π₯
on error, NULL is returned. π
refer to "ERROR HANDLING" in libnbd(3) for how to get further details of the error β that's where the lore lives π
the following parameters must not be NULL: h. for more info see "Non-NULL parameters" in libnbd(3). like, h is the main character here, do not pass her in as NULL π«Ά
π VERSION π
this function first appeared in libnbd 1.6. a whole era β¨
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_META_CONTEXT 1
slay, conditional compilation π§
π SEE ALSO π
nbd_add_meta_context(3)nbd_block_status_64(3)nbd_can_meta_context(3)nbd_clear_meta_contexts(3)nbd_create(3)nbd_get_nr_meta_contexts(3)libnbd(3)
the whole friend group, fr fr π«Ά
π AUTHORS π
Eric Blake
Richard W.M. Jones
both iconic, both ate π
π 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
and that's the page, bestie π this one's from libnbd-1.25.8, dated 2026-10-13, and it's the nbd_get_meta_context(3) page β go free your strings and stay hydrated π§ββοΈβ¨
π¦ where this page comes from
- centos-stream 10: libnbd-devel 1.25.8-1.el10 Β· LGPL-2.0-or-later AND BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms