MCPcopy Create free account
hub / github.com/dmtcp/dmtcp / _GetProgramCmdline

Function _GetProgramCmdline

jalib/jfilesystem.cpp:72–84  ·  view source on GitHub ↗

Set buf, and return length read (including all null characters)

Source from the content-addressed store, hash-verified

70
71// Set buf, and return length read (including all null characters)
72int
73_GetProgramCmdline(char *buf, int size)
74{
75 int fd = jalib::open("/proc/self/cmdline", O_RDONLY, 0);
76 int rc;
77
78 JASSERT(fd >= 0);
79
80 // rc == 0 means EOF, or else it means buf is full (size chars read)
81 rc = jalib::readAll(fd, buf, size);
82 jalib::close(fd);
83 return rc;
84}
85}
86
87dmtcp::string

Callers 1

GetProgramNameMethod · 0.85

Calls 3

readAllFunction · 0.85
openFunction · 0.70
closeFunction · 0.70

Tested by

no test coverage detected