FreeBSD/sys/compat/linux/linux_misc.c
/*
 * In case when the Linux thread is the initial thread in
 * the thread group thread id is equal to the process id.
 * Glibc depends on this magic (assert in pthread_getattr_np.c).
 */
In case when the Linux thread is the initial thread in
the thread group thread id is equal to the process id.
Glibc depends on this magic (assert in pthread_getattr_np.c).
In case when the Linux thread is the initial thread in the thread group thread id is equal to the process id . Glibc depends on this magic ( assert in pthread_getattr_np . c ) .
struct thread *
linux_tdfind(struct thread *td, lwpid_t tid, pid_t pid)
{
	struct linux_emuldata *em;
	struct thread *tdt;
	struct proc *p;
	tdt = NULL;
	if (tid == 0 || tid == td->td_tid) {
		tdt = td;
		PROC_LOCK(tdt->td_proc);
	} else if (tid > PID_MAX)
		tdt = tdfind(tid, pid);
	else {
		p = pfind(tid);
		if (p != NULL) {
			if (SV_PROC_ABI(p) != SV_ABI_LINUX) {
				PROC_UNLOCK(p);
				return (NULL);
			}
			FOREACH_THREAD_IN_PROC(p, tdt) {
				em = em_find(tdt);
				if (tid == em->em_tid)
					return (tdt);
			}
			PROC_UNLOCK(p);
		}
		return (NULL);
	}
	return (tdt);
}
struct thread * linux_tdfind ( struct thread * td , lwpid_t tid , pid_t pid ) { struct linux_emuldata * em ; struct thread * tdt ; struct proc * p ; tdt = NULL ; if ( tid == 0 || tid == td -> td_tid ) { tdt = td ; PROC_LOCK ( tdt -> td_proc ) ; } else if ( tid > PID_MAX ) tdt = tdfind ( tid , pid ) ; else { p = pfind ( tid ) ; if ( p != NULL ) { if ( SV_PROC_ABI ( p ) != SV_ABI_LINUX ) { PROC_UNLOCK ( p ) ; return ( NULL ) ; } FOREACH_THREAD_IN_PROC ( p , tdt ) { em = em_find ( tdt ) ; if ( tid == em -> em_tid ) return ( tdt ) ; } PROC_UNLOCK ( p ) ; } return ( NULL ) ; } return ( tdt ) ; }
In case when the Linux thread is the initial thread in
 the thread group thread id is equal to the process id.
In case when the Linux thread is the initial thread in the thread group thread id is equal to the process id .
/*
		 * Initial thread where the tid equal to the pid.
		 */ /*
				 * p is not a Linuxulator process.
				 */