see if there's an getrlimit(2) function in your
man 2 getrlimit
It's a Berkleyism as far as I can tell but may
be in some other kernels as well.
"It is impossible to make anything foolproof because fools are so
ingenious" - A. Bloch