OpenVAS Scanner  7.0.0~git
sighand.h File Reference

headerfile for sighand.c. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void sighand_chld ()
 
void sighand_segv ()
 
void let_em_die (int pid)
 
void make_em_die (int sig)
 

Variables

void(*)(int) openvas_signal (int signum, void(*handler)(int))
 

Detailed Description

headerfile for sighand.c.

Definition in file sighand.h.

Function Documentation

◆ let_em_die()

void let_em_die ( int  pid)

Definition at line 40 of file sighand.c.

41 {
42  int status;
43 
44  waitpid (pid, &status, WNOHANG);
45 }

References pid.

Referenced by make_em_die().

Here is the caller graph for this function:

◆ make_em_die()

void make_em_die ( int  sig)

Definition at line 48 of file sighand.c.

49 {
50  /* number of times, the sig is sent at most */
51  int n = 3;
52 
53  /* leave if we are session leader */
54  if (getpgrp () != getpid ())
55  return;
56 
57  /* quickly send signals and check the result */
58  if (kill (0, sig) < 0)
59  return;
60  let_em_die (0);
61  if (kill (0, 0) < 0)
62  return;
63 
64  do
65  {
66  /* send the signal to everybody in the group */
67  if (kill (0, sig) < 0)
68  return;
69  sleep (1);
70  /* do not leave a zombie, hanging around if possible */
71  let_em_die (0);
72  }
73  while (--n > 0);
74 
75  if (kill (0, 0) < 0)
76  return;
77 
78  kill (0, SIGKILL);
79  sleep (1);
80  let_em_die (0);
81 }

References let_em_die().

Referenced by init_child_signal_handlers(), and sighand_segv().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sighand_chld()

void sighand_chld ( )

◆ sighand_segv()

void sighand_segv ( )

Variable Documentation

◆ openvas_signal

void(*)(int) openvas_signal(int signum, void(*handler)(int))

Definition at line 29 of file sighand.h.

pid
static pid_t pid
Definition: nasl_builtin_nmap.c:499
let_em_die
void let_em_die(int pid)
Definition: sighand.c:40