Trying to read raw evdev events from my keyboard -> /dev/input/event0, using the following code:
kbd, _ := os.Open("/dev/input/event0")
n, err := kbd.Read(buf)
//n, err := syscall.Read( int(kbd.Fd()), buf )
}
Which errs. The syscall gives: '-1 invalid argument'. However, the (I assume) corresponding C code works as expected...
int fd = open("/dev/input/event0", O_RDONLY);
read(fd, buf, sizeof(buf));
So, what gives? I'm tempted to write this up as a bug, but this is my first time working with Go syscall, so I'm not confident that I'm not just being stupid.
Running go1.2 linux/386.