nbd_aio_opt_abort(3)
π
nbd_aio_opt_abort β bestie's guide (from the libnbd manual) π
okay so real talk, we're in the libnbd section 3 pages and this one is nbd_aio_opt_abort, and it's honestly giving "graceful exit, but make it async" β¨
πΈ NAME πΈ
nbd_aio_opt_abort β end negotiation and close the connection π«Ά
β¨ SYNOPSIS β¨
#include <libnbd.h>
int nbd_aio_opt_abort (
struct nbd_handle *h
);
π DESCRIPTION π
So basically you're sliding into the server's DMs like "hey queen, we're done here" β this requests that the server finish negotiation, gracefully if possible, then close the connection. Gracefully if possible, mind you, so it's a polite request, not a slam-the-door situation π
hard requirement tho: this can only be used if nbd_set_opt_mode(3) enabled option mode. No opt mode, no abort, no exceptions, periodt.
And to figure out when the request actually completes? You wait for nbd_aio_is_connecting(3) to return false. That's your signal, that's your vibe check, iykyk π
π¦ RETURN VALUE π¦
If the call is successful the function returns 0. slay π
π ERRORS π
On error -1 is returned. not the vibe, but okay.
Refer to "ERROR HANDLING" in libnbd(3) for how to get further details of the error β that's where the lore lives.
The following parameters must not be NULL: h. Like, must not. For more information see "Non-NULL parameters" in libnbd(3).
π HANDLE STATE π
nbd_aio_opt_abort can be called when the handle is in the following state β think of it as a little mood ring for your handle π:
- Handle created, before connecting β β error
- Connecting β β error
- Connecting & handshaking (opt_mode) β β allowed
- Connected to the server β β error
- Connection shut down β β error
- Handle dead β β error
so literally the only green light is "Connecting & handshaking (opt_mode)". one singular window. main character energy for real π₯
π VERSION π
This function first appeared in libnbd 1.4. vintage but make it fresh π
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_ABORT 1
π SEE ALSO π
go read them, they're all iconique β
π§ AUTHORS π§
Eric Blake
Richard W.M. Jones
(genuinely legends, no cap π)
π 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
fr fr read the license, it's not optional, bestie π
okay that's the whole page!! this was libnbd-1.25.8, dated 2026-10-13, page nbd_aio_opt_abort(3) β mwah, go abort some negotiation gracefully π
β¨
π¦ 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