C
chris.tice
Hi,
I am looking for an easy way to find the total number of running
processes on a given machine in a C program. Currently I am doing
this:
system("ps -e | wc -l > count.txt");
then reading the number back into the program from the text file. I
was wondering if there was a function call that would do this (ie. int
count = get_process_count()) rather than perform this hackish
workaround.
Thanks for any help!
- Chris
I am looking for an easy way to find the total number of running
processes on a given machine in a C program. Currently I am doing
this:
system("ps -e | wc -l > count.txt");
then reading the number back into the program from the text file. I
was wondering if there was a function call that would do this (ie. int
count = get_process_count()) rather than perform this hackish
workaround.
Thanks for any help!
- Chris