Since a task_struct is allocated for each thread in Linux, how to I find the threads that belong to the same process?
So, that was the general question. To elaborate, I need to write a kernel function that traverses the threads that belong to a process (p), given a pointer to its task_struct or pid, and do something with them (e.g. collect some information).
/proc/[pid]/task.