mmap(2) with MAP_ANON honouring offset although it shouldn't

Ed Schouten ed at 80386.nl
Wed Nov 4 18:34:36 UTC 2009


* Alan Cox <alc at cs.rice.edu> 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

-- 
 Ed Schouten <ed at 80386.nl>
 WWW: http://80386.nl/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20091104/f7171876/attachment.pgp


More information about the freebsd-hackers mailing list