Fill in temporary implementation of sigar_cpu_list_get to get all the
tests passing on darwin. Will add support for multiple cpu's later.
This commit is contained in:
parent
03b36fdd4c
commit
a467383f27
|
@ -222,7 +222,6 @@ int sigar_cpu_get(sigar_t *sigar, sigar_cpu_t *cpu)
|
||||||
|
|
||||||
cpu->total = cpu->user + cpu->nice + cpu->sys + cpu->idle;
|
cpu->total = cpu->user + cpu->nice + cpu->sys + cpu->idle;
|
||||||
|
|
||||||
|
|
||||||
#else
|
#else
|
||||||
/*XXX*/
|
/*XXX*/
|
||||||
cpu->user = 0;
|
cpu->user = 0;
|
||||||
|
@ -238,7 +237,14 @@ int sigar_cpu_get(sigar_t *sigar, sigar_cpu_t *cpu)
|
||||||
|
|
||||||
int sigar_cpu_list_get(sigar_t *sigar, sigar_cpu_list_t *cpulist)
|
int sigar_cpu_list_get(sigar_t *sigar, sigar_cpu_list_t *cpulist)
|
||||||
{
|
{
|
||||||
return SIGAR_ENOTIMPL;
|
sigar_cpu_t *cpu;
|
||||||
|
|
||||||
|
sigar_cpu_list_create(cpulist);
|
||||||
|
|
||||||
|
/* XXX multi cpu */
|
||||||
|
cpu = &cpulist->data[cpulist->number++];
|
||||||
|
|
||||||
|
return sigar_cpu_get(sigar, cpu);
|
||||||
}
|
}
|
||||||
|
|
||||||
int sigar_uptime_get(sigar_t *sigar,
|
int sigar_uptime_get(sigar_t *sigar,
|
||||||
|
|
Loading…
Reference in New Issue