Overriding memory protection

Overriding memory protection

Post by Theodore Sternber » Thu, 01 Feb 1996 04:00:00



OK, I know memory protection is a great thing, but I'd like to override it
just once.  I have two processes talking to each other (through sockets)
and it would be nice if one could look at a large structure of the
other's, given only its address.

So, how can I disable memory protection, so that looking into another
program's "space" isn't considered a segmentation violation?

Ted Sternberg
San Jose', California, USA

 
 
 

Overriding memory protection

Post by Ralf Schwedle » Thu, 01 Feb 1996 04:00:00



> OK, I know memory protection is a great thing, but I'd like to override it
> just once.  I have two processes talking to each other (through sockets)
> and it would be nice if one could look at a large structure of the
> other's, given only its address.

You want shared memory - and you got it. Read the shm*(2) manpages.

--
Ralf Schwedler                          priv.:
GES, USTL Montpellier                   140, r Pioch de Boutonnet B 1
34095 Montpellier Cedex 5               34090 Montpellier
Tel.: ++33-67 14 34 52                  ++33-67 79 09 76
Fax.: ++33-67 14 39 76  
WWW: http://um2gess0.ges.univ-montp2.fr:8080/homepage.html

 
 
 

Overriding memory protection

Post by Michael Bry » Thu, 01 Feb 1996 04:00:00



Quote:>OK, I know memory protection is a great thing, but I'd like to override it
>just once.  I have two processes talking to each other (through sockets)
>and it would be nice if one could look at a large structure of the
>other's, given only its address.

You want to use shared memory.  Create a shared memory segment, and put
the data structure there.  Then both processes can have the data mapped
into their process space.

The appropriate man pages are shmget(), shmat(), shmdt() and shmctl().