check if the memory is low, from Windows to Unix



Hi all,

How to implement such function for Linux/Unix?

/* sample begins*/
#include "windows.h"
....
MEMORYSTATUS stat;
GlobalMemoryStatus(&stat);
result = ((float)stat.dwAvailPageFile / stat.dwTotalPageFile) < 0.1;
....

if (result)
trigger_low_mem_info();

....
/* sample ends */

Thanks!
Kevin

.