nbdkit_export_name(3)
π nbdkit_export_name π
okay bestie, so this is nbdkit_export_name(3), a lil page from the NBDKIT manual. it's giving "one tiny function, huge main character energy" and honestly? we're obsessed. let's get into it π¦
β¨ NAME β¨
nbdkit_export_name β get the NBD export name for nbdkit. that's it. that's the whole job. slay.
πΈ SYNOPSIS πΈ
like, the actual signature, no cap:
#include <nbdkit-plugin.h>
const char *nbdkit_export_name (void);
π DESCRIPTION π
so what it does is: it returns the optional NBD export name, but only if one was actually negotiated with the current client. and the way it pulls this off? thread-local magic β¨ so you don't even have to pass a parameter. iconic behaviour, truly.
the export name is a free-form text string, bestie. it is not necessarily a path or a filename, and it does not need to begin with a '/' character. like, don't assume. the NBD protocol describes the empty string ("") as representing a "default export", or as the thing you use when the export name doesn't even make sense.
β οΈ okay this part matters, listen up: the export name is untrusted client data. be cautious when parsing it. like, do not just trust it, fr fr. π¨
π RETURN VALUE π
the function returns a string. the returned string is valid at least through the .close of the current connection β but if you need to store it in the plugin so it can be used by more than one client, you must copy it. no shortcuts, bestie, that pointer will betray you.
if there's an error, it calls nbdkit_error(3) and returns NULL. π
π LANGUAGE BINDINGS π
she's multilingual, she's global, she's everywhere π
π« In nbdkit-ocaml-plugin(3):
NBDKit.export_name : unit -> string
π In nbdkit-python-plugin(3):
import nbdkit
name = nbdkit.export_name()
π¦ In nbdkit-rust-plugin(3):
use nbdkit::*;
pub fn export_name() -> std::result::Result<String, Box<dyn error::Error>>
π In nbdkit-sh-plugin(3):
the export name is available as parameter $3 of the "open" method. yes, just $3. go get her.
π°οΈ HISTORY π°οΈ
"nbdkit_export_name" was added in nbdkit 1.16. a classic. a legend. an era. β
π SEE ALSO π
go read these too, they're all part of the friend group:
π AUTHORS π
Richard W.M. Jones π
Β©οΈ COPYRIGHT Β©οΈ
Copyright Red Hat
π LICENSE π
okay so legally speaking, redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
- Neither the name of Red Hat nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
π«Ά and now the scary part, in all caps because it means business: THIS SOFTWARE IS PROVIDED BY RED HAT AND CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
and that's the whole page, bestie!! πβ¨ this lil legend is from nbdkit-1.48.1, dated 2026-08-29 β mwah, go forth and parse responsibly πππ¦
π¦ where this page comes from
- fedora 44: nbdkit-devel 1.48.1-1.fc44 Β· BSD-3-Clause
- fedora 44: nbdkit-devel 1.48.1-1.fc44 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms