[LTP] [PATCH v4] mmap01: Convert to new API

Petr Vorel pvorel@suse.cz
Wed Dec 11 02:47:10 CET 2024


Hi Ricardo,

...
> +static void run(void)
>  {
> +	pid_t pid;
> +
> +	addr = SAFE_MMAP(NULL, page_sz, PROT_READ | PROT_WRITE,
> +			 MAP_FILE | MAP_SHARED, fildes, 0);
> +
> +	/*
> +	 * Check if mapped memory area beyond EOF are zeros and changes beyond
> +	 * EOF are not written to file.
> +	 */
> +	if (memcmp(&addr[file_sz], dummy, page_sz - file_sz))
> +		tst_brk(TFAIL, "mapped memory area contains invalid data");
FYI test fails when run more iterations (e.g. -i2)

Kind regards,
Petr


More information about the ltp mailing list