nbd_aio_opt_extended_headers(3)

๐ŸŒธ NAME ๐ŸŒธ

nbd_aio_opt_extended_headers(3) from the LIBNBD manual โ€” bestie, this one is literally โ€œrequest the server to enable extended headers.โ€ Thatโ€™s the whole assignment. ๐Ÿ’…

โœจ SYNOPSIS โœจ

#include <libnbd.h>

typedef struct {
  int (*callback) (void *user_data, int *error);
  void *user_data;
  void (*free) (void *user_data);
} nbd_completion_callback;

int nbd_aio_opt_extended_headers (
      struct nbd_handle *h,
      nbd_completion_callback completion_callback
    );

๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

Okay so hereโ€™s the vibe: youโ€™re requesting that the server use extended headers by sending NBD_OPT_EXTENDED_HEADERS. This behaves like the synchronous counterpart nbd_opt_extended_headers(3), except that it does not wait for the serverโ€™s response. No cap.

To determine when the request completes, wait for nbd_aio_is_connecting(3) to return false. Or supply the optional completion_callback, which will be invoked as described in โ€œCompletion callbacksโ€ in libnbd(3), except that it is automatically retired regardless of return value. Lowkey important: detecting whether the server returns an error (as is done by the return value of the synchronous counterpart) is only possible with a completion callback.

๐Ÿ’– RETURN VALUE ๐Ÿ’–

If the call is successful the function returns 0. Slay. โœจ

๐Ÿ’€ ERRORS ๐Ÿ’€

On error -1 is returned. Oof.

Refer to โ€œERROR HANDLINGโ€ in libnbd(3) for how to get further details of the error.

The following parameters must not be NULL: "h". For more information see โ€œNon-NULL parametersโ€ in libnbd(3).

๐Ÿ‘‘ HANDLE STATE ๐Ÿ‘‘

nbd_aio_opt_extended_headers can be called when the handle is in the following state:

  • Handle created, before connecting โ€” โŒ error
  • Connecting โ€” โŒ error
  • Connecting & handshaking (opt_mode) โ€” โœ… allowed
  • Connected to the server โ€” โŒ error
  • Connection shut down โ€” โŒ error
  • Handle dead โ€” โŒ error

โญ VERSION โญ

This function first appeared in libnbd 1.18.

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

#define LIBNBD_HAVE_NBD_AIO_OPT_EXTENDED_HEADERS 1

๐ŸŒˆ SEE ALSO ๐ŸŒˆ

๐Ÿซถ AUTHORS ๐Ÿซถ

  • Eric Blake
  • Richard W.M. Jones

Copyright Red Hat

๐Ÿ’œ LICENSE ๐Ÿ’œ

legal bestie moment โ€” hereโ€™s the exact tea:

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


xoxo, your terminal bestie โ€” this page is from libnbd-1.25.8, dated 2026-10-13, and itโ€™s all about nbd_aio_opt_extended_headers(3). ๐Ÿ’…โœจ

๐Ÿ“ฆ where this page comes from