introspection_get_thread_status()

Get a thread's status

Synopsis:

#include <sys/introspection.h>

int introspection_get_thread_status( pid64_t pid64,
                                     unsigned tid,
                                     debug_thread_t *status );

Arguments:

pid64
The PID (pid_t) or unique PID (pid64_t) of the target thread's process.
tid
The thread ID of the target thread.
status
The location to store the data.

Library:

libintrospection

Use the -l introspection option to qcc to link against this library.

Description:

The introspection_get_thread_status() function gets a thread's status and stores it in the provided buffer.

If there is no thread with the specified TID (tid), the function returns the status of the thread with the next higher TID. If there is no such thread, the function returns ESRCH.

The status comprises of:
  • The 32-bit PID of the process
  • The TID of the thread
  • Base address and size of the stack
  • The current instruction pointer of the user persona of the thread
  • If the thread is the one that received a core-dump signal
  • Details about the fault (signal number and code)
  • Debugger event kind and details
  • Address of the thread local storage
  • Priority, real priority
  • Scheduling policy
  • Thread status
  • System call number the thread is performing
  • The last CPU the thread ran on
  • Blocked signals
  • Pending signals
  • Timeout flags
  • On what object the thread is blocked
  • Thread start time in nanoseconds
  • Thread system and user running time in nanoseconds
  • How long the thread has been blocked
Note:
Your process must have the PROCMGR_AID_XPROCESS_QUERY ability enabled to request information about another process.

Returns:

EOK on success. If an error occurs, the function returns a value from the Errors section.

Errors:

EFAULT
Error accessing the output buffer.
EPERM
The calling process doesn't have the required ability.
ESRCH
The PID is invalid or there's no thread with a TID greater than or equal to the specified TID (tid).

Classification:

QNX OS

Safety:
Cancellation point Yes
Signal handler Yes
Thread Yes
Page updated: