diff options
author | Ulrich Drepper <drepper@redhat.com> | 1999-11-20 05:08:30 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 1999-11-20 05:08:30 +0000 |
commit | 602b6b0fe4976bbb17347fda33e6feac88b91906 (patch) | |
tree | 1f39417bb4058007c0c358de6ebb3334895ec45f | |
parent | 228589d285c9d65e361d52b8de99e81dc7e6cee0 (diff) | |
download | glibc-602b6b0fe4976bbb17347fda33e6feac88b91906.tar glibc-602b6b0fe4976bbb17347fda33e6feac88b91906.tar.gz glibc-602b6b0fe4976bbb17347fda33e6feac88b91906.tar.bz2 glibc-602b6b0fe4976bbb17347fda33e6feac88b91906.zip |
Update.
* sysdeps/unix/sysv/linux/setrlimit.c (__setrlimit): Don't modify
the rlimits structure passed in.
1999-11-19 Andreas Jaeger <aj@suse.de>
* include/sys/resource.h (__setrlimit): Add prototype.
1999-11-19 Ulrich Drepper <drepper@cygnus.com>
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | include/sys/resource.h | 7 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/setrlimit.c | 14 |
3 files changed, 23 insertions, 7 deletions
@@ -1,5 +1,14 @@ 1999-11-19 Ulrich Drepper <drepper@cygnus.com> + * sysdeps/unix/sysv/linux/setrlimit.c (__setrlimit): Don't modify + the rlimits structure passed in. + +1999-11-19 Andreas Jaeger <aj@suse.de> + + * include/sys/resource.h (__setrlimit): Add prototype. + +1999-11-19 Ulrich Drepper <drepper@cygnus.com> + * elf/dl-load.c (_dl_init_paths): Allocate correct number of entries for rtld_search_dirs[0]. Patch by David Mosberger <davidm@hpl.hp.com>. diff --git a/include/sys/resource.h b/include/sys/resource.h index e234cc0426..8877b35f2a 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 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) |