diff options
Diffstat (limited to 'sysdeps')
-rw-r--r-- | sysdeps/unix/sysv/linux/setrlimit.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/sysdeps/unix/sysv/linux/setrlimit.c b/sysdeps/unix/sysv/linux/setrlimit.c index 9df977447a..43bfdbbbc4 100644 --- a/sysdeps/unix/sysv/linux/setrlimit.c +++ b/sysdeps/unix/sysv/linux/setrlimit.c @@ -41,6 +41,10 @@ __setrlimit (resource, rlimits) enum __rlimit_resource resource; const struct rlimit *rlimits; { +#ifndef __ASSUME_NEW_GETRLIMIT_SYSCALL + struct rlimit rlimits_small; +#endif + #ifdef __NR_ugetrlimit if (! no_new_getrlimit) { @@ -62,13 +66,13 @@ __setrlimit (resource, rlimits) #ifndef __ASSUME_NEW_GETRLIMIT_SYSCALL /* We might have to correct the limits values. Since the old values were signed the new values are too large. */ - rlimits->rlim_cur = MIN ((unsigned long int) rlimits->rlim_cur, - RLIM_INFINITY >> 2); - rlimits->rlim_max = MIN ((unsigned long int) rlimits->rlim_max, - RLIM_INFINITY >> 2); + rlimits_small.rlim_cur = MIN ((unsigned long int) rlimits->rlim_cur, + RLIM_INFINITY >> 2); + rlimits_small.rlim_max = MIN ((unsigned long int) rlimits->rlim_max, + RLIM_INFINITY >> 2); /* Fall back on the old system call. */ - return INLINE_SYSCALL (setrlimit, 2, resource, rlimits); + return INLINE_SYSCALL (setrlimit, 2, resource, &rlimits_small); #endif } weak_alias (__setrlimit, setrlimit) |