delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1997/01/14/17:10:02

From: jra AT cygnus DOT com (Jeremy Allison)
Subject: Re: _get_osfhandle and/or mmap under cygwin.dll on NT?
14 Jan 1997 17:10:02 -0800 :
Approved: cygnus DOT gnu-win32 AT cygnus DOT com
Distribution: cygnus
Message-ID: <199701150000.QAA07540.cygnus.gnu-win32@cygnus.com>
Original-To: dahms AT ifk20 DOT mach DOT uni-karlsruhe DOT de
Original-cc: jra AT cygnus DOT com, gnu-win32 AT cygnus DOT com
In-reply-to: Your message of "Tue, 14 Jan 1997 22:18:14 EST."
<009AE5F1 DOT 4C404340 DOT 7192 AT ifk20 DOT mach DOT uni-karlsruhe DOT de>
Original-Sender: owner-gnu-win32 AT cygnus DOT com

Heribert wrote :

> I need the following under NT, which works under HP-UX, Linux and
> DECunix/Alpha, for a shared buffer allowing the parent writing to all it's
> childs. That means the contents of the buffer can't be copied just once!
>  
>             if (buf = mmap(NULL, some_size,
>                         PROT_READ | PROT_WRITE,
> #ifdef MAP_VARIABLE
>                         MAP_VARIABLE |
> #endif
>                         MAP_ANONYMOUS | MAP_SHARED,
>                         -1, 0)) == (caddr_t) -1) {
>		/* error handled here */
>	    }
> #endif

Yes that will work under the mmap implementation.
I just map all mmap call to Win32 MapViewOfFile etc.
calls and store all current mmaped area in a STL class.
This is used to reproduce the mmapped areas in the same
place in the child. No 'copying' other than the STL
class data used to recreate the mmaped areas is done.

Cheers,

Jeremy.
-
For help on using this list, send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


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