Wireless Access

 View Only

Shared Memory shmat Read Only -> Write Mode

This thread has been viewed 1 times
  • 1.  Shared Memory shmat Read Only -> Write Mode

    Posted May 04, 2004 03:32 AM
    Hi,
    Is there is any way to change the address attached as "Read only" (SHM_RDONLY) to write enabled without "detaching" in same process.

    For example,
    Process P1()
    {
    addr1 = shmat(id1,0,SHM_RDONLY);
    //addr1 is being used by another process
    function(addr1);
    shmdt(addr1)
    addr2=shmat(id1,0,0);
    //Modifies data of shared memory id1,
    addr2. data = XXX
    }

    function(addr1)
    {
    //addr1 is used down the line
    }

    Can above be done without detaching the address "addr1" , so that I can get another address("addr2") within same process which is write enabled.

    Thanks in Advance.

    Regards,
    Srinivasan S