From martin@gneto.com  Thu Aug 21 06:26:43 2003
Return-Path: <martin@gneto.com>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id A14BB16A4BF
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 21 Aug 2003 06:26:43 -0700 (PDT)
Received: from platon.gneto.com (as6-1-5.kr.m.bonet.se [217.215.84.52])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 3FF4E43FA3
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 21 Aug 2003 06:26:42 -0700 (PDT)
	(envelope-from martin@gneto.com)
Received: by platon.gneto.com (Postfix, from userid 1202)
	id 81F074AC0; Thu, 21 Aug 2003 15:26:38 +0200 (CEST)
Message-Id: <20030821132638.81F074AC0@platon.gneto.com>
Date: Thu, 21 Aug 2003 15:26:38 +0200 (CEST)
From: Martin Nilsson <martin@gneto.com>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: Linux IPC emulation missing SETALL syscall
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         55835
>Category:       kern
>Synopsis:       [linux] [patch] Linux IPC emulation missing SETALL syscall
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-emulation
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Thu Aug 21 06:30:14 PDT 2003
>Closed-Date:    Tue Apr 15 19:28:40 UTC 2008
>Last-Modified:  Tue Apr 15 19:28:40 UTC 2008
>Originator:     Martin Nilsson
>Release:        FreeBSD 4.8-STABLE i386
>Organization:
>Environment:
System: FreeBSD platon.gneto.com 4.8-STABLE FreeBSD 4.8-STABLE #0: Tue Aug 12 11:25:17 CEST 2003 martin@platon.gneto.com:/usr/obj/ext/FreeBSD/RELENG_4/sys/PLATON i386


	
>Description:
This patch implements the missing SETALL syscall in linux_ipc.c
With this patch I'm able to run the Linux version of the PervasiveSQL 2000 database
Pervasive.SQL-7.94.251.005-2000i.i386.rpm

Pervasive V8 requires further work.

Can somebody please check if it really is this easy to implement the LINUX_SETALL call!

Work on this sponsored by: Harrys Bilskrot AB (www.harrysbilskrot.se) 
>How-To-Repeat:
	
>Fix:

Patch is against todays RELENG_4 this part of the code doesn't seem to be changed in CURRENT

--- sys/compat/linux/linux_ipc.c.orig   Mon Nov  5 20:08:22 2001
+++ sys/compat/linux/linux_ipc.c        Thu Aug 21 15:13:54 2003
@@ -291,9 +291,10 @@
                        return error;
                p->p_retval[0] = seminfo.semmni;
                return 0;                       /* No need for __semctl call */
-       case LINUX_GETALL:
-               /* FALLTHROUGH */
        case LINUX_SETALL:
+               bsd_args.cmd = SETALL;
+               break;
+       case LINUX_GETALL:
                /* FALLTHROUGH */
        default:
                uprintf("linux: 'ipc' typ=%d not implemented\n", args->cmd);


>Release-Note:
>Audit-Trail:

From: Eric Anholt <eta@lclark.edu>
To: gnats <freebsd-gnats-submit@FreeBSD.ORG>
Cc: martin@gneto.com
Subject: Re: kern/55835: Linux IPC emulation missing SETALL syscall
Date: Thu, 06 Nov 2003 16:04:42 -0800

 On Thu, 2003-11-06 at 07:19, Martin Nilsson wrote: 
 > Hi,
 > 
 > While in the linuxulator can you please take a look at kern/55835
 > it is a very simple patch that makes it possible to run the Pervasive 
 > database (btrieve) on FreeBSD.
 > 
 > Thanks,
 > 
 > Martin
 
 I compared the linux and FreeBSD SETALL ioctls, and there was one
 difference I saw.  On linux SETALL updates sem_ctime, while the FreeBSD
 version doesn't.  Since I don't actually understand how this code works
 and how correct we demand our linux compat to be, or if updating
 sem_ctime would be valuable for FreeBSD, I don't think I'll commit it
 unless another committer chimes in.
 
 >From a linux semctl manpage:
        SETALL      Set  semval  for all semaphores of the set using arg.array,
                    updating also the sem_ctime member of the  semid_ds  struc-
                    ture  associated  to the set.  Undo entries are cleared for
                    altered semaphores in all processes.  Processes sleeping on
                    the  wait  queue  are  awakened if some semval becomes 0 or
                    increases.  The argument semnum is  ignored.   The  calling
                    process  must have alter access privileges on the semaphore
                    set.
 
 
 -- 
 Eric Anholt                                eta@lclark.edu          
 http://people.freebsd.org/~anholt/         anholt@FreeBSD.org
 
 
Responsible-Changed-From-To: freebsd-bugs->emulation 
Responsible-Changed-By: bms 
Responsible-Changed-When: Fri Jun 18 12:11:29 GMT 2004 
Responsible-Changed-Why:  
One for the emulation team 

http://www.freebsd.org/cgi/query-pr.cgi?pr=55835 
State-Changed-From-To: open->closed 
State-Changed-By: rdivacky 
State-Changed-When: Tue Apr 15 19:25:49 UTC 2008 
State-Changed-Why:  
This was commited in rev. 1.54 of compat/linux/linux-ipc.c 


http://www.freebsd.org/cgi/query-pr.cgi?pr=55835 
>Unformatted:
