porting an app that checks /proc/meminfo

Jeremy Chadwick freebsd at jdc.parodius.com
Wed Jan 25 08:11:07 PST 2006


> way of getting these values? As I wrote in my reply to
> Brooks, perhaps some call that, although implemented
> differently in each OS, will have the same API for a
> programmer. So s/he can use it across different Unix OSes?

The only way I know of is to use a pre-existing library called
libstatgrab.  The author has already written the code you want; and
yes, it's done how you think (re: "the awful way"); most of the
pain is relieved via the use of configure.  libstatgrab works on
the following platforms:

Cygwin
DragonFly BSD 1.x
FreeBSD 4.x
FreeBSD 5.x
FreeBSD 6.x
HP-UX 11.11 (parisc)
Linux 2.2
Linux 2.4
Linux 2.6
NetBSD 1.x
NetBSD 2.x
OpenBSD 3.x
Solaris 6
Solaris 7
Solaris 8 (sparc & x86)
Solaris 9 (sparc & x86)
Solaris 10 (sparc)

http://www.i-scream.org/libstatgrab/

-- 
| Jeremy Chadwick                                 jdc at parodius.com |
| Parodius Networking                        http://www.parodius.com/ |
| UNIX Systems Administrator                   Mountain View, CA, USA |
| Making life hard for others since 1977.                             |



More information about the freebsd-ports mailing list