christophe barbe on Wed, 6 Nov 2002 08:50:04 -0500


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

[PLUG] BSD total free memory in C ?


Hi,

libgphoto2 is a library to access (and more) digital camera content.

   http://gphoto.sourceforge.net/

This library has an internal filesystem that features data caching.
Because today cameras can have more than 512MB of memory, it makes sense
to limit the size of this cache. For linux I have implemented an
algorithm that delete old cached data when the total free memory becomes
low. To get the total (including free swap) free memory I read /proc/meminfo. 
I have no knowledge of BSD but IIRC there is no proc filesystem. 

What would be the BSD way to get the quantity of free memory?

Ideas and of course C code welcome.

Christophe

-- 
Christophe Barbé <christophe.barbe@ufies.org>
GnuPG FingerPrint: E0F6 FADF 2A5C F072 6AF8  F67A 8F45 2F1E D72C B41E

L'experience, c'est une connerie par jour mais jamais la même.
_________________________________________________________________________
Philadelphia Linux Users Group        --       http://www.phillylinux.org
Announcements - http://lists.netisland.net/mailman/listinfo/plug-announce
General Discussion  --   http://lists.netisland.net/mailman/listinfo/plug