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 @system: 11 12 import core.sys.linux.config; 13 14 // linux/sysinfo.h 15 enum SI_LOAD_SHIFT = 16; 16 17 struct sysinfo_ 18 { 19 c_long uptime; /* Seconds since boot */ 20 c_ulong[3] loads; /* 1, 5, and 15 minute load averages */ 21 c_ulong totalram; /* Total usable main memory size */ 22 c_ulong freeram; /* Available memory size */ 23 c_ulong sharedram; /* Amount of shared memory */ 24 c_ulong bufferram; /* Memory used by buffers */ 25 c_ulong totalswap; /* Total swap space size */ 26 c_ulong freeswap; /* swap space still available */ 27 ushort procs; /* Number of current processes */ 28 ushort pad; /* Explicit padding for m68k */ 29 c_ulong totalhigh; /* Total high memory size */ 30 c_ulong freehigh; /* Available high memory size */ 31 uint mem_unit; /* Memory unit size in bytes */ 32 ubyte[20-2 * c_ulong.sizeof - uint.sizeof] _f; /* Padding: libc5 uses this.. */ 33 } 34 35 36 int sysinfo(sysinfo_ *info); 37 int get_nprocs_conf(); 38 int get_nprocs(); 39 c_long get_phys_pages(); 40 c_long get_avphys_pages(); 41