From jonc@wapsolutions.co.nz  Tue Feb 12 19:17:35 2002
Return-Path: <jonc@wapsolutions.co.nz>
Received: from wapsolutions.co.nz (port-91-96.fastadsl.net.nz [203.96.91.96])
	by hub.freebsd.org (Postfix) with ESMTP id D669937B405
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 12 Feb 2002 19:17:33 -0800 (PST)
Received: (from jonc@localhost)
	by wapsolutions.co.nz (8.11.6/8.11.6) id g1D3HBo00755;
	Wed, 13 Feb 2002 16:17:11 +1300 (NZDT)
	(envelope-from jonc)
Message-Id: <200202130317.g1D3HBo00755@wapsolutions.co.nz>
Date: Wed, 13 Feb 2002 16:17:11 +1300 (NZDT)
From: Jonathan Chen <jonc@chen.org.nz>
Reply-To: Jonathan Chen <jonc@chen.org.nz>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: Linuxulator linux_fcntl64() doesn't handle mode F_SETLKW64
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         34895
>Category:       kern
>Synopsis:       Linuxulator linux_fcntl64() doesn't handle mode F_SETLKW64
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Feb 12 19:20:01 PST 2002
>Closed-Date:    Tue Jul 09 09:04:27 PDT 2002
>Last-Modified:  Tue Jul 09 09:04:27 PDT 2002
>Originator:     Jonathan Chen
>Release:        FreeBSD 4.5-STABLE i386
>Organization:
>Environment:
System: FreeBSD central.wapsolutions.co.nz 4.5-STABLE FreeBSD 4.5-STABLE #0: Tue Jan 29 16:21:08 NZDT 2002 root@central.wapsolutions.co.nz:/usr/obj/usr/src/sys/GENERIC i386


>Description:
When Linux Informix-SE, any attempt to create a database will fail
with a Invalid argument error. Running truss(1) on the sqlexec process
reveals the following:

    [...]
    linux_open("a.dbs/syscolumns.idx",32770,00)  = 4 (0x4)
    linux_fcntl64(0x4,0x2,0x1)           = 0 (0x0)
    linux_open("a.dbs/syscolumns.dat",32770,00)  = 5 (0x5)
    linux_fcntl64(0x5,0x2,0x1)           = 0 (0x0)
    linux_fcntl64(0x4,0xe,0x8193a88)         ERR#22 'Invalid argument'
    write(1,0x81a4500,22)                = 22 (0x16)
    [...]

A quick look at a Linux system's /usr/include/bits/fcntl.h shows:

    [...]
    /* Values for the second argument to `fcntl'.  */
    #define F_DUPFD     0   /* Duplicate file descriptor.  */
    #define F_GETFD     1   /* Get file descriptor flags.  */
    #define F_SETFD     2   /* Set file descriptor flags.  */
    #define F_GETFL     3   /* Get file status flags.  */
    #define F_SETFL     4   /* Set file status flags.  */
    #ifndef __USE_FILE_OFFSET64
    # define F_GETLK    5   /* Get record locking info.  */
    # define F_SETLK    6   /* Set record locking info (non-blocking).  */
    # define F_SETLKW   7   /* Set record locking info (blocking).  */
    #else
    # define F_GETLK    F_GETLK64  /* Get record locking info.  */
    # define F_SETLK    F_SETLK64  /* Set record locking info (non-blocking).*/
    # define F_SETLKW   F_SETLKW64 /* Set record locking info (blocking).  */
    #endif
    #define F_GETLK64   12  /* Get record locking info.  */
    #define F_SETLK64   13  /* Set record locking info (non-blocking).  */
    #define F_SETLKW64  14  /* Set record locking info (blocking).  */
    [...]

I'm assuming that the '0xe' in the invalid call above refers to
F_SETLKW64 on the Linux side. Any tips to fix this appreciated.

>How-To-Repeat:
Install and load linux_base-7
Download Informix SE http://www.informix.com/evaluate/ and install.
Attempt to create a database
>Fix:
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: robert 
State-Changed-When: Tue Jul 9 09:03:09 PDT 2002 
State-Changed-Why:  
Equivalent problem as in kern/37656. 

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