How to discover current SYSV IPC status under Solaris 5.3

How to discover current SYSV IPC status under Solaris 5.3

Post by Michael Bernste » Sat, 15 Oct 1994 08:54:05



Basically, I want a C/C++ interface to the same functionality as the ipcs(1)
command.  IE, I want to know how many SYSV shared memory segments, message
queues, and semaphores are currently allocated, and what their respective
identifiers are.

I have not been able to find a way to do this from the Solaris (2.3) manual
pages, Answerbook, or Richard Stevens' book _Advanced Programming in the
UNIX Environment_, or any of the other literature I have available to me.

I have done a truss(1) of several executions of ipcs.  It appears to load
several shared libraries (libkvm.so, libelf.so, libdl.so) and then proceeds
to grope through /dev/ksyms, /dev/kmem, and /dev/mem.  I don't really want
to try and infer the symbols from the read() calls it makes.

Can anyone offer any hints or pointers?

Thank you.

Michael


Confucius said, "Once I went all day without food and all night without
sleep, just to think.  It was no use.  It's better to study"
        -- ANALECTS (15:31)