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

Function CreateProgramName

src/brpc/builtin/common.cpp:336–342  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

334static const char* s_program_name = "unknown";
335static char s_cmdline[256];
336static void CreateProgramName() {
337 const ssize_t nr = butil::ReadCommandLine(s_cmdline, sizeof(s_cmdline) - 1, false);
338 if (nr > 0) {
339 s_cmdline[nr] = '\0';
340 s_program_name = s_cmdline;
341 }
342}
343
344const char* GetProgramName() {
345 pthread_once(&create_program_name_once, CreateProgramName);

Callers

nothing calls this directly

Calls 1

ReadCommandLineFunction · 0.85

Tested by

no test coverage detected