openposix/mmap31-1: Fix 32bit binary on 64bit kernel

When the test is compiled in 32bit mode but runs on 64bit kernel the
overflow does not happen, which is simply because the kernel stores the
offsets and lengths in unsigned long which is 64bit on 64bit kernel.

The do_mmap() in mm/mmap.c contains:

        /* offset overflow? */
        if ((pgoff + (len >> PAGE_SHIFT)) < pgoff)
                return -EOVERFLOW;

Which could be only triggered when pgoff and len are 32bit in size.

So we have to skip the test when it was compiled with 32bit compiler but
executed on 64bit kernel in 32bit compat mode. The only heuristic that came to
my mind is to check for "64" substring in machine from uname(), which seem to
work well enough for the case.

Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
1 file changed