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

Cyril Hrubis
2023-10-23T12:32:20Z

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