998 /**
999 * sys_getpid - return the thread group id of the current process
1000 *
1001 * Note, despite the name, this returns the tgid not the pid. The tgid and
1002 * the pid are identical unless CLONE_THREAD was specified on clone() in
1003 * which case the tgid is the same in all threads of the same group.
1004 *
1005 * This is SMP safe as current->tgid does not change.
1006 */
1007 asmlinkage long sys_getpid(void)
1008 {
1009 return current->tgid;
1010 }
1011