convert to_has_exited
[binutils-gdb.git] / gdb / inf-ptrace.c
index 1ab6b0beee29074947af26bcc4c2880c16ba013a..bffb4bac0311bcf5585bd49bfa6341309ce12a62 100644 (file)
@@ -147,7 +147,7 @@ inf_ptrace_create_inferior (struct target_ops *ops,
 #ifdef PT_GET_PROCESS_STATE
 
 static void
-inf_ptrace_post_startup_inferior (ptid_t pid)
+inf_ptrace_post_startup_inferior (struct target_ops *self, ptid_t pid)
 {
   ptrace_event_t pe;
 
@@ -246,7 +246,7 @@ inf_ptrace_attach (struct target_ops *ops, char *args, int from_tty)
 #ifdef PT_GET_PROCESS_STATE
 
 static void
-inf_ptrace_post_attach (int pid)
+inf_ptrace_post_attach (struct target_ops *self, int pid)
 {
   ptrace_event_t pe;
 
@@ -321,7 +321,7 @@ inf_ptrace_kill (struct target_ops *ops)
 /* Stop the inferior.  */
 
 static void
-inf_ptrace_stop (ptid_t ptid)
+inf_ptrace_stop (struct target_ops *self, ptid_t ptid)
 {
   /* Send a SIGINT to the process group.  This acts just like the user
      typed a ^C on the controlling terminal.  Note that using a
@@ -489,9 +489,9 @@ inf_ptrace_xfer_partial (struct target_ops *ops, enum target_object object,
        errno = 0;
        if (ptrace (PT_IO, pid, (caddr_t)&piod, 0) == 0)
          {
-           *xfered_len = piod.piod_len;
            /* Return the actual number of bytes read or written.  */
-           return TARGET_XFER_OK;
+           *xfered_len = piod.piod_len;
+           return (piod.piod_len == 0) ? TARGET_XFER_EOF : TARGET_XFER_OK;
          }
        /* If the PT_IO request is somehow not supported, fallback on
           using PT_WRITE_D/PT_READ_D.  Otherwise we will return zero
@@ -595,9 +595,9 @@ inf_ptrace_xfer_partial (struct target_ops *ops, enum target_object object,
        errno = 0;
        if (ptrace (PT_IO, pid, (caddr_t)&piod, 0) == 0)
          {
-           *xfered_len = piod.piod_len;
            /* Return the actual number of bytes read or written.  */
-           return TARGET_XFER_OK;
+           *xfered_len = piod.piod_len;
+           return (piod.piod_len == 0) ? TARGET_XFER_EOF : TARGET_XFER_OK;
          }
       }
 #endif