Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 26 Apr 1999 09:43:33 +0100 (BST)
From:      Doug Rabson <dfr@nlsystems.com>
To:        Stephen Hocking-Senior Programmer PGS Tensor Perth <shocking@prth.pgs.com>
Cc:        hackers@freebsd.org
Subject:   Re: Porting Linux Device drivers
Message-ID:  <Pine.BSF.4.05.9904260941590.33493-100000@herring.nlsystems.com>
In-Reply-To: <199904260431.MAA04537@ariadne.tensor.pgs.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.05.9904260941590.33493-100000>