summary refs log tree commit diff
path: root/nptl_db/td_thr_validate.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2003-09-09 07:01:01 +0000
committerRoland McGrath <roland@gnu.org>2003-09-09 07:01:01 +0000
commit7f08f55a9f88d23fcfbf1fed00f4d5a094e5fffc (patch)
tree5796d7f5d713c3c264a70a6039b0ba52e262b06f /nptl_db/td_thr_validate.c
parent416be7f049391ce421d9b12a2c3b81bb3cad9f58 (diff)
downloadglibc-7f08f55a9f88d23fcfbf1fed00f4d5a094e5fffc.tar.gz
glibc-7f08f55a9f88d23fcfbf1fed00f4d5a094e5fffc.tar.xz
glibc-7f08f55a9f88d23fcfbf1fed00f4d5a094e5fffc.zip
* sysdeps/unix/sysv/linux/speed.c
	(cfsetospeed): Only set c_ospeed under [_HAVE_STRUCT_TERMIOS_C_OSPEED].
	(cfsetispeed): Only set c_ispeed under [_HAVE_STRUCT_TERMIOS_C_ISPEED].
	* sysdeps/unix/sysv/linux/bits/termios.h
	(_HAVE_STRUCT_TERMIOS_C_ISPEED, _HAVE_STRUCT_TERMIOS_C_OSPEED): Define.
	* sysdeps/unix/sysv/linux/alpha/bits/termios.h: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/bits/termios.h: Likewise.
Diffstat (limited to 'nptl_db/td_thr_validate.c')
-rw-r--r--nptl_db/td_thr_validate.c62
1 files changed, 36 insertions, 26 deletions
diff --git a/nptl_db/td_thr_validate.c b/nptl_db/td_thr_validate.c
index 28fec6a00e..e0b05f52e7 100644
--- a/nptl_db/td_thr_validate.c
+++ b/nptl_db/td_thr_validate.c
@@ -24,43 +24,53 @@
 static td_err_e
 check_thread_list (const td_thrhandle_t *th, psaddr_t head)
 {
-  list_t list;
-  td_err_e result = TD_NOTHR;
-
-  if (ps_pdread (th->th_ta_p->ph, head, &list.next, sizeof (list.next))
-      != PS_OK)
-    return TD_ERR;	/* XXX Other error value?  */
-
-  while (list.next != head)
-    if ((psaddr_t) list.next - offsetof (struct pthread, list)
-	== th->th_unique)
-      {
-	result = TD_OK;
-	break;
-      }
-    else if (ps_pdread (th->th_ta_p->ph, list.next, &list.next,
-			sizeof (list.next)) != PS_OK)
-      {
-	result = TD_ERR;	/* XXX Other error value?  */
-	break;
-      }
-
-  return result;
+  td_err_e err;
+  psaddr_t next, ofs;
+
+  err = DB_GET_FIELD (next, th->th_ta_p, head, list_t, next, 0);
+  if (err == TD_OK)
+    {
+      if (next == 0)
+	return TD_NOTHR;
+      err = DB_GET_FIELD_ADDRESS (ofs, th->th_ta_p, 0, pthread, list, 0);
+    }
+
+  while (err == TD_OK)
+    {
+      if (next == head)
+	return TD_NOTHR;
+
+      if (next - (ofs - (psaddr_t) 0) == th->th_unique)
+	return TD_OK;
+
+      err = DB_GET_FIELD (next, th->th_ta_p, next, list_t, next, 0);
+    }
+
+  return err;
 }
 
 
 td_err_e
 td_thr_validate (const td_thrhandle_t *th)
 {
+  td_err_e err;
+  psaddr_t list;
+
   LOG ("td_thr_validate");
 
   /* First check the list with threads using user allocated stacks.  */
-  td_err_e result = check_thread_list (th, th->th_ta_p->stack_user);
+  err = DB_GET_SYMBOL (list, th->th_ta_p, __stack_user);
+  if (err == TD_OK)
+    err = check_thread_list (th, list);
 
   /* If our thread is not on this list search the list with stack
      using implementation allocated stacks.  */
-  if (result == TD_NOTHR)
-    result = check_thread_list (th, th->th_ta_p->stack_used);
+  if (err == TD_NOTHR)
+    {
+      err = DB_GET_SYMBOL (list, th->th_ta_p, stack_used);
+      if (err == TD_OK)
+	err = check_thread_list (th, list);
+    }
 
-  return result;
+  return err;
 }