Date: Wed, 25 Jan 2006 10:02:28 -0300 From: Fernan Aguero <fernan@iib.unsam.edu.ar> To: Brooks Davis <brooks@one-eyed-alien.net> Cc: Rainer Alves <rainer.alves@gmail.com>, freebsd-ports@freebsd.org Subject: Re: porting an app that checks /proc/meminfo Message-ID: <20060125130228.GA79842@iib.unsam.edu.ar> In-Reply-To: <20060125020259.GB5928@odin.ac.hmc.edu> References: <20060124172317.GF72149@iib.unsam.edu.ar> <43D66A69.4010005@gmail.com> <20060125020259.GB5928@odin.ac.hmc.edu>
next in thread | previous in thread | raw e-mail | index | archive | help
+----[ Brooks Davis <brooks@one-eyed-alien.net> (24.Jan.2006 23:06): | | On Tue, Jan 24, 2006 at 03:56:57PM -0200, Rainer Alves wrote: | > Fernan Aguero wrote: | > >The program builds fine, but because it uses /proc/meminfo | > >to check for available memory, when you run it, it will | > >complain about the lack of /proc/meminfo and won't let you | > >do anything. | > > | > ... | > >How does one gets the values of i) memory used by the | > >program/process and ii) amount of RAM available in the | > >computer without using /proc/meminfo in FreeBSD? | > | > Take a loot at sysutils/muse, which uses /dev/mem to gather this info: | | Please don't do this. Really! There's no point in gratuitously | groveling around in the kernel's live memory image to get data you have | access to via unprivileged calls. | +----] Brooks, what are these unprivileged calls? can you list a few so we can check the corresponding man pages? Are they BSD specific? Again I'm not versed in C so what follows is just what I could grasp from a few google searches. It seems like in linux you can also use unprivileged calls to get this info, but you have also the option of using the /proc filesystem. I don't know what are these unprivileged calls like in linux ... but perhaps they are pretty standard across systems? I'm not positive about this but I just have the impression that there should be a generic (not linux-specific or BSD specific) way to get this info, like a generic call that has the same name and similar arguments across different OS (of course the internal implementation should be different in each OS) ... does such thing exist? Fernan
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060125130228.GA79842>