MCPcopy Create free account
hub / github.com/apache/brpc / CreateProgramPath

Function CreateProgramPath

src/brpc/builtin/common.cpp:352–358  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

350static const char* s_program_path = "unknown";
351static char s_program_exec_path[PATH_MAX];
352static void CreateProgramPath() {
353 const ssize_t nr = butil::GetProcessAbsolutePath(s_program_exec_path, sizeof(s_program_exec_path) - 1);
354 if (nr > 0) {
355 s_program_exec_path[nr] = '\0';
356 s_program_path = s_program_exec_path;
357 }
358}
359
360const char* GetProgramPath() {
361 pthread_once(&create_program_path_once, CreateProgramPath);

Callers

nothing calls this directly

Calls 1

GetProcessAbsolutePathFunction · 0.85

Tested by

no test coverage detected