Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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

2 Answers 2

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

 
discard

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.