Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 25 Jul 2005 14:53:27 +0200
From:      Stefan Sperling <stsp@stsp.in-berlin.de>
To:        Felix-KM <Felix-KM@yandex.ru>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: how to use the function copyout()
Message-ID:  <20050725125327.GA2213@dice.seeling33.de>
In-Reply-To: <42E4DC88.000006.21996@camay.yandex.ru>
References:  <42E4DC88.000006.21996@camay.yandex.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Jul 25, 2005 at 04:35:20PM +0400, Felix-KM wrote:
> I can't understand how to use the function copyout().
> It is necessary to write the data from a device driver to the
> array defined in user program.
> I do it this way:
> 
> #define IOCTL_GET_B    _IOWR("F", 127, 0x4)

<snip>

> Here I get EFAULT.
> 
> What have I done wrong? How can I do it correctly?

You may need to add your ioctl to another middle layer.

For example, to add ioctls to network devices, I first added
defines to sockio.h only, and it wouldn't work ("device not
configured"). Then I found out that I had to add my ioctls
to a rather large switch statement in if.c too.

hope this helps,
-- 
stefan
http://stsp.in-berlin.de                                 PGP Key: 0xF59D25F0



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