Re: /proc question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Surenkumar,

On Wed, Feb 8, 2012 at 8:54 AM, Surenkumar Nihalani <suren@xxxxxxxxxx> 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

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux