www.delorie.com/archives/browse.cgi   search  
Mail Archives: pgcc/1999/07/26/14:24:15

Date: Mon, 26 Jul 1999 20:23:01 +0200 (CEST)
From: Niteshadow <niteshadow AT hq DOT alert DOT sk>
To: pgcc AT delorie DOT com
Subject: Re: mmap
In-Reply-To: <199907261616.JAA00693@boaz.com>
Message-ID: <Pine.LNX.4.10.9907262008280.9767-100000@hq.alert.sk>
MIME-Version: 1.0
Reply-To: pgcc AT delorie DOT com
X-Mailing-List: pgcc AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Mon, 26 Jul 1999, Gordon K. Stone wrote:

> 
> I have a program in which a number of executables use an mmap'ed file
> to share memory. This used to work fine, but we updated to Redhat ver
> 5.2, and now the changes made by one process are no longer seen by the
> others.
> 
> I am using the MAP_FIXED flag--the mmap'ed memory contains absolute
> pointers.
> 
> The program has two possible interfaces, an X interface and a console
> interface. Everything appears to work okay when using the X interface.
> It's under the console interface that the problem appears.
> 
> Any ideas? Is mmap() different?

I am not quite sure, but IMHO you have to specify the MAP_SHARED option:
reading from man mmap(2):

  MAP_SHARED: Share this mapping with all other processes that map this
              object.
  MAP_PRIVATE: Create a private copy-on-write mapping

  You must specify exactly one of MAP_SHARED and MAP_PRIVATE

I do not know whether or not this existed in previous versions (should 
exist since this is POSIX.1b) but with this option everything works fine
for me (under RedHat/Mandrake 6.0) and for a friend of mine (RedHat 5.2)

I cannot explain the difference in behavior under X/console, yet maybe
the X code uses this flag ?
 
> 
> Sincerely
> 
> 
> Gordon Stone
> Technical Support
> Aptech Systems, Inc
> 23804 S.E. Kent-Kangley RD
> Maple Valley, WA 98038
> 425-432-7855 voice
> 425-432-7832 fax
> gordon AT aptech DOT com
> 

signed
Robert
 
------------------------------------------------------------------------------
From  : Robert 'Niteshadow' Varga
email : niteshadow AT hq DOT alert DOT sk, varga AT ibl DOT sk
PGPkey: http://hq.alert.sk/~niteshadow/pgpkey.txt
phone : +421 903 511 985 (mobile, always), +421 863 432 49 75 (home, rarely)
------------------------------------------------------------------------------
         We are Linux. Resistance means you didn't get the point.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019