Unix Technical Forum

get all shared memory segments

This is a discussion on get all shared memory segments within the AIX Operating System forums, part of the Unix Operating Systems category; --> Hello, how can i get all shared memory segments on aix5 using c++? I can use shmget(),shmat(),shmdt() and other ...


Go Back   Unix Technical Forum > Unix Operating Systems > AIX Operating System

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-05-2008, 12:00 PM
upsa
 
Posts: n/a
Default get all shared memory segments

Hello,

how can i get all shared memory segments on aix5 using c++?

I can use shmget(),shmat(),shmdt() and other functions only if i know
shmid of shared memory. But i can't get list of shmid for all shared
memory segments in system.


Thanks.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 01-05-2008, 12:00 PM
=?UTF-8?B?TMWRcmluY3p5IFpzaWdtb25k?=
 
Posts: n/a
Default Re: get all shared memory segments

upsa wrote:
> Hello,
>
> how can i get all shared memory segments on aix5 using c++?
>
> I can use shmget(),shmat(),shmdt() and other functions only if i know
> shmid of shared memory. But i can't get list of shmid for all shared
> memory segments in system.


Do AIX have command ipcs(8) like linux? If so use command "ipcs -m".
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 01-05-2008, 12:00 PM
0xDEADABE
 
Posts: n/a
Default Re: get all shared memory segments

Lőrinczy Zsigmond wrote:
> upsa wrote:
>> Hello,
>>
>> how can i get all shared memory segments on aix5 using c++?
>>
>> I can use shmget(),shmat(),shmdt() and other functions only if i know
>> shmid of shared memory. But i can't get list of shmid for all shared
>> memory segments in system.

>
> Do AIX have command ipcs(8) like linux? If so use command "ipcs -m".


It does. "ipcs -m" will work.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 01-05-2008, 12:00 PM
upsa
 
Posts: n/a
Default Re: get all shared memory segments


0xDEADABE wrote:
> Lőrinczy Zsigmond wrote:
> > upsa wrote:
> >> Hello,
> >>
> >> how can i get all shared memory segments on aix5 using c++?
> >>
> >> I can use shmget(),shmat(),shmdt() and other functions only if i know
> >> shmid of shared memory. But i can't get list of shmid for all shared
> >> memory segments in system.

> >
> > Do AIX have command ipcs(8) like linux? If so use command "ipcs -m".

>
> It does. "ipcs -m" will work.


I'm sorry, guys. I need to get shared memory segments by using c\c++
language. So, i need to know which functions i should use to get list
of all shared memory segments in AIX system.

Thanks.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 01-05-2008, 12:01 PM
rajbir
 
Posts: n/a
Default Re: get all shared memory segments

My apologies that I can't give you a straight forward answer. I never
employed too much shared memory in my codes. But I can tell you how to
find out what you need to know.. do an 'nm' or 'dump -Tv' on the ipcs
command. That will tell you all the library functions ipcs calls, all
the system calls ipcs does. Then read publib on those calls and you
should be able to find your way out.

Thanks and regards,
Rajbir Bhattacharjee

upsa wrote:
> 0xDEADABE wrote:
> > Lőrinczy Zsigmond wrote:
> > > upsa wrote:
> > >> Hello,
> > >>
> > >> how can i get all shared memory segments on aix5 using c++?
> > >>
> > >> I can use shmget(),shmat(),shmdt() and other functions only if i know
> > >> shmid of shared memory. But i can't get list of shmid for all shared
> > >> memory segments in system.
> > >
> > > Do AIX have command ipcs(8) like linux? If so use command "ipcs -m".

> >
> > It does. "ipcs -m" will work.

>
> I'm sorry, guys. I need to get shared memory segments by using c\c++
> language. So, i need to know which functions i should use to get list
> of all shared memory segments in AIX system.
>
> Thanks.


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 01-05-2008, 12:01 PM
rajbir
 
Posts: n/a
Default Re: get all shared memory segments

My VPN is down. I can't connect to my pet AIX machines. I'll find out
the necessary calls tomorrow and let you know...

Thanks and regards,
Rajbir Bhattacharjee

rajbir wrote:
> My apologies that I can't give you a straight forward answer. I never
> employed too much shared memory in my codes. But I can tell you how to
> find out what you need to know.. do an 'nm' or 'dump -Tv' on the ipcs
> command. That will tell you all the library functions ipcs calls, all
> the system calls ipcs does. Then read publib on those calls and you
> should be able to find your way out.
>
> Thanks and regards,
> Rajbir Bhattacharjee
>
> upsa wrote:
> > 0xDEADABE wrote:
> > > Lőrinczy Zsigmond wrote:
> > > > upsa wrote:
> > > >> Hello,
> > > >>
> > > >> how can i get all shared memory segments on aix5 using c++?
> > > >>
> > > >> I can use shmget(),shmat(),shmdt() and other functions only if i know
> > > >> shmid of shared memory. But i can't get list of shmid for all shared
> > > >> memory segments in system.
> > > >
> > > > Do AIX have command ipcs(8) like linux? If so use command "ipcs -m".
> > >
> > > It does. "ipcs -m" will work.

> >
> > I'm sorry, guys. I need to get shared memory segments by using c\c++
> > language. So, i need to know which functions i should use to get list
> > of all shared memory segments in AIX system.
> >
> > Thanks.


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 01-05-2008, 12:01 PM
=?UTF-8?B?TMWRcmluY3p5IFpzaWdtb25k?=
 
Posts: n/a
Default Re: get all shared memory segments

upsa wrote:

>>It does. "ipcs -m" will work.

>
>
> I'm sorry, guys. I need to get shared memory segments by using c\c++
> language. So, i need to know which functions i should use to get list
> of all shared memory segments in AIX system.


There might be some non-standard and non-documented way to acchive this
(perhaps via special files of /proc), but the usual and portable way
is calling popen ("ipcs -m", "r");
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 01-05-2008, 12:01 PM
upsa
 
Posts: n/a
Default Re: get all shared memory segments


Lorinczy Zsigmond wrote:
> upsa wrote:
>
> >>It does. "ipcs -m" will work.

> >
> >
> > I'm sorry, guys. I need to get shared memory segments by using c\c++
> > language. So, i need to know which functions i should use to get list
> > of all shared memory segments in AIX system.

>
> There might be some non-standard and non-documented way to acchive this
> (perhaps via special files of /proc), but the usual and portable way
> is calling popen ("ipcs -m", "r");



Thank you and rajbir for answers. I investigated ipcs early and found
that it uses /dev/mem interface. On linux and hp-ux system i found how
to get list of shared memory segments using api calls. So, i thinked
that i can do the same thing on aix but it's not so. Probably using
popen() will be the best way.

Thanks.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 07:09 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com