View Single Post

   
  #4 (permalink)  
Old 03-17-2008, 07:04 AM
Don Morris
 
Posts: n/a
Default Re: Getting shm segment id via 'ipcs -m' and struct pst_shminfo

Dennis Handly wrote:
> Alex Vinokur wrote:
>> We can see that shm segment id
>> * via 'ipcs -m'
>> * via struct pst_shminfo
>> is not always the same value.
>> What is a reason for that difference?


Yes, as Dennis's program shows - index and shmid are not
the same thing. ipcs shows shimd, you were printing index.
If you want to match, print the psh_shmid field.

>> Another question.
>> What is the difference between pst_nattch and pst_cnattch in struct
>> pst_shminfo?


psh_nattch vs. psh_cnattach, I think you mean.

The difference is pretty simple -- nattch should be accurate,
cnattach may not be and really shouldn't be used. (Both are there
to provide backwards compatibility when the segment handling changed
to keep nattch more accurate).

There's a comment describing each field in sys/pstat/ipc_pstat_body.h
that you might find useful... or look at the pstat whitepaper:
http://docs.hp.com/en/1216/pstat_whitepaper.pdf

Don

>
> You might be able to see this in my example program in:
> http://forums.itrc.hp.com/service/fo...readId=1136341

Reply With Quote