[LTP] [PATCH v2] syscalls/mmap14: Rewrite test using new LTP API

Cyril Hrubis chrubis@suse.cz
Tue Oct 31 16:39:29 CET 2023


Hi!
> > -static void setup(void)
> > +static void run(void)
> >  {
> > -	tst_require_root();
> > +	unsigned int sz_before, sz_after, sz_diff;
> >  
> > -	tst_sig(FORK, DEF_HANDLER, cleanup);
> > +	getvmlck(&sz_before);
> >  
> > -	TEST_PAUSE;
> > -}
> > +	if (((sz_before * 1024) + MMAPSIZE) > rlim.rlim_cur)
> > +		tst_brk(TBROK, "Trying to exceed RLIMIT_MEMLOCK limit");
> 
> Should this be TCONF not TBROK?

TCONF also this should be done in the test setup()

And optionally we may atempt to raise the limit as long as rlim_max >=
than the size we need we can easily raise the rlim_cur.

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list