Retrieves register and stack information for threads.
Threads Library (libpthreads.a)
pthread_getthrds_np (pthread_t * thread, int mode,
struct __pthrdsinfo * buf, int bufsize,
void * regbuf, int * regbufsize);
The pthread_getthrds_np subroutine retrieves information on the state of the thread thread and its underlying kernel thread, including register and stack information.
|thread||The pointer to the thread. On input it identifies the target thread of the operation, or 0 to operate on the first entry in the list of threads. On output it identifies the next entry in the list of threads, or 0 if the end of the list has been reached. pthread_getthrds_np can be used to traverse the whole list of threads by starting with thread pointing to 0 and calling pthread_getthrds_np repeatedly until it returns with thread pointing to 0.|
|mode||Specifies the type of query. These values can be bitwise
or'ed together to specify more than one type of query.
|buf||Specifies the address of the struct __pthrdsinfo structure
that will be filled in by pthread_getthrds_np. On return,
this structure holds the following data (depending on the type of query
|bufsize||The size of the __pthrdsinfo structure in bytes.|
|regbuf||The location of the buffer to hold the register save data from the kernel if the thread is in a system call.|
|regbufsize||The pointer to the size of the regbuf buffer. On input, it identifies the maximum size of the buffer in bytes. On output, it identifies the number of bytes of register save data. If the thread is not in a system call, there is no register save data returned from the kernel, and regbufsize is 0. If the size of the register save data is larger than the input value of regbufsize, the number of bytes specified by the input value of regbufsize is copied to regbuf, pthread_getthrds_np() returns ERANGE, and the output value of regbufsize specifies the number of bytes required to hold all of the register save data.|
If successful, the pthread_getthrds_np function returns zero. Otherwise, an error number is returned to indicate the error.
function will fail if:
|EINVAL||Either thread or buf is NULL, or bufsize is not equal to the size of the __pthrdsinfo structure in the library.|
|ESRCH||No thread could be found corresponding to that specified by the thread ID thread.|
|ERANGE||regbuf was not large enough to handle all of the register save data.|
|ENOMEM||Insufficient memory exists to perform this operation.|
This subroutine is part of the Base Operating System (BOS) Runtime.
The pthread.h file.