342 |
|
if(stats.dinfo==NULL) return NULL; |
343 |
|
stats_init = 1; |
344 |
|
} |
345 |
+ |
#ifdef FREEBSD5 |
346 |
+ |
if ((devstat_getdevs(NULL, &stats)) < 0) return NULL; |
347 |
+ |
/* Not aware of a get all devices, so i said 999. If we ever * find a machine with more than 999 disks, then i'll change * this number :) */ |
348 |
+ |
if (devstat_selectdevs(&dev_sel, &n_selected, &n_selections, &sel_gen, stats.dinfo->generation, stats.dinfo->devices, stats.dinfo->numdevs, NULL, 0, NULL, 0, DS_SELECT_ONLY, 999, 1) < 0) return NULL; |
349 |
+ |
#else |
350 |
|
if ((getdevs(&stats)) < 0) return NULL; |
351 |
|
/* Not aware of a get all devices, so i said 999. If we ever |
352 |
|
* find a machine with more than 999 disks, then i'll change |
353 |
|
* this number :) |
354 |
|
*/ |
350 |
– |
#ifdef FREEBSD5 |
351 |
– |
if ((devstat_getdevs(NULL, &stats)) < 0) return NULL; |
352 |
– |
#else |
355 |
|
if (selectdevs(&dev_sel, &n_selected, &n_selections, &sel_gen, stats.dinfo->generation, stats.dinfo->devices, stats.dinfo->numdevs, NULL, 0, NULL, 0, DS_SELECT_ONLY, 999, 1) < 0) return NULL; |
356 |
|
#endif |
357 |
|
|