Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 14 Jun 2000 15:20:33 +0200
From:      Martin Cracauer <cracauer@cons.org>
To:        emulation@FreeBSD.ORG
Cc:        "Raymond A. Wiker" <rwiker@c2i.net>
Subject:   Re: Linux mmap(... MAP_ANON ... fd ...) fix for review
Message-ID:  <20000614152032.A2817@cons.org>
In-Reply-To: <20000614151942.A2649@cons.org>; from cracauer@cons.org on Wed, Jun 14, 2000 at 03:19:43PM %2B0200
References:  <20000614151942.A2649@cons.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--wRRV7LY7NUeQGEoC
Content-Type: text/plain; charset=us-ascii

I would have helped to append the patch, here it is:


--wRRV7LY7NUeQGEoC
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="linux.diff"

Index: linux_misc.c
===================================================================
RCS file: /home/CVS-FreeBSD/src/sys/i386/linux/linux_misc.c,v
retrieving revision 1.78
diff -u -r1.78 linux_misc.c
--- linux_misc.c	2000/04/30 18:51:36	1.78
+++ linux_misc.c	2000/06/14 13:18:14
@@ -696,7 +696,7 @@
 			sizeof(linux_args))))
 	return error;
 #ifdef DEBUG
-    printf("Linux-emul(%ld): mmap(%p, %d, %d, %08x, %d, %d)\n",
+    printf("Linux-emul(%ld): mmap(%p, %d, %d, 0x%08x, %d, %d)",
 	(long)p->p_pid, (void *)linux_args.addr, linux_args.len,
 	linux_args.prot, linux_args.flags, linux_args.fd, linux_args.pos);
 #endif
@@ -756,9 +756,17 @@
     }
 
     bsd_args.prot = linux_args.prot | PROT_READ;	/* always required */
-    bsd_args.fd = linux_args.fd;
+    if (linux_args.flags & LINUX_MAP_ANON)
+	bsd_args.fd = -1;
+    else
+	bsd_args.fd = linux_args.fd;
     bsd_args.pos = linux_args.pos;
     bsd_args.pad = 0;
+#ifdef DEBUG
+    printf("-> (%p, %d, %d, 0x%08x, %d, %d)\n",
+	(void *)bsd_args.addr, bsd_args.len,
+	bsd_args.prot, bsd_args.flags, bsd_args.fd, (int)bsd_args.pos);
+#endif
     return mmap(p, &bsd_args);
 }
 

--wRRV7LY7NUeQGEoC--


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-emulation" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000614152032.A2817>