On Mit, 2008-06-18 at 14:29 +0200, Belisko Marek wrote:
> Hi,
>  
> How to pass an array of char via ioctl (not via write method ) to
> kernel from user space? 
> I define unigue IOCTL cmd 
>  
> #define LED_SET_STATE _IOW(LED_MAGIC,1, leds)
>  
> and leds should be an array from userspace.

In the ioctl() handler, you get the address and you can copy the users
data with copy_from_user() into a buffer.

For portability, keep in mind that "int" is 32 or 64 bit and that there
are big and little endian machines.

        Bernd
-- 
Firmix Software GmbH                   http://www.firmix.at/
mobil: +43 664 4416156                 fax: +43 1 7890849-55
          Embedded Linux Development and Services



--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to [EMAIL PROTECTED]
Please read the FAQ at http://kernelnewbies.org/FAQ

Reply via email to