LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   getting memory from other program (http://www.linuxquestions.org/questions/programming-9/getting-memory-from-other-program-293764/)

coredump2005 02-23-2005 04:23 AM

getting memory from other program
 
Hi all!

Is it possible to read from a other process memory? I want to use a stl::map in more than one program at the same time, i only need to read from the map. What are my options to get this work?

Thank you in advance!
Greetings Mario

Mara 02-23-2005 05:33 AM

You can only when the memory is shared. Start from reading manual page of shmget (there are pointers inside to other functions needed). If you have not used it before I'd recomend a read about system fynctions, however.

coredump2005 02-23-2005 07:19 AM

Thanks for your reply. I know the shared memory functions but to implement them into a stl allocator is very difficult. I hoped there was an other solution to read the memroy of an other process...

Mara 02-23-2005 02:38 PM

Nope..You'd require something build in the STL. As far as I know such thing does not exist.

Matir 02-23-2005 02:49 PM

You *MIGHT* be able to do it if the reading process runs as root. But I think the Linux Virtual Memory management system would prevent that. (In fact, the address would not line up because the addresses are in a per-process virtual space). SHM is likely your only option. Alternatively, to move data around, UNIX sockets.


All times are GMT -5. The time now is 01:46 AM.