Skip to content

tkill

Intro

tkill - send a signal to a specified process or thread

Description

The tkill() system call sends the signal sig to the thread tid. The thread tid has to be a thread of the calling process. The tkill() system call is a more specific alternative to kill(2).

When the signal is delivered, it is as if signal() had been called with the signal number sig and the argument siginfo_t* set to NULL from within the thread tid. Note that software support for thread-directed signals has been removed from the kernel.

The tkill() system call differs from tkill() in that tkill() behaves as kill() does, in that it does not set errno if the process or process group does not exist. Note that regardless of the signal number sent, no signals shall be generated when sending a signal to a nonexistent process or process group.

Arguments

  • tid:int[K] - The thread ID of the thread to be signaled.
  • sig:int[K] - The signal number passed to the thread.

Available Tags

  • K - Originated from kernel-space.

Hooks

tkill

Type

Kprobes

Purpose

To gather information on system calls called by the thread.

Example Use Case

tkill() is most commonly used to kill threads that are stuck or have gone into an unexpected state.

Issues

The tkill() system call is not always successful in delivering the signal, so it is necessary to use a signal-safe system call such as rt_sigqueueinfo() to ensure that the signal is delivered.

  • signal()
  • kill()
  • tkill()

This document was automatically generated by OpenAI and needs review. It might not be accurate and might contain errors. The authors of Tracee recommend that the user reads the "events.go" source file to understand the events and their arguments better.