From owner-freebsd-hackers Mon Mar 26 23:24:34 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from fw.wintelcom.net (ns1.wintelcom.net [209.1.153.20]) by hub.freebsd.org (Postfix) with ESMTP id 26A3037B71A; Mon, 26 Mar 2001 23:24:32 -0800 (PST) (envelope-from bright@fw.wintelcom.net) Received: (from bright@localhost) by fw.wintelcom.net (8.10.0/8.10.0) id f2R7OWK20332; Mon, 26 Mar 2001 23:24:32 -0800 (PST) Date: Mon, 26 Mar 2001 23:24:31 -0800 From: Alfred Perlstein To: Coleman Kane Cc: Roger Hardiman , hackers@FreeBSD.ORG Subject: Re: Porting a Linux driver to FreeBSD with ioctl return values Message-ID: <20010326232431.Q9431@fw.wintelcom.net> References: <3ABF45B6.DF5A0B7F@cs.strath.ac.uk> <20010326094016.C9431@fw.wintelcom.net> <20010327015524.A863@cokane.yi.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010327015524.A863@cokane.yi.org>; from cokane@FreeBSD.ORG on Tue, Mar 27, 2001 at 01:55:24AM -0500 X-all-your-base: are belong to us. Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG * Coleman Kane [010326 22:40] wrote: > Yeah, that's basically what I had to do in tdfx. You can take a look int > src/sys/dev/tdfx/tdfx_pci.c under tdfx_ioctl(...) to get an idea of what > needs to be done, if you need more info. Tdfx basically implements the > API from device_3dfx in Linux. Is there anyone we can PLEAD with to explain that to the linnux people that that's a broken way to implement ioctl()? > Alfred Perlstein had the audacity to say: > > > > * Roger Hardiman [010326 05:37] wrote: > > > Hi, > > > I'm porting the some linux telephony API drivers over > > > to FreeBSD. > > > > > > But the author of the linux driver used the 'hack' of > > > returning values from the ioctls as the error result. > > > > > > eg volume = ioctl (fd, IXJ_GET_VOLUME) > > > > > > instead of using > > > error = ioctl (fd, IXJ_GET_VOLUME, &volume); > > > > > > > > > Naturally I want to keep the API the same on FreeBSD > > > so existing apps will compile without change. > > > But right now it looks like I cannot do this. > > > > > > Is there anything I can do in the FreeBSD driver > > > or in existing source to help, without imposing > > > a new 'BSD' API. > > > > I just woke up.... er, try this: > > > > p->p_retval[0] = your_return_value; > > > > in your ioctl code... or are you saying that the ioctl code > > spams over it? > > > > -- > > -Alfred Perlstein - [bright@wintelcom.net|alfred@freebsd.org] > > Represent yourself, show up at BABUG http://www.babug.org/ > > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > > with "unsubscribe freebsd-hackers" in the body of the message > > -- -Alfred Perlstein - [bright@wintelcom.net|alfred@freebsd.org] Daemon News Magazine in your snail-mail! http://magazine.daemonnews.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message