Back to index

glibc  2.9
Functions
td_ta_event_addr.c File Reference
#include "thread_dbP.h"

Go to the source code of this file.

Functions

td_err_e td_ta_event_addr (const td_thragent_t *ta, td_event_e event, td_notify_t *addr)

Function Documentation

td_err_e td_ta_event_addr ( const td_thragent_t *  ta,
td_event_e  event,
td_notify_t addr 
)

Definition at line 25 of file td_ta_event_addr.c.

{
  td_err_e res = TD_NOEVENT;
  int idx = -1;

  LOG ("td_ta_event_addr");

  /* Test whether the TA parameter is ok.  */
  if (! ta_ok (ta))
    return TD_BADTA;

  switch (event)
    {
    case TD_CREATE:
      idx = LINUXTHREADS_CREATE_EVENT;
      break;

    case TD_DEATH:
      idx = LINUXTHREADS_DEATH_EVENT;
      break;

    case TD_REAP:
      idx = LINUXTHREADS_REAP_EVENT;
      break;

    default:
      /* Event cannot be handled.  */
      break;
    }

  /* Now get the address.  */
  if (idx != -1)
    {
      psaddr_t taddr;

      if (td_lookup (ta->ph, idx, &taddr) == PS_OK)
       {
         /* Success, we got the address.  */
         addr->type = NOTIFY_BPT;
         addr->u.bptaddr = taddr;

         res = TD_OK;
       }
      else
       res = TD_ERR;
    }

  return res;
}