version 1.91, 2004/09/23 22:55:06 |
version 1.92, 2004/11/09 23:20:18 |
|
|
mib[2] = KERN_POOL_NPOOLS; |
mib[2] = KERN_POOL_NPOOLS; |
size = sizeof(npools); |
size = sizeof(npools); |
if (sysctl(mib, 3, &npools, &size, NULL, 0) < 0) { |
if (sysctl(mib, 3, &npools, &size, NULL, 0) < 0) { |
printf("Can't figure out number of pools in kernel: %s\n", |
warn("can't figure out number of pools in kernel"); |
strerror(errno)); |
|
return; |
return; |
} |
} |
|
|
|
|
if (sysctl(mib, 4, &pool, &size, NULL, 0) < 0) { |
if (sysctl(mib, 4, &pool, &size, NULL, 0) < 0) { |
if (errno == ENOENT) |
if (errno == ENOENT) |
continue; |
continue; |
printf("error getting pool: %s\n", strerror(errno)); |
warn("error getting pool"); |
return; |
return; |
} |
} |
npools--; |
npools--; |
mib[2] = KERN_POOL_NAME; |
mib[2] = KERN_POOL_NAME; |
size = sizeof(name); |
size = sizeof(name); |
if (sysctl(mib, 4, &name, &size, NULL, 0) < 0) { |
if (sysctl(mib, 4, &name, &size, NULL, 0) < 0) { |
printf("error getting pool name: %s\n", |
warn("error getting pool name"); |
strerror(errno)); |
|
return; |
return; |
} |
} |
print_pool(&pool, name); |
print_pool(&pool, name); |