[LTP] [PATCH v1 1/2] lib: Add .ulimit

Cyril Hrubis chrubis@suse.cz
Mon Oct 23 14:32:38 CEST 2023


Hi!
> > +void tst_ulimit_conf(const struct tst_ulimit_val *conf)
> > +{
> > +	struct rlimit rlim;
> > +
> > +	rlim.rlim_cur = conf->rlim.rlim_cur;
> > +	rlim.rlim_max = conf->rlim.rlim_max;
> 
> I wonder if we should adjust the max only if it's smallre than the
> requested value.

Looking again we store both values in the structure. I wonder if we need
to set both, maybe we just need the rlim_cur value in the tst_ulimit_val
structure and we would attempt to adjust rlim_max only if its smaller
than rlim_cur. That would allow us to use the API even for tests that
does not require root to raise limits within the permitted maxium.

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list