From owner-freebsd-hackers@FreeBSD.ORG Wed Nov 4 19:09:29 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 171231065670; Wed, 4 Nov 2009 19:09:29 +0000 (UTC) (envelope-from a_best01@uni-muenster.de) Received: from zivm-exrelay1.uni-muenster.de (ZIVM-EXRELAY1.UNI-MUENSTER.DE [128.176.192.14]) by mx1.freebsd.org (Postfix) with ESMTP id 6FD728FC16; Wed, 4 Nov 2009 19:09:27 +0000 (UTC) X-IronPort-AV: E=Sophos;i="4.44,682,1249250400"; d="scan'208";a="287375005" Received: from zivmaildisp1.uni-muenster.de (HELO ZIVMAILUSER01.UNI-MUENSTER.DE) ([128.176.188.85]) by zivm-relay1.uni-muenster.de with ESMTP; 04 Nov 2009 20:09:26 +0100 Received: by ZIVMAILUSER01.UNI-MUENSTER.DE (Postfix, from userid 149459) id 5BBA31B0766; Wed, 4 Nov 2009 20:09:26 +0100 (CET) Date: Wed, 04 Nov 2009 20:09:25 +0100 (CET) From: Alexander Best Sender: Organization: Westfaelische Wilhelms-Universitaet Muenster To: Alan Cox , Ed Schouten Message-ID: In-Reply-To: <4AF1CB11.2090503@cs.rice.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: alc@freebsd.org, freebsd-hackers@freebsd.org, Alexander Best Subject: Re: mmap(2) with MAP_ANON honouring offset although it shouldn't X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Nov 2009 19:09:29 -0000 Alan Cox schrieb am 2009-11-04: > Ed Schouten wrote: > >* Alan Cox wrote: > For what it's worth, I believe that Solaris does the exact opposite. > >>They provide MAP_ANONYMOUS for compatibility. It seems like a good > >>idea for us to do the same. > >Something like this? > >Index: mman.h > >=================================================================== > >--- mman.h (revision 198919) > >+++ mman.h (working copy) > >@@ -82,6 +82,9 @@ > > */ > >#define MAP_FILE 0x0000 /* map from file (default) */ > >#define MAP_ANON 0x1000 /* allocated from memory, > >swap space */ > >+#ifndef _KERNEL > >+#define MAP_ANONYMOUS MAP_ANON /* For compatibility. */ > >+#endif /* !_KERNEL */ > > /* > > * Extended flags > Yes. If no one objects in the next day or so, then please commit > this change. > Alan should this compatibility addition be documented in the mmap(2) manual? any thoughts on the previous change request so mmap fails with MAP_ANON and pos=0? alex