diff options
author | Christian Grothoff <christian@grothoff.org> | 2016-10-10 14:52:47 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2016-10-10 14:52:47 +0000 |
commit | 2378353eab064ed06166e025a1df9d4a23efe6c4 (patch) | |
tree | f2418dbd6d50c4fe93da623e8b572fd725058450 /src/include/gnunet_os_lib.h | |
parent | 474111bf7923be9458ee84c6dcc577261aa65fea (diff) | |
download | gnunet-2378353eab064ed06166e025a1df9d4a23efe6c4.tar.gz gnunet-2378353eab064ed06166e025a1df9d4a23efe6c4.zip |
extending process API to allow obtaining status code in blocking fashion
Diffstat (limited to 'src/include/gnunet_os_lib.h')
-rw-r--r-- | src/include/gnunet_os_lib.h | 25 |
1 files changed, 22 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 | */ |
527 | typedef void (*GNUNET_OS_LineProcessor) (void *cls, const char *line); | 527 | typedef 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 | */ |
550 | struct GNUNET_OS_CommandHandle * | 551 | struct GNUNET_OS_CommandHandle * |
551 | GNUNET_OS_command_run (GNUNET_OS_LineProcessor proc, void *proc_cls, | 552 | GNUNET_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 | |||
582 | GNUNET_OS_process_wait (struct GNUNET_OS_Process *proc); | 585 | GNUNET_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 | */ | ||
598 | int | ||
599 | GNUNET_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 |