45 #define BAD_OPEN_MESSAGE \
46 "Error: /proc must be mounted\n" \
47 " To mount /proc at boot you need an /etc/fstab line like:\n" \
48 " proc /proc proc defaults\n" \
49 " In the meantime, run \"mount proc /proc -t proc\"\n"
51 #define STAT_FILE "/proc/stat"
53 #define UPTIME_FILE "/proc/uptime"
55 #define LOADAVG_FILE "/proc/loadavg"
57 #define MEMINFO_FILE "/proc/meminfo"
59 #define VMINFO_FILE "/proc/vmstat"
64 static char buf[2048];
70 #define FILE_TO_BUF(filename, fd) do { \
72 if (fd == -1 && (fd = open (filename, O_RDONLY)) == -1) { \
73 fputs (BAD_OPEN_MESSAGE, stderr); \
77 lseek (fd, 0L, SEEK_SET); \
78 if ((local_n = read (fd, buf, sizeof buf - 1)) < 0) { \
83 buf[local_n] = '\0'; \
249 if (strlen (
head) >=
sizeof(namebuf))
254 strcpy (namebuf,
head);
255 found = bsearch (&findme, mem_table, mem_table_count,
261 *(found->
slot) = (
unsigned long) strtoull (
head, &
tail, 10);
static struct PendingResolutions * tail
Tail of list of pending resolution requests.
static struct PendingResolutions * head
Head of list of pending resolution requests.
static unsigned long kb_swap_reclaimable
unsigned long kb_low_free
static int compare_mem_table_structs(const void *a, const void *b)
static unsigned long kb_vmalloc_used
unsigned long kb_main_buffers
static unsigned long kb_vmalloc_total
static unsigned long kb_swap_unreclaimable
unsigned long kb_main_used
static unsigned long kb_nfs_unstable
unsigned long nr_reversemaps
unsigned long kb_inactive
static unsigned long kb_bounce
static unsigned long kb_anon_pages
unsigned long kb_pagetables
unsigned long kb_swap_total
static unsigned long kb_commit_limit
unsigned long kb_committed_as
static unsigned long kb_vmalloc_chunk
#define FILE_TO_BUF(filename, fd)
unsigned long kb_writeback
unsigned long kb_inact_clean
unsigned long kb_low_total
unsigned long kb_swap_used
unsigned long kb_inact_target
unsigned long kb_inact_laundry
unsigned long kb_main_total
unsigned long kb_main_cached
unsigned long kb_main_free
unsigned long kb_swap_free
unsigned long kb_main_shared
unsigned long kb_high_total
unsigned long kb_high_free
struct mem_table_struct mem_table_struct
unsigned long kb_inact_dirty
unsigned long kb_swap_cached