Resizing the shared memory

Hi,
I have a problem with the shared memory resizing. I am not sure whether it
can be resized by another process. Please share your views/opinions about
the resizing.

I have a process A which creates the shared memory of some size with
read/write mode and MAP_SHARED flags. Process A creates the shared memory
and writes some data and exits. (I am not unmapping the shared memory).
Process B maps this shared memory into its address space. I have a
requirement that Process B should resize the shared memory at runtime.

I found that process B can resize the shared memory with the ftruncate
function. But the problem I am facing is if the process B is stopped and
respawned again the resized portion of the shared memory is no more
accessible. Process B is a kind of data editor application which will be
started based upon the requirement.

I would be grateful for any help offered .

thanks in advance.


Best regards,
raj korem

Take a look at shm_ctl() to resize a shared memory object.


Cheers,
Adam

QNX Software Systems Ltd.
[ amallory@qnx.com ]

With a PC, I always felt limited by the software available.
On Unix, I am limited only by my knowledge.
–Peter J. Schoenster <pschon@baste.magibox.net>
“Raj Korem” <rkorem@datac-technologies.com> wrote in message
news:a2l45l$ka7$1@inn.qnx.com

Hi,
I have a problem with the shared memory resizing. I am not sure whether it
can be resized by another process. Please share your views/opinions about
the resizing.

I have a process A which creates the shared memory of some size with
read/write mode and MAP_SHARED flags. Process A creates the shared memory
and writes some data and exits. (I am not unmapping the shared memory).
Process B maps this shared memory into its address space. I have a
requirement that Process B should resize the shared memory at runtime.

I found that process B can resize the shared memory with the ftruncate
function. But the problem I am facing is if the process B is stopped and
respawned again the resized portion of the shared memory is no more
accessible. Process B is a kind of data editor application which will be
started based upon the requirement.

I would be grateful for any help offered .

thanks in advance.


Best regards,
raj korem

\