Handling of child processes in GNUnet. More...
Go to the source code of this file.
Data Structures | |
struct | GNUNET_ChildWaitHandle |
Struct which defines a Child Wait handle. More... | |
Macros | |
#define | LOG(kind, ...) GNUNET_log (kind, __VA_ARGS__) |
Generic logging shortcut. More... | |
Functions | |
static void | maint_child_death (void *cls) |
Task triggered whenever we receive a SIGCHLD (child process died) or when user presses CTRL-C. More... | |
static void | sighandler_child_death (void) |
Signal handler called for SIGCHLD. More... | |
static void | child_management_start (void) |
Initializing the signal pipe for child handling. More... | |
static void | child_management_done (void) |
Clean up. More... | |
struct GNUNET_ChildWaitHandle * | GNUNET_wait_child (struct GNUNET_OS_Process *proc, GNUNET_ChildCompletedCallback cb, void *cb_cls) |
Starts the handling of the child processes. More... | |
void | GNUNET_wait_child_cancel (struct GNUNET_ChildWaitHandle *cwh) |
Stop waiting on this child. More... | |
Variables | |
static struct GNUNET_DISK_PipeHandle * | sigpipe |
Pipe used to communicate shutdown via signal. More... | |
static struct GNUNET_SIGNAL_Context * | shc_chld |
static struct GNUNET_SCHEDULER_Task * | sig_task |
static struct GNUNET_ChildWaitHandle * | cwh_head |
static struct GNUNET_ChildWaitHandle * | cwh_tail |
Handling of child processes in GNUnet.
Definition in file child_management.c.
#define LOG | ( | kind, | |
... | |||
) | GNUNET_log (kind, __VA_ARGS__) |
Generic logging shortcut.
Definition at line 35 of file child_management.c.
|
static |
Task triggered whenever we receive a SIGCHLD (child process died) or when user presses CTRL-C.
cls | closure, NULL |
Definition at line 86 of file child_management.c.
References cwh_head, cwh_tail, exit_code, GNUNET_assert, GNUNET_CONTAINER_DLL_remove, GNUNET_DISK_file_read(), GNUNET_DISK_handle_invalid(), GNUNET_DISK_PIPE_END_READ, GNUNET_DISK_pipe_handle(), GNUNET_free, GNUNET_OK, GNUNET_OS_process_status(), GNUNET_SCHEDULER_add_read_file(), GNUNET_TIME_UNIT_FOREVER_REL, maint_child_death(), GNUNET_ChildWaitHandle::next, sig_task, sigpipe, and type.
Referenced by GNUNET_wait_child(), and maint_child_death().
|
static |
Signal handler called for SIGCHLD.
Triggers the respective handler by writing to the trigger pipe.
Definition at line 142 of file child_management.c.
References GNUNET_break, GNUNET_DISK_file_write(), GNUNET_DISK_PIPE_END_WRITE, GNUNET_DISK_pipe_handle(), and sigpipe.
Referenced by child_management_start(), and GNUNET_wait_child().
|
static |
Initializing the signal pipe for child handling.
Definition at line 161 of file child_management.c.
References GNUNET_assert, GNUNET_DISK_PF_NONE, GNUNET_DISK_pipe(), GNUNET_ERROR_TYPE_INFO, GNUNET_log, GNUNET_SIGCHLD, GNUNET_SIGNAL_handler_install(), shc_chld, sighandler_child_death(), and sigpipe.
Referenced by GNUNET_wait_child().
|
static |
Clean up.
Definition at line 181 of file child_management.c.
References GNUNET_DISK_pipe_close(), GNUNET_ERROR_TYPE_INFO, GNUNET_log, GNUNET_SCHEDULER_cancel(), GNUNET_SIGNAL_handler_uninstall(), shc_chld, sig_task, and sigpipe.
Referenced by GNUNET_wait_child_cancel().
|
static |
Pipe used to communicate shutdown via signal.
Definition at line 69 of file child_management.c.
Referenced by child_management_done(), child_management_start(), GNUNET_wait_child(), maint_child_death(), and sighandler_child_death().
|
static |
Definition at line 71 of file child_management.c.
Referenced by child_management_done(), child_management_start(), and main().
|
static |
Definition at line 73 of file child_management.c.
Referenced by child_management_done(), GNUNET_wait_child(), and maint_child_death().
|
static |
Definition at line 75 of file child_management.c.
Referenced by GNUNET_wait_child(), GNUNET_wait_child_cancel(), and maint_child_death().
|
static |
Definition at line 77 of file child_management.c.
Referenced by GNUNET_wait_child(), GNUNET_wait_child_cancel(), and maint_child_death().