nbd_get_struct...lies_negotiated(3)

nbd_get_structured_replies_negotiated(3) πŸ’…βœ¨

okay bestie, welcome to the LIBNBD manual β€” this is the page for nbd_get_structured_replies_negotiated(3), and it’s here to tell you if structured replies are in use. no cap. 🫢

🌸 NAME 🌸

nbd_get_structured_replies_negotiated β€” see if structured replies are in use πŸŽ€

✨ SYNOPSIS ✨

bestie, include the header and call it like this:

        #include <libnbd.h>

        int nbd_get_structured_replies_negotiated (
              struct nbd_handle *h
            );

πŸ¦‹ DESCRIPTION πŸ¦‹

After you’ve connected, you may call this to find out if the connection is using structured replies. ✨

okay but here’s the sticky part β€” literally, this setting is sticky: this can return true even after a second nbd_opt_structured_reply(3) returns false, because the server detected a duplicate request. πŸ’…

also important: if the connection negotiates extended headers, this function returns true (as extended headers imply structured replies) even if no explicit request for structured replies was attempted. πŸ‘‘

πŸ’– RETURN VALUE πŸ’–

This call returns a boolean value. that’s it, that’s the tea. periodt. πŸ“

😭 ERRORS 😭

On error -1 is returned. 😭

Refer to "ERROR HANDLING" in libnbd(3) for how to get further details of the error. iykyk.

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

πŸ‘‘ HANDLE STATE πŸ‘‘

nbd_get_structured_replies_negotiated can be called when the handle is in the following states:

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

🌈 VERSION 🌈

This function first appeared in libnbd 1.2. πŸŽ€

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

#define LIBNBD_HAVE_NBD_GET_STRUCTURED_REPLIES_NEGOTIATED 1

πŸ”₯ SEE ALSO πŸ”₯

go read these too, bestie β€” they’re all part of the lore:

🧚 AUTHORS 🧚

the icons behind this:

  • Eric Blake
  • Richard W.M. Jones

Copyright Red Hat

🌸 LICENSE 🌸

legal bestie time β€” here’s the whole thing, unchanged:

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


okay that’s the whole page, bestie β€” sourced from libnbd-1.25.8, dated 2026-10-1, and it’s the nbd_get_struct...lies_negotiated(3) page in the LIBNBD manual. mwah πŸ’‹βœ¨

πŸ“¦ where this page comes from