| 487 | } |
| 488 | |
| 489 | int OS::getProcessIds(int* pids, int max_pids) { |
| 490 | int count = 0; |
| 491 | DIR* proc = opendir("/proc"); |
| 492 | if (!proc) return 0; |
| 493 | |
| 494 | for (dirent* de; (de = readdir(proc)) && count < max_pids;) { |
| 495 | int pid = atoi(de->d_name); |
| 496 | if (pid > 0) { |
| 497 | pids[count++] = pid; |
| 498 | } |
| 499 | } |
| 500 | |
| 501 | closedir(proc); |
| 502 | return count; |
| 503 | } |
| 504 | |
| 505 | static bool readProcessCmdline(int pid, ProcessInfo* info) { |
| 506 | char path[64]; |
nothing calls this directly
no outgoing calls
no test coverage detected