aboutsummaryrefslogtreecommitdiff
path: root/nptl_db/td_thr_tls_get_addr.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_tls_get_addr.c
parent416be7f049391ce421d9b12a2c3b81bb3cad9f58 (diff)
downloadglibc-7f08f55a9f88d23fcfbf1fed00f4d5a094e5fffc.tar
glibc-7f08f55a9f88d23fcfbf1fed00f4d5a094e5fffc.tar.gz
glibc-7f08f55a9f88d23fcfbf1fed00f4d5a094e5fffc.tar.bz2
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_tls_get_addr.c')
-rw-r--r--nptl_db/td_thr_tls_get_addr.c34
1 files changed, 16 insertions, 18 deletions
diff --git a/nptl_db/td_thr_tls_get_addr.c b/nptl_db/td_thr_tls_get_addr.c
index c900cac8e0..e7d2322723 100644
--- a/nptl_db/td_thr_tls_get_addr.c
+++ b/nptl_db/td_thr_tls_get_addr.c
@@ -22,24 +22,22 @@
#include "thread_dbP.h"
td_err_e
-td_thr_tls_get_addr (const td_thrhandle_t *th __attribute__ ((unused)),
- void *map_address __attribute__ ((unused)),
- size_t offset __attribute__ ((unused)),
- void **address __attribute__ ((unused)))
+td_thr_tls_get_addr (const td_thrhandle_t *th,
+ psaddr_t map_address, size_t offset, psaddr_t *address)
{
-#if USE_TLS
- /* Read the module ID from the link_map. */
- size_t modid;
- if (ps_pdread (th->th_ta_p->ph,
- &((struct link_map *) map_address)->l_tls_modid,
- &modid, sizeof modid) != PS_OK)
- return TD_ERR; /* XXX Other error value? */
+ td_err_e err;
+ psaddr_t modid;
- td_err_e result = td_thr_tlsbase (th, modid, address);
- if (result == TD_OK)
- *address += offset;
- return result;
-#else
- return TD_ERR;
-#endif
+ /* Get the TLS module ID from the `struct link_map' in the inferior. */
+ err = DB_GET_FIELD (modid, th->th_ta_p, map_address, link_map,
+ l_tls_modid, 0);
+ if (err == TD_NOCAPAB)
+ return TD_NOAPLIC;
+ if (err == TD_OK)
+ {
+ err = td_thr_tlsbase (th, (uintptr_t) modid, address);
+ if (err == TD_OK)
+ *address += offset;
+ }
+ return err;
}