Open BrianHoldsworth opened 5 months ago
Digging through the headers, it kind of seems like timeval
could be using 64-bit integers even on a 32-bit system. If the intent is 32-bit int on 32-bit system and 64-bit int on 64-bit system then isize
is another option. I'm not 100% convinced that this is correct but I don't know how to do it better. It almost seems like it needs to be another feature flag.
I thought about it and realised that I was probably over-analysing the problem. I pushed up a fix.
I see. Unfortunately, using isize in place of c_long
doesn't work with my Raspberry Pi target.
The target description (taken from the output of the linux file
command) is ELF 32-bit LSB pie executable, ARM, EABI5 version 1 (SYSV)
So isize
is 64 bits on a 32-bit target? That's unexpected! I switched it to c_long
.
It seems like isize
is about the architecture's maximum address range. Whereas the c
types are data range. But I'm also not sure and it is hard to know without testing on more archs.
Hi. I've only tested on ARMv7, but I'd assume the problem exists with any 32-bit linux. On 32-bit linux, the timeval struct, which is part of the input_event struct, uses 32-bit longs. However, the struct is hard-coded for 64-bit longs.
I fixed this for ARMv7 with the following change: