This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Determining Physical and Virtual Memory At Runtime In C


Jonathan Schreiter wrote:

> Thanks for the reply, but I'm looking for a way to
> programmatically determine the memory from inside the
> C program.  I suppose one could execute a shell
> statement and bring that data back in to C, but I'd
> like a simpler approach that does not rely on top.  Am
> I perhaps missing something?

You're asking on the wrong place.  This has nothing to do with gcc
itself.  It is target/platform specific.  On linux you can just open()
the appropriate file under /proc and read the values.  But that is not
going to be very portable.

Brian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]