MCPcopy Create free account
hub / github.com/MaartenBaert/ssr / GetProgramName

Function GetProgramName

glinject/SSRVideoStreamWriter.cpp:18–28  ·  view source on GitHub ↗

Returns the program name (i.e. filename of the binary)

Source from the content-addressed store, hash-verified

16
17// Returns the program name (i.e. filename of the binary)
18static std::string GetProgramName() {
19 std::vector<char> temp(10000);
20 ssize_t size = readlink("/proc/self/exe", temp.data(), temp.size());
21 if(size < 0)
22 return std::string();
23 std::string path(temp.data(), size);
24 size_t p = path.find_last_of('/');
25 if(p == std::string::npos)
26 return path;
27 return path.substr(p + 1);
28}
29
30SSRVideoStreamWriter::SSRVideoStreamWriter(const std::string& channel, const std::string& source) {
31

Callers 1

SSRVideoStreamWriterMethod · 0.85

Calls 1

dataMethod · 0.80

Tested by

no test coverage detected