MCPcopy Create free account
hub / github.com/KDE/konsole / readProcessName

Method readProcessName

src/ProcessInfo.cpp:1041–1061  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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
1063private:
1064 bool readProcInfo(int pid) override

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected