Click here to Skip to main content
15,881,204 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello

I am trying to count the number of processes running in MINIX3. I was using the below piece of code to do this, but realized this returns the value 64 everytime. I doubt this correct, so I would like to know if there is any other way?
C
struct kinfo kinfo;
int nr_tasks, nr_procs;
getsysinfo(PM_PROC_NR, SI_KINFO, &kinfo);
nr_procs = kinfo.nr_procs;
printf("Number of processes: %d", nr_procs);

Thanks.
Posted
Updated 7-Aug-13 4:33am
v2
Comments
Richard MacCutchan 7-Aug-13 8:53am    
Have you checked the documentation to ensure your call is valid for this request?
The_Inventor 7-Aug-13 22:00pm    
Presuming 'kinfo' is your choice of names, but is it some kind of TYPE that is declared elsewhere, like int, string, byte, ?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900