[LTP] [PATCH v3 3/3] mmap24: add test for MAP_32BIT address limit

Li Wang li.wang@linux.dev
Sun Sep 13 06:18:01 CEST 2026


> +/*\
> + * Verify that :manpage:`mmap(2)` with the MAP_32BIT flag restricts all mappings
> + * to the first 2GB of the process address space (< 0x80000000).
> + *
> + * MAP_32BIT is supported only on x86-64 for 64-bit programs.
> + *
> + * Use PROT_NONE to test address placement without allocating data pages
> + * or charging private writable memory against the commit limit.

Reviewed-by: Li Wang <li.wang@linux.dev>

This test itself looks good, but unlike the address placement way, maybe we
can create a new test (mmap25.c) that allocates real read-write anonymous memory,
writes a pattern, reads it back, and checks the result.

This verifies that read-write memory mapped with MAP_32BIT functions correctly.

-- 
Regards,
Li Wang


More information about the ltp mailing list