1nbd_set_socket_activation_name(3)   LIBNBD   nbd_set_socket_activation_name(3)
2
3
4

NAME

6       nbd_set_socket_activation_name - set the socket activation name
7

SYNOPSIS

9        #include <libnbd.h>
10
11        int nbd_set_socket_activation_name (
12              struct nbd_handle *h, const char *socket_name
13            );
14

DESCRIPTION

16       When running an NBD server using
17       nbd_connect_systemd_socket_activation(3) you can optionally name the
18       socket.  Call this function before connecting to the server.
19
20       Some servers such as qemu-storage-daemon(1) can use this information to
21       associate the socket with a name used on the command line, but most
22       servers will ignore it.  The name is passed through the
23       "LISTEN_FDNAMES" environment variable.
24
25       The parameter "socket_name" can be a short alphanumeric string.  If it
26       is set to the empty string (also the default when the handle is
27       created) then the name "unknown" will be seen by the server.
28

RETURN VALUE

30       If the call is successful the function returns 0.
31

ERRORS

33       On error -1 is returned.
34
35       Refer to "ERROR HANDLING" in libnbd(3) for how to get further details
36       of the error.
37
38       The following parameters must not be NULL: "h", "socket_name".  For
39       more information see "Non-NULL parameters" in libnbd(3).
40

HANDLE STATE

42       The handle must be newly created, otherwise this call will return an
43       error.
44

VERSION

46       This function first appeared in libnbd 1.16.
47
48       If you need to test if this function is available at compile time check
49       if the following macro is defined:
50
51        #define LIBNBD_HAVE_NBD_SET_SOCKET_ACTIVATION_NAME 1
52

SEE ALSO

54       nbd_connect_systemd_socket_activation(3), nbd_create(3),
55       nbd_get_socket_activation_name(3), libnbd(3).
56

AUTHORS

58       Eric Blake
59
60       Richard W.M. Jones
61
63       Copyright Red Hat
64

LICENSE

66       This library is free software; you can redistribute it and/or modify it
67       under the terms of the GNU Lesser General Public License as published
68       by the Free Software Foundation; either version 2 of the License, or
69       (at your option) any later version.
70
71       This library is distributed in the hope that it will be useful, but
72       WITHOUT ANY WARRANTY; without even the implied warranty of
73       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
74       Lesser General Public License for more details.
75
76       You should have received a copy of the GNU Lesser General Public
77       License along with this library; if not, write to the Free Software
78       Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
79       02110-1301 USA
80
81
82
83libnbd-1.16.5                     2023-09-26 nbd_set_socket_activation_name(3)
Impressum