MCPcopy Create free account
hub / github.com/Selectively11/CloudRedirect / GetProcessName

Function GetProcessName

src/platform/linux/init.cpp:125–137  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

123}
124
125static std::string GetProcessName()
126{
127 char buf[256] = {};
128 FILE* f = fopen("/proc/self/comm", "r");
129 if (f) {
130 if (fgets(buf, sizeof(buf), f)) {
131 size_t len = strlen(buf);
132 if (len > 0 && buf[len-1] == '\n') buf[len-1] = '\0';
133 }
134 fclose(f);
135 }
136 return buf;
137}
138
139static void CleanLdPreload()
140{

Callers 1

OnLoadFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected