[LTP] [PATCH 2/3] mmap23: add test for MAP_32BIT oversized mapping
Petr Vorel
pvorel@suse.cz
Fri Sep 11 16:08:38 CEST 2026
Hi Andrea,
Obviously correct.
Reviewed-by: Petr Vorel <pvorel@suse.cz>
...
> +++ b/testcases/kernel/syscalls/mmap/mmap23.c
...
> +/*\
> + * Verify that :manpage:`mmap(2)` with the MAP_32BIT flag fails with ENOMEM
> + * when requesting a mapping of size >= 2GB, since it cannot fit within the
> + * first 2GB of address space.
> + *
> + * MAP_32BIT is supported only on x86-64 for 64-bit programs.
> + */
> +
> +#include "tst_test.h"
> +#include "lapi/mmap.h"
> +
> +#define MAP_SZ (2UL * TST_GB)
Interesting enough, it works on 1GB as well:
#define MAP_SZ (1UL * TST_GB)
Actually the minimum working memory on my system is 1001 MB (1001UL * TST_MB)
Kind regards,
Petr
More information about the ltp
mailing list