| 1039 | } |
| 1040 | |
| 1041 | bool readProcessName(int pid) override |
| 1042 | { |
| 1043 | int managementInfoBase[6]; |
| 1044 | |
| 1045 | managementInfoBase[0] = CTL_KERN; |
| 1046 | managementInfoBase[1] = KERN_PROC; |
| 1047 | managementInfoBase[2] = KERN_PROC_PID; |
| 1048 | managementInfoBase[3] = pid; |
| 1049 | managementInfoBase[4] = sizeof(struct kinfo_proc); |
| 1050 | managementInfoBase[5] = 1; |
| 1051 | |
| 1052 | auto kInfoProc = getProcInfoStruct(managementInfoBase, 6); |
| 1053 | |
| 1054 | if (kInfoProc == nullptr) { |
| 1055 | return false; |
| 1056 | } |
| 1057 | |
| 1058 | setName(QString::fromUtf8(kInfoProc->p_comm)); |
| 1059 | |
| 1060 | return true; |
| 1061 | } |
| 1062 | |
| 1063 | private: |
| 1064 | bool readProcInfo(int pid) override |
nothing calls this directly
no outgoing calls
no test coverage detected