task_pid_nr(current);
task_pid_nr_ns(current);
current是個全局的,可以點task_struct去看下 這個結構體的各個成員代表的意思
static inline pid_t task_pid_nr(struct task_struct *tsk)
{
return tsk->pid;
}
static inline pid_t task_pid_nr_ns(struct task_struct *tsk, struct pid_namespace *ns)
{
return __task_pid_nr_ns(tsk, PIDTYPE_PID, ns);
}