26 lines
891 B
C
26 lines
891 B
C
//---------------------------------------------------------------------------//
|
|
// 1100101 |_ mov #0, r4 __ //
|
|
// 11 |_ <0xb380 %5c4> / _|_ _____ ___ //
|
|
// 0110 |_ 3.50 -> 3.60 | _\ \ / _ (_-< //
|
|
// |_ base# + offset |_| /_\_\___/__/ //
|
|
//---------------------------------------------------------------------------//
|
|
// fxos/util/system: System-specific functions
|
|
|
|
#ifndef FXOS_UTIL_SYSTEM_H
|
|
#define FXOS_UTIL_SYSTEM_H
|
|
|
|
#include <unistd.h>
|
|
|
|
static inline long systemGetCurrentRSS()
|
|
{
|
|
FILE *fp = fopen("/proc/self/statm", "r");
|
|
if(!fp)
|
|
return 0;
|
|
long rss = 0;
|
|
int rc = fscanf(fp, "%*s %ld", &rss);
|
|
fclose(fp);
|
|
return (rc == 1) ? rss * sysconf(_SC_PAGESIZE) : 0;
|
|
}
|
|
|
|
#endif /* FXOS_UTIL_SYSTEM_H */
|