OpenVAS Scanner 21.4.1
Macros | Functions
processes.c File Reference

Creates new threads. More...

#include "processes.h"
#include "sighand.h"
#include <errno.h>
#include <glib.h>
#include <gvm/base/logging.h>
#include <setjmp.h>
#include <signal.h>
#include <stdlib.h>
#include <string.h>
#include <sys/wait.h>
#include <time.h>
#include <unistd.h>

Macros

#define G_LOG_DOMAIN   "sd main"
 GLib log domain. More...
 

Functions

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. More...
 
static void init_child_signal_handlers (void)
 
pid_t create_process (process_func_t function, void *argument)
 Create a new process (fork). More...
 

Detailed Description

Creates new threads.

Macro Definition Documentation

◆ G_LOG_DOMAIN

#define G_LOG_DOMAIN   "sd main"

GLib log domain.

Function Documentation

◆ create_process()

pid_t create_process ( process_func_t  function,
void *  argument 
)

Create a new process (fork).

◆ init_child_signal_handlers()

static void init_child_signal_handlers ( void  )
static

◆ 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