lkml.org 
[lkml]   [2001]   [Mar]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Q: How to get physical memory size from user space without proc fs


On 3 Mar 2001, Michael Rothwell wrote:

> pyhsmem = `free | grep Mem | tr -s "/ / /" | cut -f2 -d" "`

% strace free 2>&1 |grep /proc
open("/proc/cpuinfo", O_RDONLY) = 3
open("/proc/uptime", O_RDONLY) = 3
open("/proc/stat", O_RDONLY) = 4
open("/proc/meminfo", O_RDONLY) = 5

I.e. it still uses procfs. Which is perfectly fine, just encapsulate
it in initscripts so that information would be obtained when system
is booted. Should work for people who don't want procfs around after
that.
Cheers,
Al

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:29    [W:0.089 / U:1.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site