iostat_darwin.h 584 B

1234567891011121314151617181920212223242526272829303132
  1. // https://github.com/lufia/iostat/blob/9f7362b77ad333b26c01c99de52a11bdb650ded2/iostat_darwin.h
  2. typedef struct DriveStats DriveStats;
  3. typedef struct CPUStats CPUStats;
  4. enum {
  5. NDRIVE = 16,
  6. NAMELEN = 31
  7. };
  8. struct DriveStats {
  9. char name[NAMELEN+1];
  10. int64_t size;
  11. int64_t blocksize;
  12. int64_t read;
  13. int64_t written;
  14. int64_t nread;
  15. int64_t nwrite;
  16. int64_t readtime;
  17. int64_t writetime;
  18. int64_t readlat;
  19. int64_t writelat;
  20. };
  21. struct CPUStats {
  22. natural_t user;
  23. natural_t nice;
  24. natural_t sys;
  25. natural_t idle;
  26. };
  27. extern int gopsutil_v3_readdrivestat(DriveStats a[], int n);