mirror of
https://github.com/aristocratos/btop.git
synced 2024-09-27 22:01:29 +02:00
iterate over ALL pools
This commit is contained in:
parent
860a9fe472
commit
9fdf6d0204
@ -535,9 +535,17 @@ namespace Mem {
|
||||
}
|
||||
|
||||
// this code is for ZFS mounts
|
||||
PipeWrapper f = PipeWrapper("sysctl kstat.zfs.zroot.dataset", "r");
|
||||
if (f()) {
|
||||
PipeWrapper poolPipe = PipeWrapper("zpool list -H -o name", "r");
|
||||
if (poolPipe()) {
|
||||
while (not std::feof(poolPipe())) {
|
||||
char poolName[512];
|
||||
size_t len = 512;
|
||||
if (fgets(poolName, len, poolPipe())) {
|
||||
poolName[strcspn(poolName, "\n")] = 0;
|
||||
char sysCtl[1024];
|
||||
snprintf(sysCtl, sizeof(sysCtl), "sysctl kstat.zfs.%s.dataset", poolName);
|
||||
PipeWrapper f = PipeWrapper(sysCtl, "r");
|
||||
if (f()) {
|
||||
char buf[512];
|
||||
while (not std::feof(f())) {
|
||||
uint64_t nread, nwritten;
|
||||
@ -566,6 +574,9 @@ namespace Mem {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user