Set buf, and return length read (including all null characters)
| 70 | |
| 71 | // Set buf, and return length read (including all null characters) |
| 72 | int |
| 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 | |
| 87 | dmtcp::string |
no test coverage detected