Back to index

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

Go to the source code of this file.

Functions

td_err_e td_ta_get_nthreads (const td_thragent_t *ta, int *np)

Function Documentation

td_err_e td_ta_get_nthreads ( const td_thragent_t *  ta,
int np 
)

Definition at line 24 of file td_ta_get_nthreads.c.

{
  psaddr_t addr;

  LOG ("td_ta_get_nthreads");

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

  /* Access the variable `__pthread_handles_num'.  */
  if (td_lookup (ta->ph, PTHREAD_HANDLES_NUM, &addr) != PS_OK)
     return TD_ERR;  /* XXX Other error value?  */

  if (ps_pdread (ta->ph, addr, np, sizeof (int)) != PS_OK)
     return TD_ERR;  /* XXX Other error value?  */

  return TD_OK;
}