From owner-freebsd-emulation@FreeBSD.ORG Wed Apr 30 16:00:46 2008 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A37581065671 for ; Wed, 30 Apr 2008 16:00:46 +0000 (UTC) (envelope-from pieter@thedarkside.nl) Received: from mail.thelostparadise.com (cl-92.ede-01.nl.sixxs.net [IPv6:2001:7b8:2ff:5b::2]) by mx1.freebsd.org (Postfix) with ESMTP id 656F58FC18 for ; Wed, 30 Apr 2008 16:00:46 +0000 (UTC) (envelope-from pieter@thedarkside.nl) Received: from [192.168.1.13] (s55915f73.adsl.wanadoo.nl [85.145.95.115]) by mail.thelostparadise.com (Postfix) with ESMTP id C193561C2B for ; Wed, 30 Apr 2008 18:00:44 +0200 (CEST) Message-ID: <481897AB.7070003@thedarkside.nl> Date: Wed, 30 Apr 2008 18:00:43 +0200 From: Pieter de Boer User-Agent: Thunderbird 2.0.0.9 (X11/20080113) MIME-Version: 1.0 To: freebsd-emulation@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Linux compat ioctl return values X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Apr 2008 16:00:46 -0000 Hi, I've been working on a kernel driver that creates a device. This device in turn is opened and ioctl'd from a Linux executable. I've registered a handler for these ioctl's and my ioctl handler is succesfully executed. My ioctl-handler returns a large positive value, but the userland application retrieves the value 1, EPERM. If I return 42, the userland application retrieves 42, but 260 is retrieved as 1. It appears there's a threshold somewhere above which the return value is set to 1, but I haven't been able to find out where in the code this is done. The Linux executable actually expects the value I return, and doesn't work when EPERM is found instead. So, the question is: does anyone know where such a threshold may reside and how to work around it? Thanks, Pieter