======================================
| 51 | |
| 52 | // ====================================== |
| 53 | struct ProcStat { |
| 54 | int pid; |
| 55 | //std::string comm; |
| 56 | char state; |
| 57 | int ppid; |
| 58 | int pgrp; |
| 59 | int session; |
| 60 | int tty_nr; |
| 61 | int tpgid; |
| 62 | unsigned flags; |
| 63 | unsigned long minflt; |
| 64 | unsigned long cminflt; |
| 65 | unsigned long majflt; |
| 66 | unsigned long cmajflt; |
| 67 | unsigned long utime; |
| 68 | unsigned long stime; |
| 69 | unsigned long cutime; |
| 70 | unsigned long cstime; |
| 71 | long priority; |
| 72 | long nice; |
| 73 | long num_threads; |
| 74 | }; |
| 75 | |
| 76 | static bool read_proc_status(ProcStat &stat) { |
| 77 | stat = ProcStat(); |