我要评分
获取效率
正确性
完整性
易理解

HTL_thread_getaffinity_np

Obtains thread affinity.

Interface Definition

int HTL_thread_getaffinity_np(HTL_thread_t *thread, size_t cpu_set_size, cpu_set_t *cpuset);

Description

HTL_thread_setaffinity_np() is used to obtain the CPU affinity of a thread. The thread affinity information is returned through cpuset. The size of the CPU set is determined by cpu_set_size.

Parameters

Parameter

Type

Description

Input/Output

thread

HTL_thread_t *

Address of the handle to the thread.

Input

cpu_set_size

size_t

Size of the CPU set.

Input

cpuset

cpu_set_t *

CPU set.

Output

Return Value

  • HTL_THREAD_SUCCESS: success.
  • Other values: failure. For details, see the error code descriptions.

Example

    int ret = HTL_thread_getaffinity_np(thread, sizeof(cpu_set_t), &cpu_set);