nbd_get_extend...ders_negotiated(3)
π NAME π
nbd_get_extended_headers_negotiated β bestie, this is literally the little function that tells you whether extended headers are in use β¨
(oh and hey, this is a page from the libnbd manual, in case you were wondering where you wandered into π«Ά)
β¨ SYNOPSIS β¨
#include <libnbd.h>
int nbd_get_extended_headers_negotiated (
struct nbd_handle *h
);
πΈ DESCRIPTION πΈ
So after you've connected, you can call this little icon to find out if your connection is using extended headers π
Important vibe check tho: this setting is sticky β it can return true even after a second nbd_opt_extended_headers(3) returns false, and that happens because the server detected a duplicate request. So don't come for her, she's just remembering what happened π
When extended headers are not in use, commands are limited to a 32-bit length β and yes, that's true even when the libnbd API uses a 64-bit parameter to express the length π But even when extended headers are supported, the server may enforce other limits, and those are visible through nbd_get_block_size(3).
Also, when extended headers are negotiated, you should prefer using nbd_block_status_64(3) instead of nbd_block_status(3) if any of the meta contexts you requested via nbd_add_meta_context(3) might return 64-bit status values π¦ However (and this is the chill part), all of the well-known meta contexts covered by current "LIBNBD_CONTEXT_*" constants only return 32-bit status. Slay.
π RETURN VALUE π
This call returns a boolean value. Simple as that, no cap π
π 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". For more information see "Non-NULL parameters" in libnbd(3).
π¦ HANDLE STATE π¦
nbd_get_extended_headers_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
Like, read the room bestie β if the handle is dead or hasn't even started connecting, she is not gonna answer you π
β 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_GET_EXTENDED_HEADERS_NEGOTIATED 1
π SEE ALSO π
nbd_add_meta_context(3), nbd_block_status(3), nbd_block_status_64(3), nbd_cache(3), nbd_create(3), nbd_get_block_size(3), nbd_get_protocol(3), nbd_get_request_extended_headers(3), nbd_get_structured_replies_negotiated(3), nbd_opt_extended_headers(3), nbd_set_request_extended_headers(3), nbd_trim(3), nbd_zero(3), libnbd(3).
π AUTHORS π
Eric Blake
Richard W.M. Jones
π COPYRIGHT π
Copyright Red Hat
π LICENSE π
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, ily, go read your extended headers in peace π§π this was libnbd-1.25.8, dated 2026-10-1 β 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