- # Remove <sys/shm.h> from the NDK in favour of that from the libandroid-shmem:
- rm $_TERMUX_TOOLCHAIN_TMPDIR/sysroot/usr/include/sys/shm.h
+ # Remove <sys/shm.h> from the NDK in favour of that from the libandroid-shmem.
+ # Also remove <sys/sem.h> as it doesn't work for non-root.
+ rm $_TERMUX_TOOLCHAIN_TMPDIR/sysroot/usr/include/sys/{shm.h,sem.h}