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