Let's say I have a ruby script which calls system() to run some
arbitrary program.  Since that program might spiral off into some evil
infinite-loop, is there some way for me to say "execute this, but for
no longer than 2 seconds of CPU time"?  In the C-world I might use
something like setrlimit, but I'm not sure how easy that would be to
do from within a ruby script.

Note that I don't want to limit the CPU time of the script itself.  I
just want to limit the CPU time for specific applications that I
execute via system().

-- 
Garance Alistair Drosehn     =             drosihn / gmail.com
Senior Systems Programmer               or   gad / FreeBSD.org
Rensselaer Polytechnic Institute;             Troy, NY;  USA