38 linux_debug (const
char *format, ...)
44 va_start (args, format);
45 vfprintf (stderr, format, args);
62 snprintf (buf,
sizeof (buf),
"%s (stopped at syscall)",
65 snprintf (buf,
sizeof (buf),
"%s (stopped)",
69 snprintf (buf,
sizeof (buf),
"%s (terminated)",
72 snprintf (buf,
sizeof (buf),
"%d (exited)",
WEXITSTATUS (status));
84 linux_debug (
"my_waitpid (%d, 0x%x)\n", pid, flags);
88 ret = waitpid (pid, status, flags);
90 while (ret == -1 &&
errno == EINTR);
93 linux_debug (
"my_waitpid (%d, 0x%x): status(%x), %d\n",
94 pid, flags, (ret > 0 && status != NULL) ? *status : -1, ret);
char * status_to_str(int status)
int my_waitpid(int pid, int *status, int flags)
static void ATTRIBUTE_PRINTF(1, 2)