From owner-freebsd-questions@FreeBSD.ORG Tue Feb 3 17:27:18 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 46AE516A4CE; Tue, 3 Feb 2004 17:27:18 -0800 (PST) Received: from webmail.tiscali.de (relay1.tiscali.de [62.26.116.129]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4A72643D39; Tue, 3 Feb 2004 17:27:16 -0800 (PST) (envelope-from walter@pelissero.de) Received: from daemon.home.loc (62.246.38.78) by webmail.tiscali.de (6.7.019) id 400E95410048B138; Wed, 4 Feb 2004 02:27:13 +0100 Received: from hyde.home.loc (hyde.home.loc [10.0.0.2]) by daemon.home.loc (8.12.10/8.12.8) with ESMTP id i141QRIV078293; Wed, 4 Feb 2004 02:26:27 +0100 (CET) (envelope-from wcp@hyde.home.loc) Received: from hyde.home.loc (localhost [127.0.0.1]) by hyde.home.loc (8.12.9/8.12.8) with ESMTP id i141QQxA008144; Wed, 4 Feb 2004 02:26:26 +0100 (CET) (envelope-from wcp@hyde.home.loc) Received: (from wcp@localhost) by hyde.home.loc (8.12.9/8.12.6/Submit) id i141QQLX008141; Wed, 4 Feb 2004 02:26:26 +0100 (CET) (envelope-from wcp) From: "Walter C. Pelissero" MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16416.19009.687804.858168@hyde.home.loc> Date: Wed, 4 Feb 2004 02:26:25 +0100 To: Dan Nelson In-Reply-To: <20040203192031.GB77596@dan.emsphone.com> References: <16409.17392.62258.191839@hyde.home.loc> <200401291747.i0THlLL04725@clunix.cl.msu.edu> <16415.61145.783013.602178@hyde.home.loc> <20040203192031.GB77596@dan.emsphone.com> X-Mailer: VM 7.16 under Emacs 21.3.50.1 X-Attribution: WP X-For-Spammers: blacklistme@pelissero.de cc: freebsd-emulation@freebsd.org cc: "Walter C. Pelissero" cc: freebsd-questions@freebsd.org Subject: Re: Acu Cobol 6.0 for Linux X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: walter@pelissero.de List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Feb 2004 01:27:18 -0000 Dan Nelson writes: > If you do have sysvmsg loaded, you may have to start adding printfs in > linux_msgctl() to trace which call is failing and why. Thanks. With your hints I made an interesting discovery that allowed me to improve the situation dramatically. In Linux's /usr/include/linux/ipc.h there is an interesting comment: /* * Version flags for semctl, msgctl, and shmctl commands * These are passed as bitflags or-ed with the actual command */ #define IPC_OLD 0 /* Old version (no 32-bit UID support on many architectures) */ #define IPC_64 0x0100 /* New version (support 32-bit UIDs, bigger message sizes, etc. */ In fact linux_msgctl receives a command 0x102 instead of 2. Although the following patch fixes the problem related to msgctl, I'm not quite sure it's enough to say that Acu Cobol runs perfectly on FreeBSD. Actually I've got the feeling msgrcv still doesn't work as expected, but I might be wrong. I'll probably reach a certain confidence in the following days. A side note. What is the impact of this IPC_64 flag on the FreeBSD code? Can we ignore it, or does it mean that the Linux emulator is outdated regarding this "new" flag? Cheers, -- walter pelissero http://www.pelissero.de Index: compat/linux/linux_ipc.c =================================================================== RCS file: /usr/home/src.cvs/src/sys/compat/linux/linux_ipc.c,v retrieving revision 1.17.2.3 diff -w -u -r1.17.2.3 linux_ipc.c --- compat/linux/linux_ipc.c 5 Nov 2001 19:08:22 -0000 1.17.2.3 +++ compat/linux/linux_ipc.c 4 Feb 2004 00:33:56 -0000 @@ -233,7 +233,7 @@ bsd_args.semnum = args->semnum; bsd_args.arg = unptr; - switch (args->cmd) { + switch (args->cmd & 0xff) { /* mask off the IPC_64 flag */ case LINUX_IPC_RMID: bsd_args.cmd = IPC_RMID; break; @@ -362,7 +362,7 @@ int error; bsd_args.msqid = args->msqid; - bsd_args.cmd = args->cmd; + bsd_args.cmd = args->cmd & 0xff; /* mask off the IPC_64 flag */ bsd_args.buf = (struct msqid_ds *)args->buf; error = msgctl(p, &bsd_args); return ((args->cmd == LINUX_IPC_RMID && error == EINVAL) ? 0 : error); @@ -429,7 +429,7 @@ int error; caddr_t sg = stackgap_init(); - switch (args->cmd) { + switch (args->cmd & 0xff) { /* mask off the IPC_64 flag */ case LINUX_IPC_STAT: bsd_args.shmid = args->shmid; bsd_args.cmd = IPC_STAT;