library: size two read buffers with manifest constants
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 81f4a6acdf
Signed-off-by: Jim Warner <james.warner@comcast.net>
This commit is contained in:
parent
c8864e8010
commit
70fd03e461
@ -33,6 +33,7 @@
|
|||||||
|
|
||||||
|
|
||||||
#define MEMINFO_FILE "/proc/meminfo"
|
#define MEMINFO_FILE "/proc/meminfo"
|
||||||
|
#define MEMINFO_BUFF 8192
|
||||||
|
|
||||||
|
|
||||||
struct meminfo_data {
|
struct meminfo_data {
|
||||||
@ -606,7 +607,7 @@ static int meminfo_read_failed (
|
|||||||
/* a 'memory history reference' macro for readability,
|
/* a 'memory history reference' macro for readability,
|
||||||
so we can focus the field names ... */
|
so we can focus the field names ... */
|
||||||
#define mHr(f) info->hist.new. f
|
#define mHr(f) info->hist.new. f
|
||||||
char buf[8192];
|
char buf[MEMINFO_BUFF];
|
||||||
char *head, *tail;
|
char *head, *tail;
|
||||||
int size;
|
int size;
|
||||||
unsigned long *valptr;
|
unsigned long *valptr;
|
||||||
|
@ -39,6 +39,7 @@
|
|||||||
|
|
||||||
|
|
||||||
#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 |
|
* Perhaps someday we'll all learn what is in these fields. But |
|
||||||
@ -1067,7 +1068,7 @@ static int vmstat_make_hash_failed (
|
|||||||
static int vmstat_read_failed (
|
static int vmstat_read_failed (
|
||||||
struct vmstat_info *info)
|
struct vmstat_info *info)
|
||||||
{
|
{
|
||||||
char buf[8192];
|
char buf[VMSTAT_BUFF];
|
||||||
char *head, *tail;
|
char *head, *tail;
|
||||||
int size;
|
int size;
|
||||||
unsigned long *valptr;
|
unsigned long *valptr;
|
||||||
|
Loading…
Reference in New Issue
Block a user