From: Ulrich Drepper Date: Sat, 20 Nov 1999 05:08:30 +0000 (+0000) Subject: Update. X-Git-Tag: upstream/2.30~26558 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=602b6b0fe4976bbb17347fda33e6feac88b91906;p=external%2Fglibc.git Update. * sysdeps/unix/sysv/linux/setrlimit.c (__setrlimit): Don't modify the rlimits structure passed in. 1999-11-19 Andreas Jaeger * include/sys/resource.h (__setrlimit): Add prototype. 1999-11-19 Ulrich Drepper --- diff --git a/ChangeLog b/ChangeLog index 10244c7..08a8ea9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,14 @@ 1999-11-19 Ulrich Drepper + * sysdeps/unix/sysv/linux/setrlimit.c (__setrlimit): Don't modify + the rlimits structure passed in. + +1999-11-19 Andreas Jaeger + + * include/sys/resource.h (__setrlimit): Add prototype. + +1999-11-19 Ulrich Drepper + * elf/dl-load.c (_dl_init_paths): Allocate correct number of entries for rtld_search_dirs[0]. Patch by David Mosberger . diff --git a/include/sys/resource.h b/include/sys/resource.h index e234cc0..8877b35 100644 --- a/include/sys/resource.h +++ b/include/sys/resource.h @@ -3,6 +3,9 @@ /* Now define the internal interfaces. */ extern int __getrlimit (enum __rlimit_resource __resource, - struct rlimit *__rlimits) __THROW; -extern int __getrusage (enum __rusage_who __who, struct rusage *__usage) __THROW; + struct rlimit *__rlimits); +extern int __getrusage (enum __rusage_who __who, struct rusage *__usage); + +extern int __setrlimit (enum __rlimit_resource __resource, + const struct rlimit *__rlimits); #endif diff --git a/sysdeps/unix/sysv/linux/setrlimit.c b/sysdeps/unix/sysv/linux/setrlimit.c index 9df9774..43bfdbb 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)