I want to write a C/C++ Program having the following functionalities:
- Run a binary executable C program as a child process.
- Watch the memory usage of the child process, and be able to terminate the child process when it overuse memory, like over 100MB.
- When the child process have been running for a given time, like 1 sec, I can terminate it.
- Keep it away from any linux kernel functions, which means when the child process ask for functions not belongs to standard C Library, I can prevent it and terminate the process.
Any idea to how to implements these? Or you can just give me a hint and I can find out by myself! Thanks!