nbd_get_strict_mode(3)

✨ nbd_get_strict_mode(3) ✨

okay so this is a page from the libnbd manual and honestly it's a little sleeper hit β€” it's the one that tells you which protocol strictness vibes are currently being enforced. let's get into it πŸŽ€


πŸ’– NAME πŸ’–

nbd_get_strict_mode β€” see which strictness flags are in effect. that's it, that's the whole thing, and it's lowkey important 🫢


🌸 SYNOPSIS 🌸

#include <libnbd.h>

uint32_t nbd_get_strict_mode (
           struct nbd_handle *h
         );

bestie, it's a getter. one handle in, one uint32_t out. no drama πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

so what this does is return flags indicating which protocol strictness items are being enforced locally by libnbd rather than by the server. like, these are the rules your own library is out here policing by itself, no server input needed, main character energy fr fr πŸ‘‘

one thing to keep in mind (and this is a real one, not a drill): the return value from a newer library version may include bits that were undefined at the time of compilation. so if you built against an older header and then run against a newer lib, you might see bits you've literally never heard of. that's expected, not a bug β€” don't panic 😭


⭐ RETURN VALUE ⭐

This call returns a bitmask of LIBNBD_STRICT_* values. bitmask, so you're gonna be doing bitwise checks β€” you know the drill ✨


πŸ”₯ ERRORS πŸ”₯

This function does not fail. no cap, it literally cannot fail. it's giving unbothered, it's giving flawless 🌈

The following parameters must not be NULL: "h". For more information see "Non-NULL parameters" in libnbd(3). so like, don't hand it a null handle, that's the one thing 🫠


🧚 VERSION 🧚

This function first appeared in libnbd 1.6.

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_STRICT_MODE 1

iykyk β€” that macro is your little vibe check for compile time πŸ’«


🌷 SEE ALSO 🌷

(the setter is right there, go read it, they're besties) 🫢


πŸ‘‘ AUTHORS πŸ‘‘

  • Eric Blake
  • Richard W.M. Jones

legends, honestly. we stan πŸ’œ


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

real talk: that's the legal section, so keep it exactly as-is if you're actually shipping anything. the vibes are mine, the warranty disclaimer is theirs 😌

and that's the page!! this one's from libnbd-1.25.8, dated 2026-10-13, so that's the era of the manual you're reading β€” slay, go forth and check your strictness flags πŸ’–πŸŽ€

πŸ“¦ where this page comes from