nbd_get_subprocess_pid3
Get the process id of the subprocess
Usage
#include <libnbd.h>int64_t nbd_get_subprocess_pid (struct nbd_handle *h);
Overview
For connections which create a subprocess such as nbd_connect_command(3), this returns the process ID (PID) of the subprocess. This is only supported on some platforms.
This is mainly useful in debugging cases. For example, this could be used to learn where to attach gdb(1) to diagnose a crash in the NBD server subprocess.
Return value
This call returns a 64 bit signed integer ≥ 0.
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).
Version
This function first appeared in libnbd 1.22.
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_SUBPROCESS_PID 1
Releases
2 releases since Debian 13 (Trixie); the text changed 1 time.