fillin some cpu info

This commit is contained in:
Doug MacEachern 2005-09-04 01:06:31 +00:00
parent 1cf65abe89
commit ff4d75d357
1 changed files with 13 additions and 6 deletions

View File

@ -272,16 +272,23 @@ int sigar_file_system_usage_get(sigar_t *sigar,
int sigar_cpu_info_list_get(sigar_t *sigar, int sigar_cpu_info_list_get(sigar_t *sigar,
sigar_cpu_info_list_t *cpu_infos) sigar_cpu_info_list_t *cpu_infos)
{ {
sigar_cpu_info_t *info; struct cpu_info cpu;
int num = 0;
sigar_cpu_info_list_create(cpu_infos); sigar_cpu_info_list_create(cpu_infos);
info = &cpu_infos->data[cpu_infos->number++]; while (netware_cpu_info(&cpu, &num) == 0) {
sigar_cpu_info_t *info;
SIGAR_SSTRCPY(info->vendor, "vendor"); SIGAR_CPU_INFO_LIST_GROW(cpu_infos);
SIGAR_SSTRCPY(info->model, "model");
info->mhz = -1; info = &cpu_infos->data[cpu_infos->number++];
info->cache_size = -1;
SIGAR_SSTRCPY(info->vendor, "vendor");
SIGAR_SSTRCPY(info->model, "model");
info->mhz = cpu.Speed;
info->cache_size = cpu.L2CacheSize;
}
return SIGAR_OK; return SIGAR_OK;
} }