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

Method getProcInfoStruct

src/UnixProcessInfo.cpp:121–138  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

119
120#if defined(Q_OS_FREEBSD) || defined(Q_OS_OPEN_BSD) || defined(Q_OS_MACOS)
121QSharedPointer<struct kinfo_proc> UnixProcessInfo::getProcInfoStruct(int *managementInfoBase, int mibCount)
122{
123 size_t structLength;
124
125 if (::sysctl(managementInfoBase, mibCount, NULL, &structLength, NULL, 0) == -1) {
126 qWarning() << "first sysctl() call failed with code " << errno;
127 return nullptr;
128 }
129
130 QSharedPointer<struct kinfo_proc> kInfoProc(new struct kinfo_proc[structLength]);
131
132 if (::sysctl(managementInfoBase, mibCount, kInfoProc.get(), &structLength, NULL, 0) == -1) {
133 qWarning() << "second sysctl() call failed with code " << errno;
134 return nullptr;
135 }
136
137 return kInfoProc;
138}
139#endif
140
141#endif // Q_OS_WIN

Callers

nothing calls this directly

Calls 1

getMethod · 0.80

Tested by

no test coverage detected