From mboxrd@z Thu Jan 1 00:00:00 1970 From: connintel@gmail.com (conn intel) Date: Tue, 24 May 2011 11:01:45 +0530 Subject: pid_task function fails to execute In-Reply-To: References: Message-ID: To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org On Thu, May 5, 2011 at 7:59 PM, Dave Hylands wrote: > Hi, > > On Thu, May 5, 2011 at 1:42 AM, conn intel wrote: > > > > I found the issue: > > > > one has to pass arguments to pid_task as: pid_task(find_get_pid( found > > using sys_getpid in userspace>) , PIDTYPE_PID); > > > > I am trying to understand how the pid value using find_get_pid function > > differs from the pid found in the userspace. It seems that they are > > different and due to that kernel get exception. > > In the kernel, the pid is like a thread-id and the tgid is the process id. > > In user space, the ps command shows the tgid. The /proc table also > shows the tgid. You can see all of the pids associated with a process > by looking at /proc/999/task/888 > > Replace 999 with tthe tgid and 888 with the pid. > > ls -1 -d /proc/*/task/* > > will show all of the threads running in the system > > ls -1 -d /proc/* > > will show all of the processes running in the system (which is what ps > shows). > > Thank you. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20110524/03740b20/attachment.html