2 #include <sys/resource.h>
5 #define FIX(x) do{ if ((x)>=SYSCALL_RLIM_INFINITY) (x)=RLIM_INFINITY; }while(0)
7 int prlimit(pid_t pid
, int resource
, const struct rlimit
*new_limit
, struct rlimit
*old_limit
)
11 if (new_limit
&& SYSCALL_RLIM_INFINITY
!= RLIM_INFINITY
) {
17 r
= syscall(SYS_prlimit64
, pid
, resource
, new_limit
, old_limit
);
18 if (!r
&& old_limit
&& SYSCALL_RLIM_INFINITY
!= RLIM_INFINITY
) {
19 FIX(old_limit
->rlim_cur
);
20 FIX(old_limit
->rlim_max
);
26 weak_alias(prlimit
, prlimit64
);