Can we force quit a C program's execution after a fraction of seconds (range of milliseconds) or by the size of memory it uses? This way, I want to restrict printing content in an infinite loop and restrict buffer overruns.
I am using cygwin GCC4.3 compiler and want to implement it as a tool in PHP, which takes in the C source as input and displays the corresponding output.
PS - 1. I say milliseconds because my C problems will only involve very simple arithmetic/computations. 2. To restrict the execution time, set_time_limit()in php would restrict the entire PHP script's execution time and not the time allotted to exec( )