High Performance OPC UA Server SDK  1.1.0.158
process

Functionality for starting and stopping processes. More...

Functions

bool ua_process_support_forking (void)
 Return true if the other functions for starting and stopping processes are implemented, false otherwise.
 
void ua_process_install_sigchild_handler (void)
 Install handler for child related signals. More...
 
ua_pid_t ua_process_start (const char *filename, int argc, const char *argv[])
 Forks a new child process and executes the given executable file. More...
 
int ua_process_terminate (ua_pid_t pid)
 Terminates a process. More...
 
int ua_process_kill (ua_pid_t pid)
 Kills a process that ignores the terminate call. More...
 
ua_pid_t ua_process_own_pid (void)
 Returns the current process id.
 

Detailed Description

Functionality for starting and stopping processes.

ua_pid_t pid;
// install signal handler
// start a new process
pid = ua_process_start("my_process");
if (pid != UA_PROCESS_PID_INVALID) {
// stop the new process
}
}

Plaforms which don't support multiple process or forking should return false ua_process_support_forking and simply return 0 in all other functions to make these operations a NOP.

Function Documentation

void ua_process_install_sigchild_handler ( void  )

Install handler for child related signals.

Must be be done before starting a new process with ua_process_start.

int ua_process_kill ( ua_pid_t  pid)

Kills a process that ignores the terminate call.

This way the process gets killed by the OS.

Parameters
pidProcess id of the process to kill.
Returns
Zero on success or errorcode on failure.
ua_pid_t ua_process_start ( const char *  filename,
int  argc,
const char *  argv[] 
)

Forks a new child process and executes the given executable file.

Returns
The process id or UA_PROCESS_PID_INVALID in case of an error.
int ua_process_terminate ( ua_pid_t  pid)

Terminates a process.

This way the process can gracefully shut down.

Parameters
pidProcess id of the process to terminate.
Returns
Zero on success or errorcode on failure.