Skip to content

Commit

Permalink
regressions/common: ignore aff_iterate_core error if unsupported by Mac.
Browse files Browse the repository at this point in the history
  • Loading branch information
sbahra committed Sep 12, 2024
1 parent d42e319 commit 7532cfb
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion regressions/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -340,13 +340,19 @@ CK_CC_UNUSED static int
aff_iterate_core(struct affinity *acb, unsigned int *core)
{
thread_affinity_policy_data_t policy;
int err;

*core = ck_pr_faa_uint(&acb->request, acb->delta) % CORES;
policy.affinity_tag = *core;
return thread_policy_set(mach_thread_self(),
err = thread_policy_set(mach_thread_self(),
THREAD_AFFINITY_POLICY,
(thread_policy_t)&policy,
THREAD_AFFINITY_POLICY_COUNT);
if (err == KERN_NOT_SUPPORTED)
return 0;
if (err != 0)
errno = EINVAL;
return err;
}
#elif defined(__FreeBSD__)
CK_CC_UNUSED static int
Expand Down

0 comments on commit 7532cfb

Please sign in to comment.