ddos/set_limit.c
changeset 68 d549894aa6a9
parent 67 abe63a276a36
child 69 b5912e5f899f
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_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 }