Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to get shared memory information from a linux box. I'm looking for shmmax, shmmni, shmall, msgmax, msgmni, semmsl, semmns etc. How to get all those values from a Perl script. any help is appreciated?

share|improve this question
I don't see anything relevant on CPAN. IPC::Shareable doesn't provide access to these settings. Perhaps @poige's answer is the easiest way. – Mischa Arefiev Apr 9 '12 at 11:27

Would sysctl -a|fgrep shm or ipcs -l satisfy your knowledge appetite as starting points?

share|improve this answer

Using Tie::Sysctl, you could probably (I didn't test it) use something along

use Tie::Sysctl;

tie %t, 'Tie::Sysctl';
print "shmmax: ".$t{kernel}{shmmax};

etc, mildly sugaring plain /proc/sys reads.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.