Subject: Re: direct copy() between two proc address spaces
To: Jonathan Stone <>
From: Jason Thorpe <>
List: tech-kern
Date: 06/21/2004 16:16:40
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=US-ASCII; format=flowed

On Jun 21, 2004, at 1:55 PM, Jonathan Stone wrote:

> Would it help if we redefine MAP_ANON|MAP_SHARED mmap()s to allow a
> valid fd, and use the supplied fd to find the (single, 
> by-new-definition,
> to-be-shared) anon object? Or would that break standards conformance?

Passing a file descriptor pretty much means the memory is *not* 
anonymous, eh?

The /dev/zero hack originated from SunOS ... it didn't have the 
MAP_ANON flag, but rather retrofitted anonymous memory mapping into its 
VM system by adding the /dev/zero hack.  Subsequent BSD systems have 
retained that hack for compatibility, since some applications grew to 
rely on it.

If you want "named" "anonymous" memory, for now you should use System V 
shared memory.  Once day we will get POSIX Real Time shared memory, and 
will have that API available to us, as well.

But, please, let's not suggest more hacks upon hacks... let's use the 
"standard" APIs we already have that allow for named swap-backed shared 

         -- Jason R. Thorpe <>

content-type: application/pgp-signature; x-mac-type=70674453;
content-description: This is a digitally signed message part
content-disposition: inline; filename=PGP.sig
content-transfer-encoding: 7bit

Version: GnuPG v1.2.3 (Darwin)