2 * PerlXS module for managing process limits
4 * (c) 2003 Tomas Valla <tom@ucw.cz>
11 #include <sys/resource.h>
15 MODULE = UCW::Ulimit PACKAGE = UCW::Ulimit
20 setlimit(IN int resource, IN int soft, IN int hard)
27 r = RLIMIT_CPU; break;
29 r = RLIMIT_FSIZE; break;
31 r = RLIMIT_DATA; break;
33 r = RLIMIT_STACK; break;
35 r = RLIMIT_CORE; break;
37 r = RLIMIT_RSS; break;
39 r = RLIMIT_NPROC; break;
41 r = RLIMIT_NOFILE; break;
43 r = RLIMIT_MEMLOCK; break;
49 RETVAL = setrlimit(r, &rl);
55 getlimit(IN int resource, OUT int soft, OUT int hard)
62 r = RLIMIT_CPU; break;
64 r = RLIMIT_FSIZE; break;
66 r = RLIMIT_DATA; break;
68 r = RLIMIT_STACK; break;
70 r = RLIMIT_CORE; break;
72 r = RLIMIT_RSS; break;
74 r = RLIMIT_NPROC; break;
76 r = RLIMIT_NOFILE; break;
78 r = RLIMIT_MEMLOCK; break;
83 RETVAL = getrlimit(r, &rl);