mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-11-08 14:10:11 +01:00
DiskIO: detect physical drive size
This commit is contained in:
@@ -102,6 +102,12 @@ const char* ffDiskIOGetIoCounters(FFlist* result, FFDiskIOOptions* options)
|
||||
device->type = ffStrbufEqualS(&buffer, "1") ? FF_DISKIO_PHYSICAL_TYPE_HDD : FF_DISKIO_PHYSICAL_TYPE_SSD;
|
||||
else
|
||||
device->type = FF_DISKIO_PHYSICAL_TYPE_UNKNOWN;
|
||||
|
||||
snprintf(pathSysBlock, PATH_MAX, "/sys/block/%s/size", devName);
|
||||
if (ffReadFileBuffer(pathSysBlock, &buffer))
|
||||
device->size = ffStrbufToUInt(&buffer, 0);
|
||||
else
|
||||
device->size = 0;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
|
||||
Reference in New Issue
Block a user