Solved

system call -rusage

Posted on 2009-05-07
2
259 Views
Last Modified: 2012-05-06
hi,

could anyone pls help?i am using getrusage to get the max memory use and it is returning o..
this is the code:

      struct rusage usage;
      getrusage (RUSAGE_SELF, &usage);
      fprintf(stderr,"Memory Usage : %ld",usage.ru_maxrss);
thanks a miilion.
0
Comment
Question by:zizi21
2 Comments
 
LVL 40

Accepted Solution

by:
mrjoltcola earned 500 total points
ID: 24332486
ru_maxrss and other members are not implemented on Linux.

From the man page:

      The above struct was taken from 4.3BSD Reno.  Not all fields are meaningful under Linux.  In linux 2.4 only the
       fields  ru_utime,  ru_stime,  ru_minflt, and ru_majflt are maintained.  Since Linux 2.6, ru_nvcsw and ru_nivcsw
       are also maintained.
0
 

Author Closing Comment

by:zizi21
ID: 31579282
Thanks a million
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

This tutorial is posted by Aaron Wojnowski, administrator at SDKExpert.net.  To view more iPhone tutorials, visit www.sdkexpert.net. This is a very simple tutorial on finding the user's current location easily. In this tutorial, you will learn ho…
Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode (http://en.wikipedia.org/wiki/Unicode)? They will have you believe that Unicode requires you to use…
The goal of this video is to provide viewers with basic examples to understand how to use strings and some functions related to them in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use while-loops in the C programming language.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now