LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices



Reply
 
Search this Thread
Old 02-23-2005, 05:23 AM   #1
coredump2005
LQ Newbie
 
Registered: Jan 2005
Posts: 2

Rep: Reputation: 0
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
 
Old 02-23-2005, 06:33 AM   #2
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,539

Rep: Reputation: 149Reputation: 149
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.
 
Old 02-23-2005, 08:19 AM   #3
coredump2005
LQ Newbie
 
Registered: Jan 2005
Posts: 2

Original Poster
Rep: Reputation: 0
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...
 
Old 02-23-2005, 03:38 PM   #4
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,539

Rep: Reputation: 149Reputation: 149
Nope..You'd require something build in the STL. As far as I know such thing does not exist.
 
Old 02-23-2005, 03:49 PM   #5
Matir
Moderator
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Ubuntu
Posts: 8,507

Rep: Reputation: 118Reputation: 118
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Error Loading Program Into Memory Kumarrrr Mandriva 2 07-31-2005 06:18 AM
How to do memory management of a program in C? Franziss Programming 8 12-13-2004 03:52 AM
memory leaking in Qt program ih1008 Programming 0 10-08-2004 08:49 PM
Memory usage of openGL program cjp Programming 3 09-09-2004 07:28 AM
Memory Leak when using memory debugging C program on SuSE SLES8 babalina Linux - Distributions 0 10-06-2003 10:39 AM


All times are GMT -5. The time now is 08:57 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration