diff options
author | Ulrich Drepper <drepper@redhat.com> | 2001-09-25 03:04:41 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2001-09-25 03:04:41 +0000 |
commit | 61423e13e519c41c49adcdd8d1259a8213a5fded (patch) | |
tree | ad0accd2407bf0d15e276e1d72caf5132a794177 /sysdeps/unix/sysv/linux/ulimit.c | |
parent | 8db6604d862909a10643e051f73795cbdaa1a8d5 (diff) | |
download | glibc-61423e13e519c41c49adcdd8d1259a8213a5fded.tar.gz glibc-61423e13e519c41c49adcdd8d1259a8213a5fded.tar.xz glibc-61423e13e519c41c49adcdd8d1259a8213a5fded.zip |
Update.
* sysdeps/unix/sysv/linux/ulimit.c (__ulimit): Handle overflow in UL_SETFSIZE computations better. * string/Versions: Export __strsep for GLIBC_2.2.5. * string/bits/string2.h: Define all __STRING_INLINE functions if _FORCE_INLINES is defined. Use int instead of char of parameter types. (__strsep): Don't use __strsep_g. Don't define it. (__strsep_1c, __strsep_2c, __strsep_3c): Optimize. * sysdeps/i386/i486/string.h (__strcpy_a_small): Renamed from __strcpy_small. (__stpcpy_a_small): Renamed from __stpcpy_small. (__strcspn_c1): Don't define if _FORCE_INLINES. (__strspn_c1): Likewise. 2001-09-22 Ben Collins <bcollins@debian.org> * sysdeps/sparc/bits/sigaction.h: Define SA_RESTART and friends when _UNIX98_SOURCE is defined too. Matches generic/bits/sigaction.h. * sysdeps/ia64/bits/sigaction.h: Likewise. * sysdeps/s390/s390-64/bits/sigaction.h: Likewise. 2001-09-24 Andrew Haley <aph@cambridge.redhat.com> * sysdeps/unix/sysv/linux/sh/Makefile (sysdep_headers): Add sys/io.h. 2001-09-24 Jakub Jelinek <jakub@redhat.com> * elf/dl-open.c (dl_open_worker): Update l_scope_max. 2001-09-24 Ulrich Drepper <drepper@redhat.com>
Diffstat (limited to 'sysdeps/unix/sysv/linux/ulimit.c')
-rw-r--r-- | sysdeps/unix/sysv/linux/ulimit.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/sysdeps/unix/sysv/linux/ulimit.c b/sysdeps/unix/sysv/linux/ulimit.c index c2481f5c8a..9c309c371d 100644 --- a/sysdeps/unix/sysv/linux/ulimit.c +++ b/sysdeps/unix/sysv/linux/ulimit.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991,92,94,95,96,97,98,2000 Free Software Foundation, Inc. +/* Copyright (C) 1991,92,1994-1998,2000,2001 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -55,8 +55,16 @@ __ulimit (int cmd, ...) { long int newlimit = va_arg (va, long int); - limit.rlim_cur = newlimit * 512; - limit.rlim_max = newlimit * 512; + if ((rlim_t) newlimit > RLIM_INFINITY / 512) + { + limit.rlim_cur = RLIM_INFINITY; + limit.rlim_max = RLIM_INFINITY; + } + else + { + limit.rlim_cur = newlimit * 512; + limit.rlim_max = newlimit * 512; + } result = __setrlimit (RLIMIT_FSIZE, &limit); } |