mirror of
https://github.com/ivabus/pantry
synced 2024-11-27 02:35:08 +03:00
20 lines
512 B
C++
20 lines
512 B
C++
|
#include <eden/common/utils/ProcessNameCache.h>
|
||
|
#include <cstdlib>
|
||
|
#include <iostream>
|
||
|
|
||
|
using namespace facebook::eden;
|
||
|
|
||
|
ProcessNameCache& getProcessNameCache() {
|
||
|
static auto* pnc = new ProcessNameCache;
|
||
|
return *pnc;
|
||
|
}
|
||
|
|
||
|
ProcessNameHandle lookupProcessName(pid_t pid) {
|
||
|
return getProcessNameCache().lookup(pid);
|
||
|
}
|
||
|
|
||
|
int main() {
|
||
|
int pid = getpid();
|
||
|
std::cout << lookupProcessName(pid).get() << std::endl;
|
||
|
return 0;
|
||
|
}
|