The meminfo & vmstat file read buffers are now defined
through symbolic constants next to the symbolic names.
[ recent attention to the /proc/stat buffer size led ]
[ to this (hopefully) better approach to definitions ]
Reference(s):
commit
81f4a6acdf204c5c898fa707e285cdbd2389150e
Signed-off-by: Jim Warner <james.warner@comcast.net>
#include <proc/meminfo.h>
-#define MEMINFO_FILE "/proc/meminfo"
+#define MEMINFO_FILE "/proc/meminfo"
+#define MEMINFO_BUFF 8192
struct meminfo_data {
/* a 'memory history reference' macro for readability,
so we can focus the field names ... */
#define mHr(f) info->hist.new. f
- char buf[8192];
+ char buf[MEMINFO_BUFF];
char *head, *tail;
int size;
unsigned long *valptr;
#include <proc/vmstat.h>
-#define VMSTAT_FILE "/proc/vmstat"
+#define VMSTAT_FILE "/proc/vmstat"
+#define VMSTAT_BUFF 8192
/*
* Perhaps someday we'll all learn what is in these fields. But |
static int vmstat_read_failed (
struct vmstat_info *info)
{
- char buf[8192];
+ char buf[VMSTAT_BUFF];
char *head, *tail;
int size;
unsigned long *valptr;