is "shared memory" hardcoded to zero in gnome-system-monitor?


I was reading libgtop code and noticed this snippet at sysdeps/linux/mem.c

file_to_buffer(server, buffer, sizeof buffer, FILENAME);

buf->total  = get_scaled(buffer, "MemTotal:");
buf->free   = get_scaled(buffer, "MemFree:");
buf->used   = buf->total - buf->free;
buf->shared = 0;
buf->buffer = get_scaled(buffer, "Buffers:");
buf->cached = get_scaled(buffer, "Cached:");

where FILENAME is /proc/meminfo.

why is buf->shared hardcoded to zero?
Is it intentional or a woops?

"man proc" is pretty vague about the "Shmem" field
of /proc/meminfo (it says "to be documented"),
which seems to be the candidate for filling buf->shared,

but I was suprised to discover that gnome-system-monitor
is wired to a flat constant zero (is it?) when it comes to show
the amount of shared memory.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]