Messages in this thread Patch in this message | | | Date | Sat, 25 Jan 2003 13:56:11 +0900 (JST) | From | MAEDA Naoaki <> | Subject | PID of multi-threaded core's file name is wrong in 2.5.59 |
| |
Hi,
I found sometimes pid of muitl-threaded core's file name shows wrong number in 2.5.59 with NPTL-0.17. Problem is, pid of core file name comes from currnet->pid, but I think it should be current->tgid.
Following patch fixes this problem.
MAEDA Naoaki
diff -Naur linux-2.5.59/fs/exec.c linux-2.5.59-corepidfix/fs/exec.c --- linux-2.5.59/fs/exec.c 2003-01-17 11:22:02.000000000 +0900 +++ linux-2.5.59-corepidfix/fs/exec.c 2003-01-25 13:20:50.000000000 +0900 @@ -1166,7 +1166,7 @@ case 'p': pid_in_pattern = 1; rc = snprintf(out_ptr, out_end - out_ptr, - "%d", current->pid); + "%d", current->tgid); if (rc > out_end - out_ptr) goto out; out_ptr += rc; @@ -1238,7 +1238,7 @@ if (!pid_in_pattern && (core_uses_pid || atomic_read(¤t->mm->mm_users) != 1)) { rc = snprintf(out_ptr, out_end - out_ptr, - ".%d", current->pid); + ".%d", current->tgid); if (rc > out_end - out_ptr) goto out; out_ptr += rc; - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |