We can finally show memory usage in userspace. This could have been done using sysfs, but I'm lazy and don't want to implement that. Maybe in the next release?
14 lines
243 B
C++
14 lines
243 B
C++
#include <bits/errno-return.h>
|
|
#include <sys/memstat.h>
|
|
#include <sys/syscall.h>
|
|
#include <unistd.h>
|
|
|
|
extern "C"
|
|
{
|
|
int memstat(struct membuf* buf)
|
|
{
|
|
long rc = syscall(SYS_memstat, buf);
|
|
__errno_return(rc, int);
|
|
}
|
|
}
|