Skip to content

gettid

Intro

gettid - return the caller's thread ID (TID)

Description

gettid() returns the caller's thread ID. On success, the thread ID of the calling thread is returned. On error, (pid_t)-1 is returned, and errno is set to indicate the cause of the error.

A thread ID is only guaranteed to be unique within a process. There are no two threads in the same process whose thread IDs are the same.

Arguments

  • None:N/A[K] - gettid does not require any arguments

Available Tags

K - Originated from kernel-space.

Hooks

gettid

Type

Kprobe

Purpose

To get information about the thread ID of the calling thread.

Example Use Case

This event can be used in a multi-threaded program to get information about the threads running in the program.

Issues

None

getpid - return the caller's process ID

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.