Skip to content

tests: shm: fix pwrite wrapper with -D_FILE_OFFSET_BITS=64

Ben Wolsieffer requested to merge benwolsieffer/dconf:fix-shm-test into master

Due to the hacks used for large file support, wrapping pwrite is error prone and can end up calling the wrong function. Currently, "pwrite" is called instead of "pwrite64" on 32-bit ARM, causing the test to fail. This commit attempts to determine the correct symbol to call from the wrapper.

I wrote this based off glibc (relevant files: unistd.h, features.h), and I'm not sure it does the right thing in all configurations or is portable across different libc implementations. Maybe someone can come up with a more elegant fix.

I tested this patch on ARMv7l, Aarch64 and x86_64 with glibc.

Edited by Ben Wolsieffer

Merge request reports