0

I want to write a c function , which when called by the process returns number of threads created by that process. I want to get the value not by counting but from the kernel structure ? Which structure has this information ?

1 Answers1

2

You can get a lot of information about your process by looking in /proc/$$ where $$ is your process ID.The number of threads is available atomically through /proc/$$/status.

My solution: You need write a function to analyse the file /proc/$$/status to get the number of threads.

BenMorel
  • 34,448
  • 50
  • 182
  • 322
BlackMamba
  • 10,054
  • 7
  • 44
  • 67