Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Mem shize for a shared mem (shmget)

by vijesh (Novice)
on Dec 11, 2013 at 02:48 UTC ( [id://1066540]=perlquestion: print w/replies, xml ) Need Help??

vijesh has asked for the wisdom of the Perl Monks concerning the following question:

Dear Monks, I use following program to get a shared mem location. How do I know how much size of shared mem is getting allocated? how possible is to release that mem size once I am done. -Thanks, Vijesh

my $id = shmget($key, $size, &IPC_CREAT | 0777 );

Replies are listed 'Best First'.
Re: Mem shize for a shared mem (shmget)
by Anonymous Monk on Dec 11, 2013 at 02:55 UTC
    Hmm, it either allocates how much you ask for, or it fails? What does man shmget say?

      it just returns the shared mem location. Does not say anything about the size. please find some perld

      DB<1> n main::(shm.pl:10): my $id = shmget( $key, $size, &IPC_CREAT | 077 +7 ); DB<1> x shmget( $key, $size, &IPC_CREAT | 0777 ); 0 9142327 DB<2> p $key 90 DB<4> p $size 100 DB<5>
        hello Monks, any help will be appreciated. -Thanks

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1066540]
Approved by boftx
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (3)
As of 2024-04-25 05:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found