ddos/set_proc_limit.c
changeset 68 d549894aa6a9
child 77 49e0babccb23
equal deleted inserted replaced
67:abe63a276a36 68:d549894aa6a9
       
     1 /**
       
     2  * test/demos/ddos/set_limit.c
       
     3  * Copyright (C) 2008 Markus Broeker
       
     4  */
       
     5 
       
     6 #include <sys/resource.h>
       
     7 
       
     8 int set_proc_limit (int processes)
       
     9 {
       
    10     struct rlimit rlim;
       
    11 
       
    12     rlim.rlim_cur = processes;
       
    13     rlim.rlim_max = processes + 24;
       
    14 
       
    15     return setrlimit (RLIMIT_NPROC, &rlim);
       
    16 }