From owner-freebsd-emulation Tue Sep 25 21:31:45 2001 Delivered-To: freebsd-emulation@freebsd.org Received: from kayak.xcllnt.net (209-128-86-226.bayarea.net [209.128.86.226]) by hub.freebsd.org (Postfix) with ESMTP id 7DD6137B405 for ; Tue, 25 Sep 2001 21:31:41 -0700 (PDT) Received: from athlon.pn.xcllnt.net (athlon.pn.xcllnt.net [192.168.4.3]) by kayak.xcllnt.net (8.11.4/8.11.4) with ESMTP id f8Q4VbI26227; Tue, 25 Sep 2001 21:31:37 -0700 (PDT) (envelope-from marcel@kayak.pn.xcllnt.net) Received: (from marcel@localhost) by athlon.pn.xcllnt.net (8.11.6/8.11.5) id f8Q4VYP05805; Tue, 25 Sep 2001 21:31:34 -0700 (PDT) (envelope-from marcel) Date: Tue, 25 Sep 2001 21:31:33 -0700 From: Marcel Moolenaar To: Mitsuru IWASAKI Cc: emulation@FreeBSD.org Subject: Fix for linux_semctl - please test Message-ID: <20010925213133.A5791@athlon.pn.xcllnt.net> References: <200109081907.f88J74P38588@freefall.freebsd.org> <20010925.175750.74756409.iwasaki@jp.FreeBSD.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="/9DWx/yDrRhgMJTb" Content-Disposition: inline In-Reply-To: <20010925.175750.74756409.iwasaki@jp.FreeBSD.org> User-Agent: Mutt/1.3.21i Sender: owner-freebsd-emulation@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org --/9DWx/yDrRhgMJTb Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Sep 25, 2001 at 05:57:50PM +0900, Mitsuru IWASAKI wrote: > > It seems that this change breaks Linux sysv syscalls (at least, i386 > version of linux_semctl()) and my Oracle 8.1.7 stopped working. Please try attached patch. -- Marcel Moolenaar USPA: A-39004 marcel@xcllnt.net --/9DWx/yDrRhgMJTb Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="linux.diff" Index: linux_ipc.c =================================================================== RCS file: /home/ncvs/src/sys/compat/linux/linux_ipc.c,v retrieving revision 1.25 diff -u -r1.25 linux_ipc.c --- linux_ipc.c 15 Sep 2001 09:50:31 -0000 1.25 +++ linux_ipc.c 26 Sep 2001 03:32:21 -0000 @@ -224,9 +224,14 @@ caddr_t sg; sg = stackgap_init(); + + /* Make sure the arg parameter can be copied in. */ + unptr = stackgap_alloc(&sg, sizeof(union semun)); + bcopy(unptr, &args->arg, sizeof(union semun)); + bsd_args.semid = args->semid; bsd_args.semnum = args->semnum; - bsd_args.arg = (union semun *)&args->arg; + bsd_args.arg = unptr; switch (args->cmd) { case LINUX_IPC_RMID: @@ -253,10 +258,8 @@ sizeof(linux_semid)); if (error) return (error); - unptr = stackgap_alloc(&sg, sizeof(union semun)); unptr->buf = stackgap_alloc(&sg, sizeof(struct semid_ds)); linux_to_bsd_semid_ds(&linux_semid, unptr->buf); - bsd_args.arg = unptr; return __semctl(td, &bsd_args); case LINUX_IPC_STAT: case LINUX_SEM_STAT: @@ -264,9 +267,7 @@ bsd_args.cmd = IPC_STAT; else bsd_args.cmd = SEM_STAT; - unptr = stackgap_alloc(&sg, sizeof(union semun)); unptr->buf = stackgap_alloc(&sg, sizeof(struct semid_ds)); - bsd_args.arg = unptr; error = __semctl(td, &bsd_args); if (error) return error; --/9DWx/yDrRhgMJTb-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-emulation" in the body of the message