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);
}