proc_get_lwpstatus
extern int proc_get_lwpstatus(pid_t, uint_t, lwpstatus_t *);
if (proc_get_lwpstatus(getpid(), (uint_t)thr, &lwp) != 0) {