Results 1 to 3 of 3
how do i count messages in C.like processes,applications and stuff.what is the code for that?
please....
- 10-19-2008 #1Just Joined!
- Join Date
- Sep 2008
- Posts
- 11
counting messages
how do i count messages in C.like processes,applications and stuff.what is the code for that?
please.
- 10-19-2008 #2Linux Newbie
- Join Date
- Jan 2008
- Location
- UK
- Posts
- 211
Hi,
I think you will need to be a little clearer on what you are trying to do.
For me you do anyway!
- 10-20-2008 #3
Agreed. I haven't the foggiest notion what you're trying to do:
may as well have been:processes,applications and stuff
But let's assume that you're trying to count the number of processes, and you're coding in C. Set a variable of type long to zero. Then open the directory /proc. Look at every entry in that directory whose name begins with a decimal digit. For each such entry, increase by one the value of the variable I just mentioned above. When you're at the end of the directory, you'll have a count of the number of processes on the system.processes, unicorns, and stuff
I'm guessing that this is not what you want, but this guess might give you a clue as to tell us what you want to do.--
Bill
Old age and treachery will overcome youth and skill.


Reply With Quote