Writing portable code that reads /dev/kmem

Bjorn Larsen blarsen at spider.uio.no
Thu May 23 14:00:50 AEST 1991


We are writing a daemon that should execute on a number of different
UNIX platforms. It should fetch performance information about the
running system.

We want to make this program as portable as possible, possibly by
dividing it into one generic part and one system-specific part.

The UNIX variants that we want to run this daemon on includes SunOS,
Ultrix, OSF/1, SVR4, SVR3.2, Convex UNIX, SCO UNIX, and possibly
others.

I'm looking for advice on the best way to handle this. Does there
exist a standard interface for retreiving such information?

I've heard rumors that there exists a kmem-access library for BSD4.3.
Would it be feasible to start with this library and port it or
reimplement it on the abovementioned platforms in such a way that the
call interface remains identical on all platforms? If this is the
case, I assume that we would want to use the kmem library routines as
the call interface between the generic and system specific parts of
the deamon, and attempt to make everything above the kmem library
portable.

I'm generally ignorant about this topic; for all I know there might be
inherent differences in the way the different UNIX variants store data
in kmem that makes this approach a dead end. If so, what should we do?


Seeking enlightenment,

Bjorn.Larsen at usit.uio.no                        "Specialization is for insects"
University Centre for Information Technology                     - Lazarus Long
University of Oslo, Norway



More information about the Comp.unix.wizards mailing list