1 /** 2 * D header file for GNU/Linux. 3 * 4 * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost License 1.0) 5 * Authors: Martin Nowak 6 */ 7 module core.sys.linux.sys.sysinfo; 8 9 version (linux) extern(C) @nogc nothrow: 10 11 import core.sys.linux.config; 12 13 // linux/sysinfo.h 14 enum SI_LOAD_SHIFT = 16; 15 16 struct sysinfo_ 17 { 18 c_long uptime; /* Seconds since boot */ 19 c_ulong[3] loads; /* 1, 5, and 15 minute load averages */ 20 c_ulong totalram; /* Total usable main memory size */ 21 c_ulong freeram; /* Available memory size */ 22 c_ulong sharedram; /* Amount of shared memory */ 23 c_ulong bufferram; /* Memory used by buffers */ 24 c_ulong totalswap; /* Total swap space size */ 25 c_ulong freeswap; /* swap space still available */ 26 ushort procs; /* Number of current processes */ 27 ushort pad; /* Explicit padding for m68k */ 28 c_ulong totalhigh; /* Total high memory size */ 29 c_ulong freehigh; /* Available high memory size */ 30 uint mem_unit; /* Memory unit size in bytes */ 31 ubyte[20-2 * c_ulong.sizeof - uint.sizeof] _f; /* Padding: libc5 uses this.. */ 32 } 33 34 35 int sysinfo(sysinfo_ *info); 36 int get_nprocs_conf(); 37 int get_nprocs(); 38 c_long get_phys_pages(); 39 c_long get_avphys_pages(); 40