public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* PID of multi-threaded core's file name is wrong in 2.5.59
@ 2003-01-25  4:56 MAEDA Naoaki
  2003-01-28 12:21 ` Alan Cox
  0 siblings, 1 reply; 8+ messages in thread
From: MAEDA Naoaki @ 2003-01-25  4:56 UTC (permalink / raw)
  To: linux-kernel

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(&current->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;

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2003-01-28 17:46 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-01-25  4:56 PID of multi-threaded core's file name is wrong in 2.5.59 MAEDA Naoaki
2003-01-28 12:21 ` Alan Cox
2003-01-28 15:45   ` Daniel Jacobowitz
2003-01-28 17:27     ` Robert Love
2003-01-28 17:39       ` Daniel Jacobowitz
2003-01-28 17:42         ` Robert Love
2003-01-28 17:49           ` Daniel Jacobowitz
2003-01-28 18:49             ` Alan Cox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox