If I search for counting the number of threads an application has, all the answers involve external programs like top. I want to count the threads within the ap
Use top -H. But chances are, if you can't read proc, top won't work anyway. If thats the case, there is no easy way and it would depend on your specific system.