aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2016-10-10 14:52:47 +0000
committerChristian Grothoff <christian@grothoff.org>2016-10-10 14:52:47 +0000
commit2378353eab064ed06166e025a1df9d4a23efe6c4 (patch)
treef2418dbd6d50c4fe93da623e8b572fd725058450 /src/include
parent474111bf7923be9458ee84c6dcc577261aa65fea (diff)
downloadgnunet-2378353eab064ed06166e025a1df9d4a23efe6c4.tar.gz
gnunet-2378353eab064ed06166e025a1df9d4a23efe6c4.zip
extending process API to allow obtaining status code in blocking fashion
Diffstat (limited to 'src/include')
-rw-r--r--src/include/gnunet_os_lib.h25
-rw-r--r--src/include/gnunet_testbed_service.h1
2 files changed, 23 insertions, 3 deletions
diff --git a/src/include/gnunet_os_lib.h b/src/include/gnunet_os_lib.h
index 39c70c8bd..ce3e05f13 100644
--- a/src/include/gnunet_os_lib.h
+++ b/src/include/gnunet_os_lib.h
@@ -524,7 +524,8 @@ struct GNUNET_OS_CommandHandle;
524 * @param cls closure 524 * @param cls closure
525 * @param line line of output from a command, NULL for the end 525 * @param line line of output from a command, NULL for the end
526 */ 526 */
527typedef void (*GNUNET_OS_LineProcessor) (void *cls, const char *line); 527typedef void
528(*GNUNET_OS_LineProcessor) (void *cls, const char *line);
528 529
529 530
530/** 531/**
@@ -548,8 +549,10 @@ GNUNET_OS_command_stop (struct GNUNET_OS_CommandHandle *cmd);
548 * @return NULL on error 549 * @return NULL on error
549 */ 550 */
550struct GNUNET_OS_CommandHandle * 551struct GNUNET_OS_CommandHandle *
551GNUNET_OS_command_run (GNUNET_OS_LineProcessor proc, void *proc_cls, 552GNUNET_OS_command_run (GNUNET_OS_LineProcessor proc,
552 struct GNUNET_TIME_Relative timeout, const char *binary, 553 void *proc_cls,
554 struct GNUNET_TIME_Relative timeout,
555 const char *binary,
553 ...); 556 ...);
554 557
555 558
@@ -582,6 +585,22 @@ int
582GNUNET_OS_process_wait (struct GNUNET_OS_Process *proc); 585GNUNET_OS_process_wait (struct GNUNET_OS_Process *proc);
583 586
584 587
588
589/**
590 * Retrieve the status of a process, waiting on him if dead.
591 * Blocking version.
592 *
593 * @param proc pointer to process structure
594 * @param type status type
595 * @param code return code/signal number
596 * @return #GNUNET_OK on success, #GNUNET_NO if the process is still running, #GNUNET_SYSERR otherwise
597 */
598int
599GNUNET_OS_process_wait_status (struct GNUNET_OS_Process *proc,
600 enum GNUNET_OS_ProcessStatusType *type,
601 unsigned long *code);
602
603
585/** 604/**
586 * Connects this process to its parent via pipe; 605 * Connects this process to its parent via pipe;
587 * essentially, the parent control handler will read signal numbers 606 * essentially, the parent control handler will read signal numbers
diff --git a/src/include/gnunet_testbed_service.h b/src/include/gnunet_testbed_service.h
index 7d9abbe49..f8a8ef38d 100644
--- a/src/include/gnunet_testbed_service.h
+++ b/src/include/gnunet_testbed_service.h
@@ -1493,6 +1493,7 @@ GNUNET_TESTBED_test_run (const char *testname,
1493struct GNUNET_TESTBED_Controller * 1493struct GNUNET_TESTBED_Controller *
1494GNUNET_TESTBED_run_get_controller_handle (struct GNUNET_TESTBED_RunHandle *h); 1494GNUNET_TESTBED_run_get_controller_handle (struct GNUNET_TESTBED_RunHandle *h);
1495 1495
1496
1496/** 1497/**
1497 * Opaque handle for barrier 1498 * Opaque handle for barrier
1498 */ 1499 */