You are not logged in.
Pages: 1
I'm trying to create a user space input device via /dev/uinput
lsmod doesn't show uinput module loaded.
So I try sudo modprobe uinput. It says nothing. No error, no message, yet lsmod still shows there are no modules loaded.
But somehow the file /dev/uinput exists.
So I try to open it via code below and run the program with sudo to overcome any permission problems. The error I get is: error: open: No such device
I think this has something to do with uinput module not being loaded properly. Any help would be appreciated.
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
#define die(str, args...) { perror(str); exit(EXIT_FAILURE); }
int main(void)
{
int fd = open("/dev/uinput", O_WRONLY | O_NONBLOCK);
if(fd < 0)
die("error: open");
return 0;
}
Offline
Interesting kernel module. I wondered if it would still work having been dropped into the tree so long ago, but there were actually updates made to it this year.
Anyway, you posted to the "Kernel & Hardware" thread but neglected to say which kernel you're running. So I simply tried loading it into my 4.1.6-1-ARCH kernel and it seemed to load correctly:
[root@snip tmp]# modprobe uinput
[root@snip tmp]# lsmod|grep input
uinput 20480 0
[root@snip tmp]# ls -l /dev/uinput
crw------- 1 root root 10, 223 Oct 2 19:54 /dev/uinput
Check if any error messages showed up in dmesg.
Offline
Pages: 1