OpenVAS Scanner 21.4.1
Typedefs | Functions
processes.h File Reference

processes.c header. More...

#include <sys/types.h>

Go to the source code of this file.

Typedefs

typedef void(* process_func_t) (void *)
 

Functions

pid_t create_process (process_func_t, void *)
 Create a new process (fork). More...
 
int terminate_process (pid_t)
 Send SIGTERM to the pid process. Try to wait the the process. In case of the process has still not change the state, it sends SIGKILL to the process and must be waited later to avoid leaving a zombie process. More...
 

Detailed Description

processes.c header.

Typedef Documentation

◆ process_func_t

typedef void(* process_func_t) (void *)

Function Documentation

◆ create_process()

pid_t create_process ( process_func_t  function,
void *  argument 
)

Create a new process (fork).

◆ terminate_process()

int terminate_process ( pid_t  pid)

Send SIGTERM to the pid process. Try to wait the the process. In case of the process has still not change the state, it sends SIGKILL to the process and must be waited later to avoid leaving a zombie process.

Parameters
[in]pidProcess id to terminate.
Returns
0 on success, -1 if the process was waited but not changed the state