通过pid查找task_struct的有效方法 [英] Efficient way to find task_struct by pid
本文介绍了通过pid查找task_struct的有效方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否有一种有效的方法来查找指定PID的task_struct
,而无需遍历task_struct
列表?
Is there an efficient way of finding the task_struct
for a specified PID, without iterating through the task_struct
list?
推荐答案
使用以下选项之一有什么问题?
What's wrong with using one of the following?
extern struct task_struct *find_task_by_vpid(pid_t nr);
extern struct task_struct *find_task_by_pid_ns(pid_t nr,
struct pid_namespace *ns);
这篇关于通过pid查找task_struct的有效方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文