Re: ioctl to keyboard device file

From: Marcel Holtmann
Date: Mon May 16 2005 - 04:55:45 EST


Hi,

> My task is to send the characters to any application as if the input
> is coming from keyboard. For that I created one character device file. To
> it I am sending input characters through ioctl. In the character device
> ioctl definition I am copying these user characters to kernel space and
> sending these characters to handle_scancode function. What is the wrong
> with this solution. This solution is working now. But waht I am asking is
> istead of sending our ioctl to newly created device file, can we able to
> send ioctl to the keyboard buffer, so that avoiding the use of new
> character device file , whose purpose is just to handle ioctl.

using uinput is the way to achieve this goal. What you did is an ugly
hack and I don't see any chance to get it merged back mainline.

> One more is, uinput case,
>
> Whether uinput also doing the same thing, waht I am doing?
> For sending user data to kernel sapce we should use ioctl ,is it right?

This has nothing to do with ioctl() versus write(). Forget about it and
start using uinput.

Regards

Marcel


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/