From 15c6574e88f9cbff8711c67ae675f398dab6a78c Mon Sep 17 00:00:00 2001 From: Nicklas Larsson Date: Fri, 11 Sep 2026 12:59:46 +0200 Subject: [PATCH] lib/gis: add documentation for G_wait() --- lib/gis/spawn.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/lib/gis/spawn.c b/lib/gis/spawn.c index a64e4d6005f..d3b6287051d 100644 --- a/lib/gis/spawn.c +++ b/lib/gis/spawn.c @@ -945,6 +945,21 @@ int G_spawn(const char *command, ...) return status; } +/** + * \brief Wait for a spawned process to finish. + * + * Blocks until the process identified by \p i_pid exits, then returns the + * process exit code. On non-Windows platforms, if the process terminates due + * to a signal, the signal number is returned instead. + * + * \param[in] i_pid Process identifier returned by a spawn function. + * \return Process exit code on normal termination. + * \return Signal number if the process was terminated by a signal on + * non-Windows platforms. + * \return -1 if the process cannot be opened, waited for, or queried. + * \return -0x100 (-256) if the process ended with an unsupported wait + * status on non-Windows platforms. + */ int G_wait(int i_pid) { #ifdef _WIN32