From owner-freebsd-hackers Mon Apr 26 1:44:16 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from herring.nlsystems.com (nlsys.demon.co.uk [158.152.125.33]) by hub.freebsd.org (Postfix) with ESMTP id 031C115108 for ; Mon, 26 Apr 1999 01:43:59 -0700 (PDT) (envelope-from dfr@nlsystems.com) Received: from localhost (dfr@localhost) by herring.nlsystems.com (8.9.3/8.8.8) with ESMTP id JAA34648; Mon, 26 Apr 1999 09:43:33 +0100 (BST) (envelope-from dfr@nlsystems.com) Date: Mon, 26 Apr 1999 09:43:33 +0100 (BST) From: Doug Rabson To: Stephen Hocking-Senior Programmer PGS Tensor Perth Cc: hackers@freebsd.org Subject: Re: Porting Linux Device drivers In-Reply-To: <199904260431.MAA04537@ariadne.tensor.pgs.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Mon, 26 Apr 1999, Stephen Hocking-Senior Programmer PGS Tensor Perth wrote: > > I've nearly finished porting the 3dfx device driver, prior to trying to > persuade someone to let me port glide, but have come across an interesting > problem. Linux device drivers will return a non-negative number on an > ioctl to indicate success and possibly some useful information (such as > the number of 3dfx cards, for example). They return errors as negative > errnos. The problem I'm having is that I'm using the glide Linux > binaries to test the device, and the positive return values are being > trapped somewhere and turned into -1, an obvious failure which the > Linux glide library interprets as an error, spitting the dummy. > > I don't have the source to the Linux glide library, so can't correct > this error there (where it should be done!). Does anyone have any clues as > how to work around this horror? I think the right thing is to put the required return value in p_retval[0] and return zero. That is what syscalls do anyway. -- Doug Rabson Mail: dfr@nlsystems.com Nonlinear Systems Ltd. Phone: +44 181 442 9037 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message