nbd_kill_subprocess(3)
π nbd_kill_subprocess(3) π
okay so this little cutie lives in the libnbd manual, section 3, and honestly? she's the "break glass in case of emergency" bestie of the libnbd fam. let's get into it β¨
πΈ NAME πΈ
nbd_kill_subprocess β kill server running as a subprocess π
like, literally. it's the "okay we tried being nice, now we're not" function.
π SYNOPSIS π
#include <libnbd.h>
int nbd_kill_subprocess (
struct nbd_handle *h, int signum
);
she's small, she's tidy, she takes exactly two things. no notes. π
β¨ DESCRIPTION β¨
so here's the vibe: you've got a server running as a subprocess, and you made it with nbd_connect_command(3). this call lets you kill that server. that's it. that's the whole thing.
and bestie, listen to me β you do not need to use this call. fr fr. she's only here for the specific situation where the server does not exit when the socket is closed. that's the only time she gets invited to the party. π
the signum parameter is the optional signal number you wanna send (peep signal(7) for the full menu of signals). and if signum is 0, then SIGTERM is what gets sent β so like, the polite-but-firm option is the default. π«Ά
π₯ RETURN VALUE π₯
if the call is successful, the function returns 0. slay. β
π ERRORS π
on error, -1 is returned. not slay. π
for the full tea on how to get further details of the error, refer to "ERROR HANDLING" in libnbd(3).
also: the following parameters must not be NULL: h. like, don't do that. for more info see "Non-NULL parameters" in libnbd(3). it's giving "obviously" but the manpage said it so i'm saying it too. π
β VERSION β
this function first appeared in libnbd 1.0. iconic behavior honestly, she's an OG. π
if you need to test whether this function is available at compile time, check if the following macro is defined:
#define LIBNBD_HAVE_NBD_KILL_SUBPROCESS 1
π¦ SEE ALSO π¦
(the whole friend group tbh π)
π 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
the legal bits are non-negotiable, bestie β read 'em, don't skim 'em π«Ά
π
and that's the page!! this whole thing is from libnbd-1.25.8, dated 2026-10-13 β so like, timestamped and everything. mwah. πβ¨
π¦ 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