sysinfo() kernel variance

Stephen Weeks MLton@sourcelight.com
Mon, 25 Feb 2002 22:37:09 -0800


> When I was testing things out, if I run code compiled on a 2.4 kernel under a
> 2.2 kernel, mem_unit prints out as zero.  Looking at the kernel sources, this
> can  be depended on.  Thus you can test for this in code compiled under a 2.4
> system at run time.  This would still fail on a 2.2-kernel machine with  more
> than  4  gig  of RAM or swap.  I.e.: if you are compiling on a 2.2 kernel (no
> mem_unit) then act as if mem_unit is always 1.  If you are compiling on a 2.4
> kernel, then at run-time check if mem_unit is 0.  If so, pretend it is 1 (and
> don't try to grab any fields that were added in 2.4 kernels).
> 
> I don't think I would bother with the automake configure if this is the  only
> thing  that needs testing, but I would call what ever does it configure and I
> would include no Makefile, but only a Makefile.in which the configure program
> copied to Makefile.  This way it feels like the standard configure.

This all sounds fine to me.  I just checked in my last changes to
runtime for the night.  So now is a good time to go ahead and move
stuff around.  Go for it.