1 #ifndef __JSYSTEM__JSYSINFO__
2 #define __JSYSTEM__JSYSINFO__
5 #include <sys/sysinfo.h>
7 #include <sys/sysctl.h>
16 unsigned long totalram;
17 unsigned long freeram;
18 unsigned int mem_unit{1};
39 #if !defined(__APPLE__)
45 ::sysinfo(
static_cast<sysinfo*
>(
this));
49 unsigned long totalram;
50 size_t len=
sizeof(totalram);
51 sysctlbyname(
"hw.memsize",&totalram,&len,NULL,0);
52 this->totalram = totalram;
66 return (
unsigned long long int) this->totalram * (
unsigned long long int) this->mem_unit;
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Auxiliary classes and methods for operating system calls.
Auxiliary class for system information.
unsigned long long int getTotalRAM() const
Get total RAM.
JSysinfo()
Default constructor.