Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 26 Mar 2001 09:40:16 -0800
From:      Alfred Perlstein <bright@wintelcom.net>
To:        Roger Hardiman <roger@cs.strath.ac.uk>
Cc:        hackers@FreeBSD.ORG
Subject:   Re: Porting a Linux driver to FreeBSD with ioctl return values
Message-ID:  <20010326094016.C9431@fw.wintelcom.net>
In-Reply-To: <3ABF45B6.DF5A0B7F@cs.strath.ac.uk>; from roger@cs.strath.ac.uk on Mon, Mar 26, 2001 at 02:35:50PM %2B0100
References:  <3ABF45B6.DF5A0B7F@cs.strath.ac.uk>

next in thread | previous in thread | raw e-mail | index | archive | help
* Roger Hardiman <roger@cs.strath.ac.uk> [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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010326094016.C9431>