nbd_set_socket_activation_name(3)
π nbd_set_socket_activation_name β set the socket activation name π
πΈ NAME πΈ
okay bestie, you're on the nbd_set_socket_activation_name(3) page in the LIBNBD manual, and this one is lowkey a lil name-tag moment for your socket π
nbd_set_socket_activation_name β set the socket activation name β¨
π¦ SYNOPSIS π¦
#include <libnbd.h>
int nbd_set_socket_activation_name (
struct nbd_handle *h, const char *socket_name
);
π DESCRIPTION π
so when you're running an NBD server using nbd_connect_systemd_socket_activation(3), you can optionally name the socket. iconic, honestly. call this function before connecting to the server, fr fr π«Ά
some servers, like qemu-storage-daemon(1), can use this info to associate the socket with a name used on the command line. most servers will just ignore it tho β not everyone is main character energy. the name is passed through the LISTEN_FDNAMES environment variable π
the parameter socket_name can be a short alphanumeric string. if it's set to the empty string β which is also the default when the handle is created β then the server will see the name unknown π
β RETURN VALUE β
if the call is successful, the function returns 0. slay β
π ERRORS π
on error, -1 is returned π
refer to ERROR HANDLING in libnbd(3) for how to get further details of the error.
the following parameters must not be NULL: h, socket_name. for more info, see Non-NULL parameters in libnbd(3). no cap, those two have to be real.
π HANDLE STATE π
you can call nbd_set_socket_activation_name when the handle is in these states, and here's the vibe check:
- Handle created, before connecting β β allowed
- Connecting β β error
- Connecting & handshaking (
opt_mode) β β error - Connected to the server β β error
- Connection shut down β β error
- Handle dead β β error
π§ VERSION π§
this function first appeared in libnbd 1.16. periodt.
if you need to test if this function is available at compile time, check if the following macro is defined:
#define LIBNBD_HAVE_NBD_SET_SOCKET_ACTIVATION_NAME 1
π₯ SEE ALSO π₯
π AUTHORS π
- Eric Blake
- Richard W.M. Jones
πΈ COPYRIGHT πΈ
Copyright Red Hat
π LICENSE π
legal bestie moment β here's the license, word-for-word, because we do not mess with legal text:
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
kisses π β this iconic page is from libnbd-1.25.8, dated 2026-10-13, and it's the nbd_set_socket_activation_name(3) manual page. periodt. π
π¦ 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