From owner-freebsd-emulation@FreeBSD.ORG Wed Sep 20 09:23:08 2006 Return-Path: X-Original-To: emulation@freebsd.org Delivered-To: freebsd-emulation@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4FC2516A407 for ; Wed, 20 Sep 2006 09:23:08 +0000 (UTC) (envelope-from Alexander@Leidinger.net) Received: from www.ebusiness-leidinger.de (jojo.ms-net.de [84.16.236.246]) by mx1.FreeBSD.org (Postfix) with ESMTP id C142343D69 for ; Wed, 20 Sep 2006 09:23:02 +0000 (GMT) (envelope-from Alexander@Leidinger.net) Received: from Andro-Beta.Leidinger.net (p54A5D5BD.dip.t-dialin.net [84.165.213.189]) (authenticated bits=0) by www.ebusiness-leidinger.de (8.13.6/8.13.6) with ESMTP id k8K8xZ9p054829; Wed, 20 Sep 2006 10:59:36 +0200 (CEST) (envelope-from Alexander@Leidinger.net) Received: from localhost (webmail.Leidinger.net [192.168.1.102]) by Andro-Beta.Leidinger.net (8.13.4/8.13.3) with ESMTP id k8K9MuEU042192; Wed, 20 Sep 2006 11:22:56 +0200 (CEST) (envelope-from Alexander@Leidinger.net) Received: from psbru.cec.eu.int (psbru.cec.eu.int [158.169.131.14]) by webmail.leidinger.net (Horde MIME library) with HTTP; Wed, 20 Sep 2006 11:22:44 +0200 Message-ID: <20060920112244.3gx7bjlfk44g4w8g@webmail.leidinger.net> X-Priority: 3 (Normal) Date: Wed, 20 Sep 2006 11:22:44 +0200 From: Alexander Leidinger To: Marcin Cieslak References: <450F3BA3.40304@SYSTEM.PL> In-Reply-To: <450F3BA3.40304@SYSTEM.PL> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; DelSp="Yes"; format="flowed" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable User-Agent: Internet Messaging Program (IMP) H3 (4.1.3) / FreeBSD-7.0 X-Virus-Scanned: by amavisd-new Cc: emulation@freebsd.org Subject: Re: i386 mmap(2) fixed for LTP X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Sep 2006 09:23:08 -0000 Quoting Marcin Cieslak (from Tue, 19 Sep 2006 =20 02:36:51 +0200): > Using this patch I guess we have all mmap()-related LTP issues solved. > This fixes outstanding map07 test. Please add patches as attachments, not inline. Somehow they are =20 mangled and I have to aapply them by hand. This is ok for such small =20 patches (and I have to review them at the same time...), but not for =20 larger patches. > Please feel free to review. > +=09/* Linux mmap(2): The /* should be on a line by itself. Fixed locally. > -=09bsd_args.prot =3D linux_args->prot | PROT_READ;=09/* always required *= / > -=09if (linux_args->flags & LINUX_MAP_ANON) > +=09bsd_args.prot =3D linux_args->prot; > +=09if (linux_args->flags & LINUX_MAP_ANON) { No need for the opening { here. > =09=09bsd_args.fd =3D -1; > -=09else > +=09} else { > +=09=09/* > +=09=09 * Linux follows Solaris mmap(2) description: > +=09=09 * The file descriptor fildes is opened with > +=09=09 * read permission, regardless of the > +=09=09 * protection options specified. > +=09=09 * If PROT_WRITE is specified, the application > +=09=09 * must have opened the file descriptor > +=09=09 * fildes with write permission unless > +=09=09 * MAP_PRIVATE is specified in the flags > +=09=09 * argument as described below. > +=09=09 */ > + > +=09=09if ((error =3D fget(td, linux_args->fd, &fp)) !=3D 0) > + return error; > +=09=09if (fp->f_type !=3D DTYPE_VNODE) > +=09=09=09return EINVAL; Missing fdrop in the error case? Added locally for testing. > +=09=09/* Linux mmap() just fails for O_WRONLY files */ > +=09=09if (! (fp->f_flag & FREAD)) > +=09=09=09return EACCES; Same as above. Bye, Alexander. --=20 If it would be cheaper to repair the old one, the company will insist on the latest model. http://www.Leidinger.net Alexander @ Leidinger.net: PGP ID =3D B0063FE7 http://www.FreeBSD.org netchild @ FreeBSD.org : PGP ID =3D 72077137