#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <limits.h>
#include <sys/inotify.h>
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
#include <amxc/amxc.h>
#include <amxc/amxc_macros.h>
#include <amxp/amxp.h>
Go to the source code of this file.
◆ _GNU_SOURCE
◆ PROC_CHILDREN
#define PROC_CHILDREN "/proc/%d/task/%d/children" |
◆ amxp_proc_ctrl_free_char()
static void amxp_proc_ctrl_free_char |
( |
amxc_array_it_t * |
it | ) |
|
|
static |
Definition at line 74 of file amxp_proc_ctrl.c.
75 char* txt = (
char*) amxc_array_it_get_data(it);
◆ amxp_proc_ctrl_get_child_pids_proc_children()
static int amxp_proc_ctrl_get_child_pids_proc_children |
( |
amxp_proc_ctrl_t * |
proc | ) |
|
|
static |
Definition at line 110 of file amxp_proc_ctrl.c.
119 amxc_string_init(&file, 0);
125 fp = fopen(amxc_string_get(&file, 0),
"r");
130 read = getline(&line, &len, fp);
145 amxc_string_clean(&file);
pid_t amxp_subproc_get_pid(const amxp_subproc_t *const subproc)
Get the PID of a child process.
amxc_var_t child_proc_pids
◆ amxp_proc_ctrl_get_child_pids_scan_proc()
Definition at line 149 of file amxp_proc_ctrl.c.
151 amxc_llist_t children;
153 amxc_llist_init(&children);
157 when_failed(retval, leave);
160 amxc_llist_iterate(it, (&children)) {
void amxp_proci_free_it(amxc_llist_it_t *it)
Delete a amxp_proc_info_t by it is linked list iterator.
int amxp_proci_findf(amxc_llist_t *result, const char *filter,...)
Build a linked list of running processes.
Structure containing the process information.
◆ amxp_proc_ctrl_stopped()
static void amxp_proc_ctrl_stopped |
( |
UNUSED const char *const |
event_name, |
|
|
UNUSED const amxc_var_t *const |
event_data, |
|
|
void *const |
priv |
|
) |
| |
|
static |
Definition at line 91 of file amxp_proc_ctrl.c.
98 when_null(proc, leave);
100 amxc_var_set(uint32_t, &pid, proc->
proc->
pid);
107 amxc_var_clean(&pid);
void amxp_proc_ctrl_stop_childs(amxp_proc_ctrl_t *proc)
Stop all child processes of the child process.
int amxp_sigmngr_emit_signal(const amxp_signal_mngr_t *const sig_mngr, const char *name, const amxc_var_t *const data)
Emits a signal.
int amxp_timer_stop(amxp_timer_t *timer)
Stops the timer.
Structure containing the child process control.
◆ amxp_proc_ctrl_timer_callback()
static void amxp_proc_ctrl_timer_callback |
( |
UNUSED amxp_timer_t *const |
timer, |
|
|
void * |
data |
|
) |
| |
|
static |
Definition at line 79 of file amxp_proc_ctrl.c.
84 amxc_var_set(uint32_t, &pid, proc->
proc->
pid);
int amxp_proc_ctrl_stop(amxp_proc_ctrl_t *proc)
Stops the child process.