MCPcopy Create free account
hub / github.com/alibaba/PhotonLibOS / popen_read

Function popen_read

thread/test/test-lib-data.cpp:36–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34}
35
36std::string popen_read(const std::string& cmd, int expect = 0) {
37 std::string ret;
38 puts(cmd.c_str());
39 auto p = popen(cmd.c_str(), "r");
40 char buffer[4096];
41 while (fgets(buffer, sizeof(buffer), p) != NULL) {
42 ret += buffer;
43 puts(buffer);
44 }
45 pclose(p);
46 return ret;
47}
48
49std::string libpath(uint64_t pid) {
50 auto path =

Callers 1

libpathFunction · 0.85

Calls 1

c_strMethod · 0.45

Tested by

no test coverage detected