9 /* /proc/pid doesn't exist just after the fork, and sometimes `ltrace'
10 * couldn't open it to find the executable. So it may be necessary to
14 #define MAX_DELAY 100000 /* 100000 microseconds = 0.1 seconds */
17 * Returns a (malloc'd) file name corresponding to a running pid
26 sprintf(proc_exe, "/proc/%d/exe", pid);
28 while (delay < MAX_DELAY) {
29 if (!access(proc_exe, F_OK)) {
30 return strdup(proc_exe);
32 delay += 1000; /* 1 milisecond */