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 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