nbd_get_export_name(3)
π nbd_get_export_name β get the export name β¨
okay so real talk, this is page nbd_get_export_name(3) from the LIBNBD manual, and bestie, it's about to be your new fave little one-liner. let's get into it π«Ά
πΈ NAME πΈ
nbd_get_export_name β get the export name. that's it. that's the whole job. iconic behavior honestly π
β¨ SYNOPSIS β¨
#include <libnbd.h>
char * nbd_get_export_name (
struct nbd_handle *h
);
like, one handle in, one string out. no cap, it's giving efficiency π
π¦ DESCRIPTION π¦
So this call gets the export name that's associated with the handle. That's the name that libnbd actually requests β the one you asked for, the one living on your handle. π
Now bestie, hear me β if you wanna know whether the server has a different canonical name for the export you asked for, that's a whole different function: go check nbd_get_canonical_export_name(3). And this is most common when you're requesting the default export name, which is the empty string "". like yes, the empty string is a name, it's valid, it's doing its little main character thing π
π RETURN VALUE π
This call returns a string. The caller must free the returned string to avoid a memory leak. not me reminding you twice β okay maybe me reminding you twice. free it. free the string. π«Ά
π₯ 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 β¨
Also: the following parameters must not be NULL: h. For more information see "Non-NULL parameters" in libnbd(3). so um, don't pass a NULL handle, it will not slay π
β VERSION β
This function first appeared in libnbd 1.0. a classic, an OG, a legend π
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_EXPORT_NAME 1
iykyk π§
π SEE ALSO π
the whole friend group, fr fr π
π AUTHORS π
- Eric Blake
- Richard W.M. Jones
the masterminds, the architects, the ones who ate and left no crumbs π
πΈ 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. (yes the all-caps is on purpose, it's that serious π₯)
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.
lowkey the most important takeaway: free the string. the leak is not the vibe. π
okay that's the page!! this one's from libnbd-1.25.8, dated 2026-10-13, and it's the nbd_get_export_name(3) page β mwah, love u, go free your strings π
β¨π
π¦ 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