Name

SYSCALL_DEFINE3 — send signal to one specific thread

Synopsis

SYSCALL_DEFINE3 (  tgkill,
   int,
   tgid,
   int,
   pid,
   int,
   sig);

Arguments

tgkill

-- undescribed --

int

-- undescribed --

tgid

the thread group ID of the thread

int

-- undescribed --

pid

the PID of the thread

int

-- undescribed --

sig

signal to be sent

Description

This syscall also checks the tgid and returns -ESRCH even if the PID exists but it's not belonging to the target process anymore. This method solves the problem of threads exiting and PIDs getting reused.