Using lgrp_affinity_get
()
The lgrp_affinity_get
()
function returns the affinity that a LWP has for a
given lgroup.
#include <sys/lgrp_user.h> lgrp_affinity_t lgrp_affinity_get(idtype_t idtype, id_t id, lgrp_id_t lgrp);
The idtype
and id
arguments specify the LWP that
the lgrp_affinity_get
()
function examines. If the value of
idtype
is P_PID
, the
lgrp_affinity_get
()
function gets the lgroup affinity for
one of the LWPs in the process whose process ID matches the value of the
id
argument. If the value of
idtype
is P_LWPID
, the
lgrp_affinity_get
()
function gets the lgroup affinity for
the LWP of the current process whose LWP ID matches the value of the
id
argument. If the value of
idtype
is P_MYID
, the
lgrp_affinity_get
()
function gets the lgroup affinity for
the current LWP.
The lgrp_affinity_get
()
function returns EINVAL
when
the given lgroup or ID type is not valid. The
lgrp_affinity_get
()
function returns
EPERM
when the effective user of the calling process
is not the superuser and the ID of the calling process does not match the real
or effective user ID of one of the LWPs. The
lgrp_affinity_get
()
function returns
ESRCH
when a given lgroup or LWP is not found. For
more information, see the
lgrp_affinity_get
(3LGRP) man page.