get all shared memory segments - Aix

This is a discussion on get all shared memory segments - Aix ; 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 ...

+ Reply to Thread
Results 1 to 8 of 8

Thread: get all shared memory segments

  1. 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.


  2. 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".

  3. 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.

  4. 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.


  5. 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.



  6. 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.



  7. 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");

  8. 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.


+ Reply to Thread