int
_lwp_ctl(
int features
, struct lwpctl **address
)
)
prepares per-LWP communication area for the calling LWP,
and maps it into the calling process' address space.
It takes the following arguments.
features
LWPCTL_FEATURE_CURCPU
LWPCTL_FEATURE_PCTR
address
The per-LWP communication area is described by an lwpctl structure.
It has following members, depending on
features
.
LWPCTL_CPU_NONE
when the LWP is not running on any CPU.
It's updated by the kernel and should be considered as read-only for
userland.
It's available only if requested with the
LWPCTL_FEATURE_CURCPU
flag.
LWPCTL_FEATURE_PCTR
flag.
)
returns 0 on success.
Otherwise, -1 is returned and
errno
is set to indicate the error.