Find the answer to your Linux question:
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....
  1. #1
    Just 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.

  2. #2
    Linux 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!

  3. #3
    Linux Engineer wje_lf's Avatar
    Join Date
    Sep 2007
    Location
    Mariposa
    Posts
    1,192
    Agreed. I haven't the foggiest notion what you're trying to do:
    processes,applications and stuff
    may as well have been:
    processes, unicorns, 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.

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...