Thread (2 messages) 2 messages, 2 authors, 2012-02-08
  • (off-list ancestor, not in this archive)
  • /proc question · Surenkumar Nihalani <hidden> · 2012-02-08
  • /proc question · Philipp Ittershagen <hidden> · 2012-02-08

/proc question

From: Philipp Ittershagen <hidden>
Date: 2012-02-08 08:31:03

Hello Surenkumar,

On Wed, Feb 8, 2012 at 8:54 AM, Surenkumar Nihalani [off-list ref] wrote:
Hello All,

I am writing a kernel module and I wanted to know which data structure backs
up the /proc/self or how do I get the process id of my call and number of
it's threads from within the kernel?

You can get the process id of the current context using the directive
"current->pid". The macro "current" refers to the current task struct,
so it should also be possible to get the number of threads.


Philipp
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help