THREAD_INFO(3T) BSD THREAD_INFO(3T)
NAME
thread_info - obtain information about the specified thread.
SYNOPSIS
include <apollo/thread.h>
kern_return_t thread_info(target_thread, flavor, thread_info,
thread_info_size)
thread_t target_thread;
unsigned int flavor;
thread_info_t *thread_info;
unsigned int *thread_info_size;
DESCRIPTION
thread_info obtains information about the specified thread.
The arguments are as follows:
target_thread
The thread to get the info from.
flavor The type of info to be returned. The current legal value for
this is
THREAD_BASIC_INFO - The basic information about a thread.
thread_info
Points to an info structure to be filled in.
thread_info_size
The size of the info structure passed in.
The contents of the structure pointed to by *thread_info
include the following contents:
typedef struct {
uid_$t stk_uid;
linteger stack_base;
linteger stack_size;
thread_state_set_t state;
pinteger usr;
linteger upc;
linteger usp;
time_$clock_t cpu_total;
short priority;
linteger pad[10];
} thread_info_t;
Data Structures
The data structures are defined as follows:
thread_t The basic thread id. This is a black box value that is not
significant outside the thread system. It is guaranteed that
no two active threads on a node will have the same thread id.
kern_return_t
An enumeration of the possible values a system call can return.
It indicates the success or failure of the call. It will
either be [KERN_SUCCESS] to indicate that the call succeeded,
or some other value to describe the reason for the failure.
DIAGNOSTICS
Upon successful completion, thread_info fills the information structure
with information about the thread and returns [KERN_SUCCESS]; otherwise,
errno is set to indicate the error.
ERRORS
This function fails if:
[KERN_INVALID_ARGUMENT]
The specified thread can not be found or the flavor is not a
recognized info type or the size of the structure is wrong for
this flavor.
[KERN_PROTECTION_FAILURE]
The process this thread is in does not have sufficient rights
to get information about the target thread.
SEE ALSO
thread_create(3T), thread_terminate(3T), thread_suspend(3T),
thread_resume(3T), thread_abort(3T), thread_self(3T), thread_state(3T),
thread_set_priority(3T), thread_handle_signals(3T), thread_inhibit(3T),
thread_cleanup(3T), thread_startup(3T), threadp_init(3T),
threadp_set(3T), threadp_get(3T).
Section (3P) pthread calls (IEEE P1003.4a) calls
Domain System Software Release Notes, Software Release 10.4
NOTES
This call is part of the low level Domain/OS Pthread interface. Most of
these calls come directly from the Mach thread interface. Except as
noted, they work exactly like the equivalent Mach call; they work between
processes (the thread id is unique for a node) if the calling process has
the appropriate rights relative to the target process.
This call is provided solely for compatibility with the Mach operating
system. New applications should use the Pthread interface instead.