[comp.unix.internals] message queue structure in SUN OS 4.1

coleman@cam.nist.gov (Sean Sheridan Coleman X5672) (01/13/91)

I have been trying to get ahold of the kernal's representation
of the msqid_ds structure that stores information about the 
IPC message queue. I couldn't find it after trying many  
names provided from nm /vmunix.

My Sparc Station 1+ is running SUNOS 4.1.1. I wrote a small 
program to try and find the structure so I could read it and
look at the structure. Here is a extracted version I used.:

struct nlist nl[] =
{
	{_msgque},
	{0}
}

main()
{
	stuct msqid_ds msgque;
	kd = kvm_open( { arguments})
	kvm_nlist(kd,nl)
	kvm_read(kd,nl[0].n_value,&msgque,sizeof(struct msqid_ds))
}

Please note that I didn't worry about syntax or proper
positioning of the arguments, since saber-c didn't complain and
I did get some data but, unfortuantly, the data shown in  msgque
didn't make sense. I tryed the following names I thought might
represent this structure: msg,msgque,msgh, and msgs. None of
them worked. Can some one tell me what is the "magic" name that
I can put in the nl structure so that the data found is msgque 
will be that of the kernals msqid_ds. Could you also give me the
names for semid_ds and shmid_id. 

Your help is greatly appreciated.


Sean Coleman
NIST
Boulder, CO 

coleman@bldrdoc.gov
.