getrusage returns zeros

getrusage returns zeros

Post by Harald Finste » Sat, 09 Sep 2000 16:20:47



Hello,

the following seems to be a FAQ, but (I have been searching with deja)
a NAQ (Never Answered Question :-)

I try to track down a memory leak problem using 'getrusage',
which seems to be executed correctly (no error returned).

The following sample program:

=== BEGIN testgetrusage.cpp ===

#include <sys/resource.h>
#include <iostream>

int main() {
  struct rusage u;

  cerr << "rusage-state = " << getrusage ( RUSAGE_SELF, &u) << endl;

  cerr << "ru_ixrss     = " << u.ru_ixrss << endl;
  cerr << "ru_idrss     = " << u.ru_idrss << endl;
  cerr << "ru_isrss     = " << u.ru_isrss << endl;

  return 0;

Quote:}

===  END  testgetrusage.cpp ===

compiled with

cxx testgetrusage.cpp -o testgetrusage

results in the following output:

rusage-state = 0
ru_ixrss     = 0
ru_idrss     = 0
ru_isrss     = 0        

Looks like a very efficient (zero memory consuming) program :-)

The OS is Digital UNIX V4.0F  (Rev. 1229); Wed Nov 10 10:56:11 GMT 1999      
The compiler is Compaq C++ V6.2-024 for Digital UNIX V4.0F  (Rev. 1229)      

Thanks a lot for any hint

Harald

--

Harald Finster
-
Windoze can be used on the North-Pole without any problems,
... because a frozen computer can't freeze

 
 
 

1. Floppy reports size as zero sectors, zero tracks, zero bytes

My 3-1/2" floppy drive has stopped responding properly to requests for
its geometry.  The low-level "fdformat" utility will query the hardware,
find out that the disk has zero sectors and zero tracks, and exit (it
seems to think its work is done).  The drive doesn't show any other
problems: I can put filesystems on the floppies and mount them, and I can
splat kernels directly onto the media with "dd".  I can even do a
low-level format with "superformat" (which doesn't seem to ask for the
geometry).  The sector/track error is only an issue with "fdformat" and
with Mach---Mach always wants to check the geometry before mounting the
floppy disk.

I'm trying to figure out what is causing the problem.  In the past, the
floppy drive worked fine.  Unfortunately, I can't tell when the problem
occurred; I don't do low-level formats that often.  I can think of three
possibilities:

 1. My 1992 floppy drive has had a hardware failure, or is simply
    incompatible with modern hardware.  (It moved from B: to A: a while
    back, but I doubt that's the problem).
 2. My PCI motherboard's built-in floppy controller is buggy.  It's an
    Intel Zappa ED, with the Triton 82430FX chipset.  It's fairly recent.
 3. The Linux floppy driver (which Mach is using) is incompatible with
    one of the two pieces of hardware.

Does anyone have suggestions on how to proceed?  Thanks.

Derek

--
Derek Upham

"Ha!  Your Leaping Tiger Kung Fu is no match for my Frightened Piglet style!"

2. mounting floppy

3. does getrusage() return physical I/O stats?

4. redirect of http services

5. recv() returns zero, but connection is alive?

6. I'm confused with ipchains/iptables on Redhat 7.2

7. Makedev returns non-zero value

8. Broken SB patches question

9. sbrk(0) is returning zero on a 386 --- what gives?

10. 'edquota' failing because vi returns a non-zero code?

11. gprof returning zero values

12. clock() function returns zero?

13. accept() returns zero?