[LTP] [PATCH v3] syscalls/prctl02: add more error tests

Cyril Hrubis chrubis@suse.cz
Fri Nov 8 15:24:34 CET 2019


Hi!
> > Ok. I will do it as we usually do.
> 
>  ??I think about it again. The argument of prctl is all unsigned long type. Do we need to use
> pointers to pointers??? Or, move this code to setup function like above?

Just pointer to unsigned long and do the cast in the test setup as:

static unsigned long bad_addr;

static struct tcase = {
	...
	unsigned long *arg3;
	...
} tcases[] = {
	...
	{..., &bad_addr, ...},
	...
}

static void setup(void)
{
	invalid_addr = (unigned long)tst_get_bad_addr();
}

Then call it as prctl(..., *tc->arg3).

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list