56 #if !defined(__AMXP_SUBPROC_H__)
57 #define __AMXP_SUBPROC_H__
64 #include <sys/types.h>
65 #include <amxc/amxc_llist.h>
Ambiorix signal manager and signal API header file.
amxp_subproc_t * amxp_subproc_find(const int pid)
Retrieve a amxp_subproc_t for a child process using it's process identifier.
int amxp_subproc_open_fd(amxp_subproc_t *subproc, int requested)
Opens standard file descriptor to the child process.
bool amxp_subproc_is_running(const amxp_subproc_t *const subproc)
Checks if the child process is running.
int amxp_subproc_new(amxp_subproc_t **subproc)
Constructor function, creates a new child process data structure.
int amxp_subproc_get_exitstatus(amxp_subproc_t *subproc)
Gets the exit code of the child process.
int amxp_subproc_start(amxp_subproc_t *const subproc, char *cmd,...)
Start a child process.
int amxp_subproc_kill(const amxp_subproc_t *const subproc, const int sig)
Sends a Linux signal to the child process.
int amxp_subproc_ifexited(amxp_subproc_t *subproc)
Checks if the child process terminated normally.
int amxp_subproc_start_wait(amxp_subproc_t *subproc, int timeout_msec, char *cmd,...)
Starts a child process and waits until it exits.
int amxp_subproc_wait(amxp_subproc_t *subproc, int timeout_msec)
Waits until the child process has stopped.
int amxp_subproc_vstart(amxp_subproc_t *const subproc, char **argv)
Start a child process.
int amxp_subproc_vstart_wait(amxp_subproc_t *subproc, int timeout_msec, char **cmd)
Starts a child process and waits until it exits.
int amxp_subproc_astart(amxp_subproc_t *const subproc, amxc_array_t *cmd)
Start a child process.
int amxp_subproc_ifsignaled(amxp_subproc_t *subproc)
Checks if the child process was stopped because of an uncaught Linux signal.
struct _subproc_t amxp_subproc_t
Child process information structure.
amxp_signal_mngr_t * amxp_subproc_get_sigmngr(const amxp_subproc_t *const subproc)
Get the Signal managers of the child process.
int amxp_subproc_get_termsig(amxp_subproc_t *subproc)
Gets the Linux signal id that caused the child process to stop.
int amxp_subproc_delete(amxp_subproc_t **subproc)
Destructor function, deletes a child process data structure.
pid_t amxp_subproc_get_pid(const amxp_subproc_t *const subproc)
Get the PID of a child process.
Structure containing the signal manager information.
Child process information structure.
amxp_signal_mngr_t * sigmngr