author | Markus Bröker <mbroeker@largo.dyndns.tv> |
Sat, 13 Dec 2008 17:58:03 +0100 | |
changeset 10 | f19f44e2e863 |
parent 9 | c3fecc82ade6 |
permissions | -rw-r--r-- |
0 | 1 |
/** |
9
c3fecc82ade6
standard tags for git projects
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
0
diff
changeset
|
2 |
* test/demos/ddos/set_limit.c |
c3fecc82ade6
standard tags for git projects
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
0
diff
changeset
|
3 |
* Copyright (C) 2008 Markus Broeker |
0 | 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; |
|
10
f19f44e2e863
a nice connection demo from an irc user
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
9
diff
changeset
|
14 |
|
0 | 15 |
return setrlimit (RLIMIT_NPROC, &rlim); |
16 |
} |