Remote Administration Daemon Developer Guide

Exit Print View

Updated: July 2014
 
 

Subprocesses

Function
Description
exec_params_t *rad_exec_params_alloc
Allocate a control structure for executing a subprocess.
void rad_exec_params_free(exec_params_t *params);
Free a subprocess control structure, params.
void rad_exec_params_set_cwd(exec_params_t *params,
const char *cwd);
Set the current working directory, cwd, in a subprocess control structure, params.
void rad_exec_params_set_env(exec_params_t *params,
const char **envp);
Set the environment, envp, in a subprocess control structure, params.
void rad_exec_params_set_loglevel(
exec_params_t *params, rad_logtype_t loglevel);
Set the rad log level, loglevel, in a subprocess control structure, params.
int rad_exec_params_set_stdin(exec_params_t *params,
int fd);
Set the stdin file descriptor, fd, in a subprocess control structure, params.
int rad_exec_params_set_stdout(exec_params_t *params,
int fd);
Set the stdout file descriptor, fd, in a subprocess control structure, params.
int rad_exec_params_set_stderr(exec_params_t *params,
int fd);
Set the stderr file descriptor, fd, in a subprocess control structure, params.
int rad_forkexec(exec_params_t *params,
 	const char **argv, exec_result_t *result);
Use the supplied subprocess control structure, params, to fork and execute (execv) the supplied args, argv. If result is not NULL, it is updated with the subprocess pid and file descriptor details.
int rad_forkexec_wait(exec_params_t *params,
 	const char **argv, int *status);
Use the supplied subprocess control structure, params, to fork and execute (execv) the supplied args, argv. If status is not NULL, it is updated with the exit status of the subprocess. This function will wait for the subprocess to terminate before returning.
int rad_wait(exec_params_t *params,
 	exec_result_t *result, int *status);
Use the supplied subprocess control structure, params, to wait for a previous invocation of rad_forkexe to complete. If result is not NULL, it is updated with the subprocess pid and file descriptor details. If status is not NULL, it is updated with the exit status of the subprocess. This function will wait for the subprocess to terminate before returning.