OpenVAS Scanner  22.7.9
processes.h
Go to the documentation of this file.
1 /* SPDX-FileCopyrightText: 2023 Greenbone AG
2  * SPDX-FileCopyrightText: 2006 Software in the Public Interest, Inc.
3  * SPDX-FileCopyrightText: 1998-2006 Tenable Network Security, Inc.
4  *
5  * SPDX-License-Identifier: GPL-2.0-only
6  */
7 
13 #ifndef OPENVAS_PROCESSES_H
14 #define OPENVAS_PROCESSES_H
15 
16 #include "../misc/ipc.h"
17 
18 #include <sys/types.h> /* for pid_t */
19 
20 #define FORKFAILED -1
21 #define NOINIT -2
22 #define PROCSFULL -3
23 #define NOCHILD -4
24 
25 typedef void (*process_func_t) (void *);
26 
27 void
29 
30 int
31 terminate_process (pid_t pid);
32 
33 pid_t
34 create_ipc_process (ipc_process_func func, void *args);
35 const struct ipc_contexts *
37 
38 int
40 
41 #endif
procs_get_ipc_contexts
const struct ipc_contexts * procs_get_ipc_contexts(void)
returns ipc_contexts.
Definition: processes.c:239
create_ipc_process
pid_t create_ipc_process(ipc_process_func func, void *args)
initializes a communication channels and calls a function with a new process
Definition: processes.c:195
pid
static pid_t pid
Definition: nasl_cmd_exec.c:39
process_func_t
void(* process_func_t)(void *)
Definition: processes.h:25
ipc_process_func
void(* ipc_process_func)(struct ipc_context *, void *)
Definition: ipc.h:47
ipc_contexts
Definition: ipc.h:41
procs_cleanup_children
int procs_cleanup_children(void)
iterates through ipcc and verify if a child is stopped or killed to free the file handler.
Definition: processes.c:47
terminate_process
int terminate_process(pid_t pid)
Terminates a given process. If termination does not work, the process will get killed....
Definition: processes.c:96
procs_terminate_childs
void procs_terminate_childs(void)
This function terminates all processes spawned with create_process. Calls terminate_child for each pr...
Definition: processes.c:113