-static void setrl(int r, long lim) {
- struct rlimit rl;
-
- if (getrlimit(r, &rl))
- t_error("getrlimit %d: %s\n", r, strerror(errno));
- rl.rlim_cur = lim;
- if (lim < rl.rlim_max)
- rl.rlim_max = lim;
- if (setrlimit(r, &rl))
- t_error("setrlimit %d: %s\n", r, strerror(errno));
-}
-