kernel - Relax requirements for sysctl operations on longs
* Relax the requirements for sysctl operations on longs. Allow the
case where userland is reading the sysctl variable as an integer
instead of a long.
* Allows us to promote various vm.stats.vm_* fields that must now be
longs in order to support > 8TB of ram as well as avoid internal
calculation overflows.
* Fixes an issue where chrome issues this sysctl as an int:
sysctlbyname("vm.stats.vm.v_page_count", &pages, &size, NULL, 0);
And fails to check the return value / error code, resulting in
a garbage value for 'pages' which chrome then uses to size the
browser's memory restrains. This in turn was causing chrome
to give up multiple tabs thinking it had run out of memory when,
in fact, there is plenty of memory available.
* Generally speaking, I've wanted to have this sort of backwards
compatibility for a while now. Userland shouldn't get errors
accesing integral sysctl values simply because it uses an integer
of a different size than the sysctl.