From owner-freebsd-hackers@FreeBSD.ORG Wed Nov 4 18:42:37 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 265E51065672; Wed, 4 Nov 2009 18:42:37 +0000 (UTC) (envelope-from alc@cs.rice.edu) Received: from mail.cs.rice.edu (mail.cs.rice.edu [128.42.1.31]) by mx1.freebsd.org (Postfix) with ESMTP id ED72A8FC14; Wed, 4 Nov 2009 18:42:36 +0000 (UTC) Received: from mail.cs.rice.edu (localhost.localdomain [127.0.0.1]) by mail.cs.rice.edu (Postfix) with ESMTP id 7D10F2C2D3C; Wed, 4 Nov 2009 12:42:36 -0600 (CST) X-Virus-Scanned: by amavis-2.4.0 at mail.cs.rice.edu Received: from mail.cs.rice.edu ([127.0.0.1]) by mail.cs.rice.edu (mail.cs.rice.edu [127.0.0.1]) (amavisd-new, port 10024) with LMTP id wczLjmLu-Mhp; Wed, 4 Nov 2009 12:42:28 -0600 (CST) Received: from adsl-216-63-78-18.dsl.hstntx.swbell.net (adsl-216-63-78-18.dsl.hstntx.swbell.net [216.63.78.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.cs.rice.edu (Postfix) with ESMTP id 6A3FA2C2D0A; Wed, 4 Nov 2009 12:42:28 -0600 (CST) Message-ID: <4AF1CB11.2090503@cs.rice.edu> Date: Wed, 04 Nov 2009 12:42:25 -0600 From: Alan Cox User-Agent: Thunderbird 2.0.0.23 (X11/20090822) MIME-Version: 1.0 To: Ed Schouten References: <20091103172452.GU1293@hoeg.nl> <200911040812.18712.jhb@freebsd.org> <20091104162646.GZ1293@hoeg.nl> <4AF1C707.6000706@cs.rice.edu> <20091104183434.GB1293@hoeg.nl> In-Reply-To: <20091104183434.GB1293@hoeg.nl> Content-Type: text/plain; charset=ISO-8859-1; format=flowed 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 18:42:37 -0000 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