Command Handler: Process/thread support

Overview

A set of functions exported by a Test Agent to support interface of Command Handler for Test Agent thread and process manipulations. More…

// global functions

int rcf_ch_start_process(pid_t* pid, int priority, const char* rtn, bool do_exec, int argc, void** params);
int rcf_ch_start_thread(int* tid, int priority, const char* rtn, bool is_argv, int argc, void** params);
int rcf_ch_kill_process(unsigned int pid);
int rcf_ch_free_proc_data(unsigned int pid);
int rcf_ch_kill_thread(unsigned int tid);

Detailed Documentation

A set of functions exported by a Test Agent to support interface of Command Handler for Test Agent thread and process manipulations.

Global Functions

int rcf_ch_start_process(pid_t* pid, int priority, const char* rtn, bool do_exec, int argc, void** params)

Start process on the Test Agent or NUT served by it.

Parameters:

pid

location of pid of the new task

priority

priority of the new process or -1 if the priority is not specified in the command

rtn

routine entry point name. It is expected that a function has the following argument list (int argc, char **argv)

do_exec

whether to do execve after fork() in a newly created process or just to call rtn function in a new process

argc

number of arguments

params

pointer to array of RCF_MAX_PARAMS length with routine arguments

Returns:

Status code

int rcf_ch_start_thread(int* tid, int priority, const char* rtn, bool is_argv, int argc, void** params)

Start thread on the Test Agent or NUT served by it.

Parameters:

tid

location of tid of the new task

priority

priority of the new process or -1 if the priority is not specified in the command

rtn

routine entry point name

is_argv

if true, then routine prototype is (int argc, char **argv)

argc

number of arguments

params

pointer to array of RCF_MAX_PARAMS length with routine arguments

Returns:

Status code

int rcf_ch_kill_process(unsigned int pid)

Kill the process on the Test Agent or NUT served by it.

Parameters:

pid

process identifier

Returns:

Status code

int rcf_ch_free_proc_data(unsigned int pid)

Free process data stored on the Test Agent.

Parameters:

pid

process identifier

Returns:

Status code

int rcf_ch_kill_thread(unsigned int tid)

Kill the thread on the Test Agent or NUT served by it.

Parameters:

tid

thread identifier

Returns:

Status code