Changeset 43978 in vbox for trunk/src/VBox/Main/src-server
- Timestamp:
- Nov 28, 2012 5:11:51 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/solaris/PerformanceSolaris.cpp
r43897 r43978 66 66 virtual int getHostMemoryUsage(ULONG *total, ULONG *used, ULONG *available); 67 67 virtual int getHostFilesystemUsage(const char *name, ULONG *total, ULONG *used, ULONG *available); 68 virtual int getHostDiskSize(const char *name, uint64_t *size); 68 69 virtual int getProcessMemoryUsage(RTPROCESS process, ULONG *used); 69 70 … … 494 495 495 496 return VINF_SUCCESS; 497 } 498 499 int CollectorSolaris::getHostDiskSize(const char *name, uint64_t *size) 500 { 501 int rc = VINF_SUCCESS; 502 AssertReturn(strlen(name) + 5 < KSTAT_STRLEN, VERR_INVALID_PARAMETER); 503 LogFlowThisFunc(("n=%s\n", name)); 504 char szName[KSTAT_STRLEN]; 505 strcpy(szName, name); 506 strcat(szName, ",err"); 507 kstat_t *ksDisk = kstat_lookup(mKC, "sderr", -1, szName); 508 if (ksDisk != 0) 509 { 510 if (kstat_read(mKC, ksDisk, 0) == -1) 511 { 512 LogRel(("kstat_read(%s) -> %d\n", name, errno)); 513 rc = VERR_INTERNAL_ERROR; 514 } 515 else 516 { 517 kstat_named_t *kn; 518 if ((kn = (kstat_named_t *)kstat_data_lookup(ksDisk, (char *)"Size")) == 0) 519 { 520 LogRel(("kstat_data_lookup(rbytes) -> %d, name=%s\n", errno, name)); 521 return VERR_INTERNAL_ERROR; 522 } 523 *size = kn->value.ull; 524 } 525 } 526 527 return rc; 496 528 } 497 529
Note:
See TracChangeset
for help on using the changeset viewer.