503 |
|
|
504 |
|
if(diskio_stats_ptr->disk_name!=NULL) free(diskio_stats_ptr->disk_name); |
505 |
|
|
506 |
< |
diskio_stats_ptr->disk_name=strdup(ksp->ks_name); |
506 |
> |
diskio_stats_ptr->disk_name=strdup((char *) get_svr_from_bsd(ksp->ks_name)); |
507 |
|
diskio_stats_ptr->systime=time(NULL); |
508 |
|
num_diskio++; |
509 |
|
} |
576 |
|
n++; |
577 |
|
} |
578 |
|
|
579 |
+ |
if(f != NULL) fclose(f); |
580 |
+ |
|
581 |
+ |
/* This code relies on /proc/partions existing, and it all being malloc'ed above. |
582 |
+ |
|
583 |
|
if (!has_pp_stats) { |
584 |
|
/* This is an older kernel without stats in /proc/partitions. |
585 |
|
Read what we can from /proc/stat instead. */ |
649 |
|
num_diskio = n; |
650 |
|
out: |
651 |
|
if (f != NULL) fclose(f); |
652 |
+ |
#endif |
653 |
|
|
654 |
+ |
#ifdef CYGWIN |
655 |
+ |
return NULL; |
656 |
|
#endif |
657 |
+ |
|
658 |
|
*entries=num_diskio; |
659 |
|
|
660 |
|
return diskio_stats; |