NetBSD Problem Report #7621

Received: (qmail 23952 invoked from network); 22 May 1999 03:02:39 -0000
Message-Id: <199905220302.UAA10129@nooksack.ldc.cs.wwu.edu>
Date: Fri, 21 May 1999 20:02:35 -0700 (PDT)
From: jiro@objectlink.co.jp
Reply-To: jiro@objectlink.co.jp
To: gnats-bugs@gnats.netbsd.org
Subject: linux semctl emulation in netbsd 1.4
X-Send-Pr-Version: www-1.0

>Number:         7621
>Category:       kern
>Synopsis:       linux semctl emulation in netbsd 1.4
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    kern-bug-people
>State:          closed
>Class:          doc-bug
>Submitter-Id:   net
>Arrival-Date:   Fri May 21 20:05:00 +0000 1999
>Closed-Date:    Thu May 27 13:24:42 +0000 1999
>Last-Modified:  Thu May 27 13:31:09 +0000 1999
>Originator:     YAMAMOTO Jiro
>Release:        1.4 i386
>Organization:
ObjectLink, Inc.
>Environment:

>Description:
The commond SETALL and GETALL for linux semctrl are missing in linux_sys_ipc.c. And I think that the command SETVAL does not work because the member val of the union semun is not passed on to the function sys___semctl. Here is my quick workaround. This fix seems to work fine for now, but if someone knows the better one, please let me know. I need a stable code for it in order to run GemStone for linux under netbsd.

/sys/compat/linux/common/linux_ipc.c

        case LINUX_SETVAL:
                SCARG(&nua, cmd) = SETVAL;
                sg = stackgap_init(p->p_emul);
                bup = stackgap_alloc(&sg, sizeof(union semun));
                bup->val = SCARG(uap, arg).l_val;
                SCARG(&nua, arg) = bup;
                break;
        case LINUX_GETALL:
                SCARG(&nua, cmd) = GETALL;
                sg = stackgap_init(p->p_emul);
                bup = stackgap_alloc(&sg, sizeof(union semun));
                bup->array = SCARG(uap, arg).l_array;
                SCARG(&nua, arg) = bup;
                break;
        case LINUX_SETALL:
                SCARG(&nua, cmd) = SETALL;
                sg = stackgap_init(p->p_emul);
                bup = stackgap_alloc(&sg, sizeof(union semun));
                bup->array = SCARG(uap, arg).l_array;
                SCARG(&nua, arg) = bup;
                break;

Regards,
Jiro
>How-To-Repeat:


>Fix:
see the full description above.
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: tron 
State-Changed-When: Thu May 27 06:24:42 PDT 1999 
State-Changed-Why:  
Patch applied, thanks. 
>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.