Thread: Destroy a shared memory segment

  1. #1
    Registered User
    Join Date
    Dec 2006
    Posts
    85

    Destroy a shared memory segment

    Good morning,

    I want to destroy a shared memory segment and i would like to tell me how i can do it by typing it in a shell Unix type tcsh.

    i use this command but it doen't work

    ipcs -m | grep user_login_name | ruby -ne 'puts $_.split(" ")[1]' | xargs ipcrm -m

    What do i do wrong?

    Thanks, in advance

  2. #2
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Well one of the things you did wrong was to post this post on the C board, since it has nothing to do with C, considering you just want some random command line crap to do it for you.


    Quzah.
    Hope is the first step on the road to disappointment.

  3. #3
    Registered User
    Join Date
    Nov 2006
    Posts
    176
    man ipcrm

  4. #4
    Registered User
    Join Date
    Dec 2006
    Posts
    85
    Well ipcrm takes many arguments after it.

    When i do

    ipcs -m | grep user_login_name | ruby -ne 'puts $_.split(" ")[1]' | xargs ipcrm -m 12

    12(is a shmid)

    i get

    usage: ipcrm [ [-q msqid] [-m shmid] [-s semid]
    [-Q msgkey] [-M shmkey] [-S semkey] ... ]

    What do i do wrong? Of course i have replaced the field user name with my user name but i dunno if i have placed the id of the shared memory in the correct field.

  5. #5
    Registered User
    Join Date
    Nov 2006
    Posts
    176
    hence why I said to man ipcrm

    ipcrm -m1 -m2 -m3

    take a look at what that does. It should show you how to fix it

    this really isn't the board for this as quzah said...so hopefully that helps you fix it, otherwise maybe a board specific to your OS would be better. Since I remember linux and solaris for example having different ipcrm

    and really, if your doing what it looks like your trying, you probably shouldn't....who knows what program has set up a shared memory segment that your going to remove
    Last edited by sl4nted; 12-03-2006 at 12:32 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Share segment
    By ch4 in forum C Programming
    Replies: 7
    Last Post: 12-30-2008, 02:19 AM
  2. RE: client/server shared memory problem
    By hampycalc in forum C Programming
    Replies: 0
    Last Post: 03-10-2006, 02:26 PM
  3. shared memory can not read value over 255
    By jbsloan in forum C Programming
    Replies: 4
    Last Post: 04-03-2005, 11:56 AM
  4. pointers
    By InvariantLoop in forum C Programming
    Replies: 13
    Last Post: 02-04-2005, 09:32 AM
  5. Shared memory in Linux: B-TREE of structures
    By zahid in forum Linux Programming
    Replies: 3
    Last Post: 01-26-2002, 11:15 PM