FreeBSD: How to check how many threads are running in a process by PID?

2k views Asked by At

In Linux I can do this by checking the /proc/pid/status file and looking for a line: Threads: 1 (or any number). How can I achieve the same in FreeBSD? I am not interested in any interactive tool. Is there any C function, or a system file? I have tried BSD's procfs and and linprocfs and I could not find any similair feature there.

1

There are 1 answers

1
Steve Wills On BEST ANSWER

You want:

procstat -t <pid>

This answer is short, but I'm typing more to get the answer up to the minimum length.