nbd_get_tls_username(3)

πŸ’… nbd_get_tls_username β€” get the current TLS username

okay so bestie, this is a page from libnbd (that's the manual section 3 btw) and honestly it's giving "short and sweet" energy. Let's get into it πŸŽ€


✨ SYNOPSIS ✨

#include <libnbd.h>

char * nbd_get_tls_username (
         struct nbd_handle *h
       );

like, that's the whole vibe. one function, one handle, one char * coming back at you πŸ¦‹


🌸 DESCRIPTION 🌸

This call returns the current TLS username. that's it. that's the function. she's a getter and she's iconic for it πŸ’…


πŸ’– RETURN VALUE πŸ’–

This call returns a string (char *, bestie, keep up ✨).

⚠️ okay this part is important β€” the caller must free the returned string. not "should", not "maybe", must, or you get a memory leak and the vibe check fails 😭 fr fr, free your strings.

πŸ”₯ ERRORS πŸ”₯

On error NULL is returned. simple as that πŸ’€

If you want the deets on what actually went wrong, refer to "ERROR HANDLING" in libnbd(3) β€” that's where all the further-details-of-the-error lore lives 🧚

Also! the following parameters must not be NULL: "h". For more info see "Non-NULL parameters" in libnbd(3). The handle is the main character here, don't ghost her with a NULL 🫢


⭐ VERSION ⭐

This function first appeared in libnbd 1.0. she's been here since the beginning, a true OG πŸ‘‘

If you need to test at compile time whether this function is available, check whether the following macro is defined:

#define LIBNBD_HAVE_NBD_GET_TLS_USERNAME 1

iykyk, compile-time feature checks are lowkey essential 🌈


πŸ¦‹ SEE ALSO πŸ¦‹

(the setter to this getter! they're a matching set, obsessed πŸ“)


πŸ‘‘ AUTHORS πŸ‘‘

  • Eric Blake
  • Richard W.M. Jones

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

no cap, the "no warranty" bit is real β€” read the LGPL, bestie, it's giving legal-ese but it matters πŸ™ˆ

and that's the page!! 🌸 this little beauty is from libnbd-1.25.8, dated 2026-10-13, and she's known around these parts as nbd_get_tls_username(3) β€” mwah, go free that string πŸ’‹πŸ’–

πŸ“¦ where this page comes from