From owner-freebsd-emulation Wed Jun 14 6:20:38 2000 Delivered-To: freebsd-emulation@freebsd.org Received: from knight.cons.org (knight.cons.org [194.233.237.86]) by hub.freebsd.org (Postfix) with ESMTP id 277D237C1A7 for ; Wed, 14 Jun 2000 06:20:35 -0700 (PDT) (envelope-from cracauer@knight.cons.org) Received: (from cracauer@localhost) by knight.cons.org (8.9.3/8.9.3) id PAA02843; Wed, 14 Jun 2000 15:20:33 +0200 (CEST) Date: Wed, 14 Jun 2000 15:20:33 +0200 From: Martin Cracauer To: emulation@FreeBSD.ORG Cc: "Raymond A. Wiker" Subject: Re: Linux mmap(... MAP_ANON ... fd ...) fix for review Message-ID: <20000614152032.A2817@cons.org> References: <20000614151942.A2649@cons.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="wRRV7LY7NUeQGEoC" X-Mailer: Mutt 1.0.1i In-Reply-To: <20000614151942.A2649@cons.org>; from cracauer@cons.org on Wed, Jun 14, 2000 at 03:19:43PM +0200 Sender: owner-freebsd-emulation@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org --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