#include <sys/resource.h>
#include <unistd.h>
#include <stdio.h>

/* Some of the resource limits you can set:
   RLIMIT_CPU: The maximum amount of cpu time (in seconds) to be used by
               each process.
   RLIMIT_FSIZE: The largest size (in bytes) file that may be created.

   RLIMIT_NOFILE: The maximum number of open files for this process.
*/
 

int main(int argc, char **argv)
{
    char *path = "path_to_executable";
    char *args[] = {path, 0};
    char *env[] = {0};
    struct rlimit lim;
    
    // This example sets the maximum file size that can be created
    // by the process.
    lim.rlim_cur = 0;
    lim.rlim_max = 0;
    setrlimit(RLIMIT_FSIZE, &lim);
    
    execve(path, args, env);
    printf("fail\n");
    
    return 0;
}