Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

system call -rusage

Posted on 2009-05-07
2
Medium Priority
?
275 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 2000 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Summary: This tutorial covers some basics of pointer, pointer arithmetic and function pointer. What is a pointer: A pointer is a variable which holds an address. This address might be address of another variable/address of devices/address of fu…
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.
The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.
Suggested Courses

926 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