Solaris-Lgrp
view release on metacpan or search on metacpan
int
lgrp_latency_cookie(lgrp_cookie_t cookie, lgrp_id_t from, lgrp_id_t to, int between = 0)
CODE:
RETVAL = _lgrp_latency_cookie(cookie, from, to, between);
POSTCALL:
RETURN_UNDEF_IF_FAIL;
OUTPUT:
RETVAL
#
# Functions below convert C arrays into Perl lists. They use XS PPCODE
# directive to avoid implicit RETVAL assignments and manipulate perl
# stack directly.
#
# When called in scalar context functions return the number of elements
# in the list or undef on failure.
#
# The PUSHARRAY() macro defined above pushes all values from the C array to
# the perl stack.
#
#
# @children = lgrp_children($cookie, $parent).
#
void
lgrp_children(cookie, lgrp)
lgrp_cookie_t cookie;
lgrp_id_t lgrp;
PREINIT:
lgrp_id_t *lgrps;
int count;
PPCODE:
errno = 0;
if ((count = lgrp_children(cookie, lgrp, NULL, 0)) < 0)
LGRP_BADVAL();
if (GIMME_V == G_SCALAR)
XSRETURN_IV(count);
if (count > 0) {
if (New(0, lgrps, count, lgrp_id_t) == NULL) {
errno = ENOMEM;
#
# @parents = lgrp_parents($cookie, $lgrp).
#
void
lgrp_parents(cookie, lgrp)
lgrp_cookie_t cookie;
lgrp_id_t lgrp;
PREINIT:
lgrp_id_t *lgrps;
int count;
PPCODE:
errno = 0;
if ((count = lgrp_parents(cookie, lgrp, NULL, 0)) < 0)
LGRP_BADVAL();
if (GIMME_V == G_SCALAR)
XSRETURN_IV(count);
if (count > 0) {
if (New(0, lgrps, count, lgrp_id_t) == NULL) {
errno = ENOMEM;
# Content should be LGRP_CONTENT_HIERARCHY or LGRP_CONTENT_ALL or
# LGRP_CONTENT_DIRECT
void
lgrp_cpus(cookie, lgrp, content)
lgrp_cookie_t cookie;
lgrp_id_t lgrp;
lgrp_content_t content;
PREINIT:
int ncpus;
processorid_t *cpus;
PPCODE:
errno = 0;
if ((ncpus = lgrp_cpus(cookie, lgrp, NULL, 0, content)) < 0)
LGRP_BADVAL();
if (GIMME_V == G_SCALAR)
XSRETURN_IV(ncpus);
if (ncpus > 0) {
if (New(0, cpus, ncpus, processorid_t) == NULL) {
errno = ENOMEM;
PUSHARRAY(cpus, ncpus);
Safefree(cpus);
}
}
void
lgrp_resources(cookie, lgrp, type)
lgrp_cookie_t cookie;
lgrp_id_t lgrp;
int type;
PPCODE:
LGRP_RESOURCES(cookie, lgrp, type);
( run in 0.630 second using v1.01-cache-2.11-cpan-5511b514fd6 )