MCPcopy Create free account
hub / github.com/Xfennec/progress / find_pid_by_id

Function find_pid_by_id

progress.c:162–174  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

160
161#ifdef __APPLE__
162int find_pid_by_id(pid_t pid, pidinfo_t *pid_list)
163{
164char exe[MAXPATHLEN + 1];
165
166exe[0] = '\0';
167proc_name(pid, exe, sizeof(exe));
168if (exe[0] == '\0')
169 return 0;
170
171pid_list[0].pid = pid;
172strcpy(pid_list[0].name, exe);
173return 1;
174}
175
176int find_pids_by_binary_name(char *bin_name, pidinfo_t *pid_list, int max_pids)
177{

Callers 1

monitor_processesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected