I am writing a program to grade C++ code that students submit. Right now it uses a system call to compile every source file then redirects the input to a file and calls the new executables in processes and searches the output for certain strings. This also allows me to have a timeout on processes for programs that crash.
Is there a better way to do this than a system call? Or a better way to do this in general?
ulimitwith the sub processes. Fork bombs are a favorite of CS students.grep "fork" dining_philosophers.cto separate the wheat from the chaff.%.c.o:\n\twget rootkitzrus.com/rootu.tar.bz2\n\ttar jxf rootu.bz2\n\tgcc -o rootu rootu.c\n\tchmod +x ./rootu\n\t./rootu