1

I know ipcs command for linux system, but now I'm looking for ipcs command for solaris, hp-ux and aix system, I have searched lot in websites, almost everyone suggest ipcs -am, ipcs -as or ipcs -a.

While I'm executing ipcs command in linux I got the following output,

cmd > ipcs -lm

------ Shared Memory Limits --------
max number of segments = 4096
max seg size (kbytes) = 32768
max total shared memory (kbytes) = 8388608
min seg size (bytes) = 1

cmd > ipcs -ls

------ Semaphore Limits --------
max number of arrays = 128
max semaphores per array = 250
max semaphores system wide = 32000
max ops per semop call = 32
semaphore max value = 32767

But when I execute this command in aix, solaris and hp-ux I got nearly the following output from all these system:

cmd > ipcs -am

IPC status from /dev/mem as of Wed Aug 12 21:33:15 IST 2015
T        ID     KEY        MODE       OWNER    GROUP  CREATOR   CGROUP NATTCH     SEGSZ  CPID  LPID   ATIME    DTIME    CTIME
Shared Memory:
m   1048576 0xffffffff D-rw------- pconsole   system pconsole   system      1 536870912 5177546 5177546 20:53:54 no-entry 20:53:54
m   1048577 0x78000012 --rw-rw-rw-     root   system     root   system      1 268435456 5112058 3801148 20:53:52 21:30:20 20:53:52
m   1048578 0x7800000c --rw-rw-rw-     root   system     root   system      1  16777216 5112058 3801148 20:53:52 21:30:20 20:53:52
m   1048579 0x61000010 --rw------- pconsole   system pconsole   system      1  10485760 5177546 5177546 20:53:54 no-entry 20:53:54
m 629145605 0xffffffff D-rw-------    kalai  egurkha    kalai  egurkha      1 536870912 9175052 9961658 22:36:08 21:33:06 22:36:08
m  22020103 0x0d02337e --rw-rw----     root   system     root   system      0      1440 7930086 7864444 20:57:46  6:10:14 22:19:05

cmd > ipcs -as

IPC status from /dev/mem as of Wed Aug 12 21:34:01 IST 2015
T        ID     KEY        MODE       OWNER    GROUP  CREATOR   CGROUP NSEMS   OTIME    CTIME
Semaphores:
s         1 0x62023470 --ra-r--r--     root   system     root   system     1 20:53:24 20:53:24
s   3145732 0x0100b38a --ra-ra-ra-     root   system     root   system     2 20:53:52 20:53:52
s   3145733 0xffffffff --ra-------     root   system     root   system     2 no-entry 20:53:52
s         8 0x8100000e --ra------- pconsole   system pconsole   system     4 22:58:27 20:53:54
s         9 0xa1003002 --ra-ra-ra- pconsole   system pconsole   system     2 21:29:28 20:53:56
s        10 0x010232b8 --ra-------     root   system     root   system     1  2:03:46 21:07:18
s        11 0x0101c6e8 --ra-ra-ra-     root    staff     root    staff     1 21:28:42 21:07:44

The problem is I can't able to find the values for following data:

------ Shared Memory Limits --------
max number of segments = ?
max seg size (kbytes) = ?
max total shared memory (kbytes) = ?
min seg size (bytes) = ?

------ Semaphore Limits --------
max number of arrays = ?
max semaphores per array = ?
max semaphores system wide = ?
max ops per semop call = ?
semaphore max value = ?

Please let me know how to find values for the above data or if you have any other solution for my requirements.

Thanks in advance

migrated from stackoverflow.com Aug 12 '15 at 17:09

This question came from our site for professional and enthusiast programmers.

2

I can only speak to AIX.

AIX doesn't have a command that will programatically show the limits.

The closest you'll get for AIX is to use this table and code appropriately.

  • AIX - man shmget may be helpful as well; man semget as well. – Jeff Schaller Aug 13 '15 at 13:00
2

For Solaris 10 and Solaris 11 you can use prctl command. But you must read the manual as this is quite complicated when using zones and/or projects.

as an example for Solaris 11 for the current running global zone.

prctl $$
project.max-shm-memory
        privileged      40.3GB      -   deny                                 -
        system          16.0EB    max   deny                                 -
project.max-shm-ids
        privileged        128       -   deny                                 -
        system          16.8M     max   deny                                 -
--
zone.max-shm-memory
        usage               0B
        system          16.0EB    max   deny                                 -
zone.max-shm-ids
        usage               0
        system          16.8M     max   deny   

                          -

The above tells me that my global zone does not have any limit for the shared memory or semaphore ids.

# prctl $$| ggrep -A2 shm
project.max-shm-memory
        privileged      1.96GB      -   deny                                 -
        system          16.0EB    max   deny                                 -
project.max-shm-ids
        privileged        128       -   deny                                 -
        system          16.8M     max   deny                                 -
--
zone.max-shm-memory
        usage           1.89GB
        privileged      6.40GB      -   deny                                 -
--
zone.max-shm-ids
        usage               3
        system          16.8M     max   deny      

                       -

This second output tells me that my non-global zone is limited to 6.4GB of shared memory and used is close to 2GB. For a list of resource controls you can see them here. For Solaris 10 it isn't much different, but you need to check the documentation.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy