cvs commit: src/sys/sys _types.h resource.h

Dag-Erling Smørgrav des at des.no
Fri Oct 21 18:37:54 UTC 2016


Colin Percival <cperciva at tarsnap.com> writes:
> Dag-Erling Smørgrav <des at freebsd.org> writes:
> > -typedef __int64_t       __rlim_t;       /* resource limit (XXX not unsigned) */
> > +typedef __int64_t       __rlim_t;       /* resource limit - intentionally */
> > +                                        /* signed, because of legacy code */
> > +                                        /* that uses -1 for RLIM_INFINITY */
> Is it time to drop compatibility for code which was "legacy" 12 years ago
> in order to conform to the POSIX stipulation that rlim_t should be unsigned?

Well, all of that code is already broken because I defined RLIM_INFINITY
to 2^63-1 instead of 2^64-1.  But we might as well align ourselves with
the legacy code (and with other OSes), as the consequences of changing
RLIM_INFINITY are mostly cosmetic: an older ulimit on a newer kernel (or
the other way around) will print a very large number instead of
"unlimited", and if an older binary sets a limit to RLIM_INFINITY on a
newer kernel (or the other way around) the kernel will spend a little
extra time checking limits which will never be reached anyway.  This
will allow us to eliminate a certain amount of code (e.g. in procfs and
the Linuxulator) that translates back and forth between our current
RLIMIT_INFINITY and (int64_t)-1 / ~0UL.

DES
--
Dag-Erling Smørgrav - des at des.no


More information about the svn-src-all mailing list