Please refer to man 2 read
, which is the system call behind fread
which failed.
EINVAL fd is attached to an object which is unsuitable for reading; or
the file was opened with the O_DIRECT flag, and either the
address specified in buf, the value specified in count, or the
current file offset is not suitably aligned.
Which means basically that the driver attached to /dev/input/event9
isn't happy with the operation requested. In your case it's probably due to alignment issues (wrong read size), see https://www.kernel.org/doc/Documentation/input/input.txt for details about the event protocol and how event devices should be read.