Re: file:read_file_info giving wrong size on a MIPS32 CPU
Petr Gotthard writes:
> we built Erlang for a MIPS32 CPU. Everything looks OK, however file:read_file_info returns incorrect file sizes.
> Where linux stat returns size of 6522 (0x197A), the file:read_file_info returns size of 28011776711034 (0x197A0000197A). The upper 4 bytes should be 0, however they are equal to the lower 4 bytes.
> Did anyone ever experienced something like this? It is a 32b CPU with SIZEOF_OFF_T=8.
Please try the patch below, and show us the console output when you do that read_file_info call.
It could be the kernel putting the wrong data in the high word, your libc getting it wrong,
or even a compiler bug.
If the output shows st_size containing the wrong data in the high word, then the next step
would be to write standalone C program with the stat() call, and run that under strace.