mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-30 22:43:12 +03:00
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>
This commit is contained in:
@ -1,3 +1,12 @@
|
|||||||
|
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>
|
1999-11-19 Ulrich Drepper <drepper@cygnus.com>
|
||||||
|
|
||||||
* elf/dl-load.c (_dl_init_paths): Allocate correct number of
|
* elf/dl-load.c (_dl_init_paths): Allocate correct number of
|
||||||
|
@ -3,6 +3,9 @@
|
|||||||
|
|
||||||
/* Now define the internal interfaces. */
|
/* Now define the internal interfaces. */
|
||||||
extern int __getrlimit (enum __rlimit_resource __resource,
|
extern int __getrlimit (enum __rlimit_resource __resource,
|
||||||
struct rlimit *__rlimits) __THROW;
|
struct rlimit *__rlimits);
|
||||||
extern int __getrusage (enum __rusage_who __who, struct rusage *__usage) __THROW;
|
extern int __getrusage (enum __rusage_who __who, struct rusage *__usage);
|
||||||
|
|
||||||
|
extern int __setrlimit (enum __rlimit_resource __resource,
|
||||||
|
const struct rlimit *__rlimits);
|
||||||
#endif
|
#endif
|
||||||
|
@ -41,6 +41,10 @@ __setrlimit (resource, rlimits)
|
|||||||
enum __rlimit_resource resource;
|
enum __rlimit_resource resource;
|
||||||
const struct rlimit *rlimits;
|
const struct rlimit *rlimits;
|
||||||
{
|
{
|
||||||
|
#ifndef __ASSUME_NEW_GETRLIMIT_SYSCALL
|
||||||
|
struct rlimit rlimits_small;
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef __NR_ugetrlimit
|
#ifdef __NR_ugetrlimit
|
||||||
if (! no_new_getrlimit)
|
if (! no_new_getrlimit)
|
||||||
{
|
{
|
||||||
@ -62,13 +66,13 @@ __setrlimit (resource, rlimits)
|
|||||||
#ifndef __ASSUME_NEW_GETRLIMIT_SYSCALL
|
#ifndef __ASSUME_NEW_GETRLIMIT_SYSCALL
|
||||||
/* We might have to correct the limits values. Since the old values
|
/* We might have to correct the limits values. Since the old values
|
||||||
were signed the new values are too large. */
|
were signed the new values are too large. */
|
||||||
rlimits->rlim_cur = MIN ((unsigned long int) rlimits->rlim_cur,
|
rlimits_small.rlim_cur = MIN ((unsigned long int) rlimits->rlim_cur,
|
||||||
RLIM_INFINITY >> 2);
|
RLIM_INFINITY >> 2);
|
||||||
rlimits->rlim_max = MIN ((unsigned long int) rlimits->rlim_max,
|
rlimits_small.rlim_max = MIN ((unsigned long int) rlimits->rlim_max,
|
||||||
RLIM_INFINITY >> 2);
|
RLIM_INFINITY >> 2);
|
||||||
|
|
||||||
/* Fall back on the old system call. */
|
/* Fall back on the old system call. */
|
||||||
return INLINE_SYSCALL (setrlimit, 2, resource, rlimits);
|
return INLINE_SYSCALL (setrlimit, 2, resource, &rlimits_small);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
weak_alias (__setrlimit, setrlimit)
|
weak_alias (__setrlimit, setrlimit)
|
||||||
|
Reference in New Issue
Block a user