While examining Linux Kernel, to get the process ID they use:
pid_t pid = current->pid;
But in some places I saw:
pid_t pid = task_tgid_vnr(current);
I wonder the rationale behind it and where should I use the one instead of the other?
(Detailed explanations will also be welcomed)