Hi Matías,

Matías Aguirre wrote:
a little question, is there any way to get a process current children count?

Yes, there is. But I can only think in a 'brute force' way: you can scan the
/proc file-system.

Let's say you want to know how many children the X process has. You open
each '/proc/PID/status' and read the 'Ppid' field. If it's equals X, you
count it.

As I said, it's ugly, but I cannot think in another solution.

You can try to read the code of 'pstree' program, but I guess it
scans the /proc file-system too.

-
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" 
in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to