pid = ptrace_wait (inferior_ptid, &status);
pid = wait (&status);
child_wait (ptid_t ptid, struct target_waitstatus *ourstatus){  int save_errno;  int status;  char *execd_pathname = NULL;  int exit_status;  int related_pid;  int syscall_id;  enum target_waitkind kind;  int pid;  do    {      set_sigint_trap ();	/* Causes SIGINT to be passed on to the				   attached process. */      set_sigio_trap ();      pid = ptrace_wait (inferior_ptid, &status);      save_errno = errno;      clear_sigio_trap ();      clear_sigint_trap ();      if (pid == -1)	{	  if (save_errno == EINTR)	    continue;	  fprintf_unfiltered (gdb_stderr, "Child process unexpectedly missing: %s.\n",			      safe_strerror (save_errno));	  /* Claim it exited with unknown signal.  */	  ourstatus->kind = TARGET_WAITKIND_SIGNALLED;	  ourstatus->value.sig = TARGET_SIGNAL_UNKNOWN;	  return pid_to_ptid (-1);	}      /* Did it exit?       */      if (target_has_exited (pid, status, &exit_status))	{	  /* ??rehrauer: For now, ignore this. */	  continue;	}      if (!target_thread_alive (pid_to_ptid (pid)))	{	  ourstatus->kind = TARGET_WAITKIND_SPURIOUS;	  return pid_to_ptid (pid);	}      } while (pid != PIDGET (inferior_ptid)); /* Some other child died or stopped */  store_waitstatus (ourstatus, status);  return pid_to_ptid (pid);}