Date: Wed, 28 Apr 1999 11:09:04 +0800 From: Stephen Hocking-Senior Programmer PGS Tensor Perth <shocking@prth.pgs.com> To: hackers@freebsd.org Cc: dfr@nlsystems.com, toasty@dragondata.com, mike@smith.net.au Subject: 3dfx driver and ioctl return value issues. Message-ID: <199904280309.LAA09496@ariadne.tensor.pgs.com>
next in thread | raw e-mail | index | archive | help
As some of you know, I 've been porting the Linux 3dfx driver to FreeBSD and it's complete, modulo bugs found by testing. I'm using the test programs supplied with the Linux glide SDK to do the testing have come up with an interesting problem. Basically, the Linux drivers return a negative value on ioctl for an error (which is then converted to a positive number and stashed in errno, whilst the user program sees the negative return from ioctl) but returns *non-negative* numbers to indicate success. This means that an ioctl can return information such as the number of 3dfx card in a system as a return value, rather than in the variable that the third argument of ioctl points to. This would not normally be a problem, except for the fact that the Linux glide library depends on this perverse behaivior, making testing rather difficult. I tried placing the appropriate value in p->p_retval[0] in the section of code I've hacked into linux_ioctl.c for my ioctl, and it's not working. It takes the return value of the ioctl instead (which is 0, for success) and passes that back to the program. I need a way to hack the ioctl system call and allow it to return a non negative value. There's another way out - I obtain the Glide source, alter it to pass pointers to variables in ioctl calls rather than relying on the return value of the ioctl call. For those people who wish to use the driver in the Linux "realtime 3d simulations" aka glquake, we recompile it after the alterations with the Linux dev kit. Doug, do you still have contacts within 3dfx? I'd like to go about getting the NDA so I can port glide to FreeBSD. Stephen -- The views expressed above are not those of PGS Tensor. "We've heard that a million monkeys at a million keyboards could produce the Complete Works of Shakespeare; now, thanks to the Internet, we know this is not true." Robert Wilensky, University of California 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?199904280309.LAA09496>