From 4dcecfd72005cc8f990dea5fca456da54a6eaa98 Mon Sep 17 00:00:00 2001 From: Nils Durner Date: Thu, 11 Jun 2009 13:39:32 +0000 Subject: poll PIDs for status information --- src/include/gnunet_os_lib.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'src/include') diff --git a/src/include/gnunet_os_lib.h b/src/include/gnunet_os_lib.h index dfab4a747..8e48a049c 100644 --- a/src/include/gnunet_os_lib.h +++ b/src/include/gnunet_os_lib.h @@ -59,6 +59,19 @@ enum GNUNET_OS_InstallationPathKind }; +/** + * Process status types + */ +enum GNUNET_OS_ProcessStatusType +{ + GNUNET_OS_PROCESS_UNKNOWN, + GNUNET_OS_PROCESS_RUNNING, + GNUNET_OS_PROCESS_STOPPED, + GNUNET_OS_PROCESS_EXITED, + GNUNET_OS_PROCESS_SIGNALED +}; + + /** * Get the path to a specific GNUnet installation directory or, with * GNUNET_OS_IPK_SELF_PREFIX, the current running apps installation @@ -145,6 +158,23 @@ pid_t GNUNET_OS_start_process (const char *filename, ...); */ pid_t GNUNET_OS_start_process_v (const char *filename, char *const argv[]); +/** + * Retrieve the status of a process + * @param proc process ID + * @param type status type + * @param code return code/signal number + * @return GNUNET_OK on success, GNUNET_SYSERR otherwise + */ +int GNUNET_OS_process_status (pid_t proc, enum GNUNET_OS_ProcessStatusType *type, + unsigned long *code); + +/** + * Wait for a process + * @param proc process ID to wait for + * @return GNUNET_OK on success, GNUNET_SYSERR otherwise + */ +int GNUNET_OS_process_wait (pid_t proc); + #if 0 /* keep Emacsens' auto-indent happy */ { #endif -- cgit v1.2.3