1nbd_aio_opt_structured_reply(3)     LIBNBD     nbd_aio_opt_structured_reply(3)
2
3
4

NAME

6       nbd_aio_opt_structured_reply - request the server to enable structured
7       replies
8

SYNOPSIS

10        #include <libnbd.h>
11
12        typedef struct {
13          int (*callback) (void *user_data, int *error);
14          void *user_data;
15          void (*free) (void *user_data);
16        } nbd_completion_callback;
17
18        int nbd_aio_opt_structured_reply (
19              struct nbd_handle *h,
20              nbd_completion_callback completion_callback
21            );
22

DESCRIPTION

24       Request that the server use structured replies, by sending
25       "NBD_OPT_STRUCTURED_REPLY".  This behaves like the synchronous
26       counterpart nbd_opt_structured_reply(3), except that it does not wait
27       for the server's response.
28
29       To determine when the request completes, wait for
30       nbd_aio_is_connecting(3) to return false.  Or supply the optional
31       "completion_callback" which will be invoked as described in "Completion
32       callbacks" in libnbd(3), except that it is automatically retired
33       regardless of return value.  Note that detecting whether the server
34       returns an error (as is done by the return value of the synchronous
35       counterpart) is only possible with a completion callback.
36

RETURN VALUE

38       If the call is successful the function returns 0.
39

ERRORS

41       On error -1 is returned.
42
43       Refer to "ERROR HANDLING" in libnbd(3) for how to get further details
44       of the error.
45
46       The following parameters must not be NULL: "h".  For more information
47       see "Non-NULL parameters" in libnbd(3).
48

HANDLE STATE

50       The handle must be negotiating, otherwise this call will return an
51       error.
52

VERSION

54       This function first appeared in libnbd 1.16.
55
56       If you need to test if this function is available at compile time check
57       if the following macro is defined:
58
59        #define LIBNBD_HAVE_NBD_AIO_OPT_STRUCTURED_REPLY 1
60

SEE ALSO

62       nbd_aio_is_connecting(3), nbd_create(3), nbd_opt_structured_reply(3),
63       nbd_set_opt_mode(3), libnbd(3).
64

AUTHORS

66       Eric Blake
67
68       Richard W.M. Jones
69
71       Copyright Red Hat
72

LICENSE

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