test how much mem the operating system has free in C
with GNU CC how do i test how much memory is free to the entire operating system ?
old turbo C++ has coreleft() but GCC does not have it |
sysinfo() can do that:
Code:
#include <sys/sysinfo.h> Code:
man sysinfo |
need cross platform
|
Quote:
as verdeboy2k said, and i agree with, i dont think there is a cross-platform GNU C API to do this, as it relies heavily on the OS. |
how about a library?
|
there are a number of ways to do it in linux, one of them mentioned above, and a simple search will give you the windows API to do it. i dont know of any library that wraps them all to make it seem cross-platform
|
ok then, i will write a library
one question is -- what windows API will give you the same info |
regarding the library, a search gave a forum which referenced this: http://code.google.com/p/geekinfo/. the description seems to be what you want, though i didnt look at any other details.
i dont remember the exact windows API one (im sure after some searching MSDN you will find it), but a good starting point is here: http://msdn.microsoft.com/en-us/libr...8VS.85%29.aspx |
All times are GMT -5. The time now is 03:34 AM. |