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
}