BSD-Resource
view release on metacpan or search on metacpan
Resource.xs view on Meta::CPAN
prio = getpriority(which, who);
if (errno == 0)
sv_setiv(ST(0), prio);
else
ST(0) = &PL_sv_undef;
}
void
_getrlimit(resource)
int resource
PPCODE:
struct rlimit rl;
if (getrlimit(resource, &rl) == 0) {
EXTEND(sp, 2);
PUSHs(sv_2mortal(newSVnv((double)(rl.rlim_cur == RLIM_INFINITY ? -1.0 : rl.rlim_cur))));
PUSHs(sv_2mortal(newSVnv((double)(rl.rlim_max == RLIM_INFINITY ? -1.0 : rl.rlim_max))));
}
void
_getrusage(who = RUSAGE_SELF)
int who
PPCODE:
{
struct rusage ru;
#ifdef SOLARIS_PROCFS
Struct_psinfo psi;
Struct_pstatus pst;
struct prusage pru;
pid_t pid = getpid();
int res, fd;
char psib[40], pstb[40], prub[40];
ru.ru_utime.tv_sec = 0;
( run in 0.636 second using v1.01-cache-2.11-cpan-71847e10f99 )