This is the mail archive of the libc-hacker@sourceware.cygnus.com mailing list for the glibc project.
Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
On Sun, Jan 23, 2000 at 05:49:25PM +0100, Thorsten Kukuk wrote:
>
> Hi,
>
> Cristian Gafton, Andreas Schwab, Andreas Jaeger and me have the opinium,
> that we should revert the setrlimit changes for glibc 2.1.3. Which means,
> RedHat and SuSE will ship the next glibc 2.1.3 without the setrlimit
> changes.
>
> The reason is simple: We have a binary incompatiblity between glibc 2.1.3
> and glibc 2.1.2, but no new functionality or bug fixes.
> All Distributors uses the stable 2.2.x kernel, and nobody knows when
> 2.4 is ready. So it doesn't make sense to have unused support for one
> new feature.
>
> Instead, we should try to release glibc 2.1.3 asap. In the moment we
> have enuogh bug fixes. Then we should try to make glibc 2.2 stable
> and release it with kenrel 2.4. In glibc 2.2 we have a lot of new
> features for the new kernel, so we should try to release it at the
> same time, and not months later.
>
> Cristian, I hope the patch is ok for you ?
We have this in the tree (sorry for not posting it here but it was a very
last patch I mailed before I went home).
I have reverted even signedness rlim_t changes because it really does not
fix anything, it is just a new feature, but I have kept the @GLIBC_2.1.3
symbols, so that binaries already compiled against it continue to work and
we don't have to change that symbol in 2.1.90 (but symbols @GLIBC_2.0 are
default).
Unless someone is linked against 2.1.3 symbols, the patch should present one
single difference against glibc 2.1.2 - if glibc 2.1.3 with this patch is
compiled with 2.3.3x+ headers and run with such kernel, one can use
getrlimit64/setrlimit64 to query/set resource limits above 2G on i386/arm
(because those functions are using internally __new_[gs]etrlimit even
in @GLIBC_2.0 symbols).
IMHO no matter which patch is applied to 2.1.3, in 2.1.90
oldsetrlimit64/oldgetrlimit64 should call the __new_* non-LFS functions
internally.
Cheers,
Jakub
___________________________________________________________________
Jakub Jelinek | jakub@redhat.com | http://sunsite.mff.cuni.cz/~jj
Linux version 2.3.40 on a sparc64 machine (1343.49 BogoMips)
___________________________________________________________________
2000-01-21 Jakub Jelinek <jakub@redhat.com>
* sysdeps/unix/sysv/linux/alpha/bits/types.h: Revert rlim_t back to
signed type.
* sysdeps/unix/sysv/linux/mips/bits/types.h: Likewise.
* sysdeps/unix/sysv/linux/sparc/bits/types.h: Likewise.
* sysdeps/unix/sysv/linux/bits/types.h: Likewise.
* sysdeps/unix/sysv/linux/arm/Makefile: Remove oldsetrlimit64.
* sysdeps/unix/sysv/linux/arm/oldsetrlimit64.c: Remove.
* sysdeps/unix/sysv/linux/arm/syscalls.list: Add __getrlimit and
__setrlimit. Make symbols @ GLIBC_2.0 default.
* sysdeps/unix/sysv/linux/i386/syscalls.list: Likewise.
* sysdeps/unix/sysv/linux/i386/bits/resource.h: Remove.
* sysdeps/unix/sysv/linux/i386/getrlimit.c (__new_getrlimit): Adjust
for reverted values of RLIM_INFINITY.
(getrlimit): Make it non-default symbol @ GLIBC_2.1.3.
* sysdeps/unix/sysv/linux/i386/getrlimit64.c (__new_getrlimit64):
New function.
* sysdeps/unix/sysv/linux/i386/oldgetrlimit64.c (__old_getrlimit64):
Use __new_getrlimit, so that if compiled with recent 2.3 kernel, one
can use getrlimit64 to query values above 2G.
* sysdeps/unix/sysv/linux/i386/oldsetrlimit64.c: Remove.
* sysdeps/unix/sysv/linux/i386/setrlimit.c (__new_setrlimit): Adjust
for reverted values of RLIM_INFINITY.
* sysdeps/unix/sysv/linux/i386/setrlimit64.c (__new_setrlimit64):
Merge __old_setrlimit64 with __new_setrlimit64, call
__new_setrlimit, so that limits above 2G are accessible via LFS.
--- libc-2.1/sysdeps/unix/sysv/linux/alpha/bits/types.h.jj Tue Dec 21 11:08:53 1999
+++ libc-2.1/sysdeps/unix/sysv/linux/alpha/bits/types.h Fri Jan 21 17:18:19 2000
@@ -57,8 +57,8 @@ typedef __int64_t __off64_t; /* "" (L
typedef __int64_t __loff_t; /* Type of file sizes and offsets. */
typedef __int32_t __pid_t; /* Type of process identifications. */
typedef __int64_t __ssize_t; /* Type of a byte count, or error. */
-typedef __uint64_t __rlim_t; /* Type of resource counts. */
-typedef __uint64_t __rlim64_t; /* "" (LFS) */
+typedef __int64_t __rlim_t; /* Type of resource counts. */
+typedef __int64_t __rlim64_t; /* "" (LFS) */
typedef __uint32_t __blkcnt_t; /* Type to count nr disk blocks. */
typedef __uint64_t __blkcnt64_t; /* "" (LFS) */
typedef __int32_t __fsblkcnt_t; /* Type to count file system blocks. */
--- libc-2.1/sysdeps/unix/sysv/linux/arm/Makefile.jj Thu Jan 13 09:17:41 2000
+++ libc-2.1/sysdeps/unix/sysv/linux/arm/Makefile Fri Jan 21 18:43:05 2000
@@ -10,5 +10,5 @@ sysdep_routines += rt_sigsuspend rt_sigp
endif
ifeq ($(subdir),resource)
-sysdep_routines += oldgetrlimit64 oldsetrlimit64
+sysdep_routines += oldgetrlimit64
endif
--- libc-2.1/sysdeps/unix/sysv/linux/arm/oldsetrlimit64.c.jj Wed Jan 12 12:54:27 2000
+++ libc-2.1/sysdeps/unix/sysv/linux/arm/oldsetrlimit64.c Fri Jan 21 18:43:47 2000
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/oldsetrlimit64.c>
--- libc-2.1/sysdeps/unix/sysv/linux/arm/syscalls.list.jj Thu Jan 13 09:17:41 2000
+++ libc-2.1/sysdeps/unix/sysv/linux/arm/syscalls.list Fri Jan 21 18:44:41 2000
@@ -12,5 +12,5 @@ s_setresuid setresuid setresuid 3 __sysc
s_setreuid setreuid setreuid 2 __syscall_setreuid
s_setuid setuid setuid 1 __syscall_setuid
syscall - syscall 7 syscall
-oldgetrlimit EXTRA getrlimit 2 __old_getrlimit getrlimit@GLIBC_2.0
-oldsetrlimit EXTRA setrlimit 2 __old_setrlimit setrlimit@GLIBC_2.0
+oldgetrlimit EXTRA getrlimit 2 __old_getrlimit __getrlimit getrlimit@@GLIBC_2.0
+oldsetrlimit EXTRA setrlimit 2 __old_setrlimit __setrlimit setrlimit@@GLIBC_2.0
--- libc-2.1/sysdeps/unix/sysv/linux/bits/types.h.jj Tue Dec 21 11:08:53 1999
+++ libc-2.1/sysdeps/unix/sysv/linux/bits/types.h Fri Jan 21 17:21:35 2000
@@ -68,8 +68,8 @@ typedef long int __off_t; /* Type of fi
typedef __quad_t __loff_t; /* Type of file sizes and offsets. */
typedef int __pid_t; /* Type of process identifications. */
typedef int __ssize_t; /* Type of a byte count, or error. */
-typedef __u_long __rlim_t; /* Type of resource counts. */
-typedef __u_quad_t __rlim64_t; /* Type of resource counts (LFS). */
+typedef long int __rlim_t; /* Type of resource counts. */
+typedef __quad_t __rlim64_t; /* Type of resource counts (LFS). */
typedef __u_int __id_t; /* General type for ID. */
typedef struct
--- libc-2.1/sysdeps/unix/sysv/linux/i386/bits/resource.h.jj Sun Dec 19 00:08:45 1999
+++ libc-2.1/sysdeps/unix/sysv/linux/i386/bits/resource.h Fri Jan 21 17:24:13 2000
@@ -1,205 +0,0 @@
-/* Bit values & structures for resource limits. Linux version.
- Copyright (C) 1994, 1996, 1997, 1998, 1999 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
- modify it under the terms of the GNU Library General Public License as
- published by the Free Software Foundation; either version 2 of the
- License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with the GNU C Library; see the file COPYING.LIB. If not,
- write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#ifndef _SYS_RESOURCE_H
-# error "Never use <bits/resource.h> directly; include <sys/resource.h> instead."
-#endif
-
-#include <bits/types.h>
-
-/* Transmute defines to enumerations. The macro re-definitions are
- necessary because some programs want to test for operating system
- features with #ifdef RUSAGE_SELF. In ISO C the reflexive
- definition is a no-op. */
-
-/* Kinds of resource limit. */
-enum __rlimit_resource
-{
- /* Per-process CPU limit, in seconds. */
- RLIMIT_CPU = 0,
-#define RLIMIT_CPU RLIMIT_CPU
-
- /* Largest file that can be created, in bytes. */
- RLIMIT_FSIZE = 1,
-#define RLIMIT_FSIZE RLIMIT_FSIZE
-
- /* Maximum size of data segment, in bytes. */
- RLIMIT_DATA = 2,
-#define RLIMIT_DATA RLIMIT_DATA
-
- /* Maximum size of stack segment, in bytes. */
- RLIMIT_STACK = 3,
-#define RLIMIT_STACK RLIMIT_STACK
-
- /* Largest core file that can be created, in bytes. */
- RLIMIT_CORE = 4,
-#define RLIMIT_CORE RLIMIT_CORE
-
- /* Largest resident set size, in bytes.
- This affects swapping; processes that are exceeding their
- resident set size will be more likely to have physical memory
- taken from them. */
- RLIMIT_RSS = 5,
-#define RLIMIT_RSS RLIMIT_RSS
-
- /* Number of open files. */
- RLIMIT_NOFILE = 7,
- RLIMIT_OFILE = RLIMIT_NOFILE, /* BSD name for same. */
-#define RLIMIT_NOFILE RLIMIT_NOFILE
-#define RLIMIT_OFILE RLIMIT_OFILE
-
- /* Address space limit. */
- RLIMIT_AS = 9,
-#define RLIMIT_AS RLIMIT_AS
-
- /* Number of processes. */
- RLIMIT_NPROC = 6,
-#define RLIMIT_NPROC RLIMIT_NPROC
-
- /* Locked-in-memory address space. */
- RLIMIT_MEMLOCK = 8,
-#define RLIMIT_MEMLOCK RLIMIT_MEMLOCK
-
- RLIMIT_NLIMITS = 10,
- RLIM_NLIMITS = RLIMIT_NLIMITS
-#define RLIMIT_NLIMITS RLIMIT_NLIMITS
-#define RLIM_NLIMITS RLIM_NLIMITS
-};
-
-/* Value to indicate that there is no limit. */
-#ifndef __USE_FILE_OFFSET64
-# define RLIM_INFINITY ((unsigned long int) (~0UL))
-#else
-# define RLIM_INFINITY 0xffffffffffffffffuLL
-#endif
-
-#ifdef __USE_LARGEFILE64
-# define RLIM64_INFINITY 0xffffffffffffffffuLL
-#endif
-
-/* We can represent all limits. */
-#define RLIM_SAVED_MAX RLIM_INFINITY
-#define RLIM_SAVED_CUR RLIM_INFINITY
-
-
-/* Type for resource quantity measurement. */
-#ifndef __USE_FILE_OFFSET64
-typedef __rlim_t rlim_t;
-#else
-typedef __rlim64_t rlim_t;
-#endif
-#ifdef __USE_LARGEFILE64
-typedef __rlim64_t rlim64_t;
-#endif
-
-struct rlimit
- {
- /* The current (soft) limit. */
- rlim_t rlim_cur;
- /* The hard limit. */
- rlim_t rlim_max;
- };
-
-#ifdef __USE_LARGEFILE64
-struct rlimit64
- {
- /* The current (soft) limit. */
- rlim64_t rlim_cur;
- /* The hard limit. */
- rlim64_t rlim_max;
- };
-#endif
-
-/* Whose usage statistics do you want? */
-enum __rusage_who
-{
- /* The calling process. */
- RUSAGE_SELF = 0,
-#define RUSAGE_SELF RUSAGE_SELF
-
- /* All of its terminated child processes. */
- RUSAGE_CHILDREN = -1,
-#define RUSAGE_CHILDREN RUSAGE_CHILDREN
-
- /* Both. */
- RUSAGE_BOTH = -2
-#define RUSAGE_BOTH RUSAGE_BOTH
-};
-
-#define __need_timeval
-#include <bits/time.h> /* For `struct timeval'. */
-
-/* Structure which says how much of each resource has been used. */
-struct rusage
- {
- /* Total amount of user time used. */
- struct timeval ru_utime;
- /* Total amount of system time used. */
- struct timeval ru_stime;
- /* Maximum resident set size (in kilobytes). */
- long int ru_maxrss;
- /* Amount of sharing of text segment memory
- with other processes (kilobyte-seconds). */
- long int ru_ixrss;
- /* Amount of data segment memory used (kilobyte-seconds). */
- long int ru_idrss;
- /* Amount of stack memory used (kilobyte-seconds). */
- long int ru_isrss;
- /* Number of soft page faults (i.e. those serviced by reclaiming
- a page from the list of pages awaiting reallocation. */
- long int ru_minflt;
- /* Number of hard page faults (i.e. those that required I/O). */
- long int ru_majflt;
- /* Number of times a process was swapped out of physical memory. */
- long int ru_nswap;
- /* Number of input operations via the file system. Note: This
- and `ru_oublock' do not include operations with the cache. */
- long int ru_inblock;
- /* Number of output operations via the file system. */
- long int ru_oublock;
- /* Number of IPC messages sent. */
- long int ru_msgsnd;
- /* Number of IPC messages received. */
- long int ru_msgrcv;
- /* Number of signals delivered. */
- long int ru_nsignals;
- /* Number of voluntary context switches, i.e. because the process
- gave up the process before it had to (usually to wait for some
- resource to be available). */
- long int ru_nvcsw;
- /* Number of involuntary context switches, i.e. a higher priority process
- became runnable or the current process used up its time slice. */
- long int ru_nivcsw;
- };
-
-/* Priority limits. */
-#define PRIO_MIN -20 /* Minimum priority a process can have. */
-#define PRIO_MAX 20 /* Maximum priority a process can have. */
-
-/* The type of the WHICH argument to `getpriority' and `setpriority',
- indicating what flavor of entity the WHO argument specifies. */
-enum __priority_which
-{
- PRIO_PROCESS = 0, /* WHO is a process ID. */
-#define PRIO_PROCESS PRIO_PROCESS
- PRIO_PGRP = 1, /* WHO is a process group ID. */
-#define PRIO_PGRP PRIO_PGRP
- PRIO_USER = 2 /* WHO is a user ID. */
-#define PRIO_USER PRIO_USER
-};
--- libc-2.1/sysdeps/unix/sysv/linux/i386/getrlimit.c.jj Tue Dec 28 11:29:03 1999
+++ libc-2.1/sysdeps/unix/sysv/linux/i386/getrlimit.c Fri Jan 21 18:00:00 2000
@@ -63,17 +63,14 @@ __new_getrlimit (enum __rlimit_resource
/* We might have to correct the limits values. Since the old values
were signed the infinity value is too small. */
- if (rlimits->rlim_cur == RLIM_INFINITY >> 1)
- rlimits->rlim_cur = RLIM_INFINITY;
- if (rlimits->rlim_max == RLIM_INFINITY >> 1)
- rlimits->rlim_max = RLIM_INFINITY;
+ if (rlimits->rlim_cur == RLIM_INFINITY)
+ rlimits->rlim_cur = ~0UL;
+ if (rlimits->rlim_max == RLIM_INFINITY)
+ rlimits->rlim_max = ~0UL;
return result;
}
-weak_alias (__new_getrlimit, __getrlimit);
#if defined PIC && DO_VERSIONING
-default_symbol_version (__new_getrlimit, getrlimit, GLIBC_2.1.3);
-#else
-weak_alias (__new_getrlimit, getrlimit);
+symbol_version (__new_getrlimit, getrlimit, GLIBC_2.1.3);
#endif
--- libc-2.1/sysdeps/unix/sysv/linux/i386/getrlimit64.c.jj Sun Dec 19 00:06:34 1999
+++ libc-2.1/sysdeps/unix/sysv/linux/i386/getrlimit64.c Fri Jan 21 17:58:21 2000
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996, 1997, 1998, 1999 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
@@ -16,13 +16,38 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#define getrlimit64 __new_getrlimit64
+/* This is a compatibility file. If we don't build the libc with
+ versioning don't compile this file. */
+#if defined PIC && DO_VERSIONING
+
+#include <errno.h>
+#include <sys/resource.h>
+#include <sys/types.h>
+
+extern int __new_getrlimit (enum __rlimit_resource, struct rlimit *);
+
+/* Put the soft and hard limits for RESOURCE in *RLIMITS.
+ Returns 0 if successful, -1 if not (and sets errno). */
+int
+__new_getrlimit64 (enum __rlimit_resource resource, struct rlimit64 *rlimits)
+{
+ struct rlimit rlimits32;
+
+ if (__new_getrlimit (resource, &rlimits32) < 0)
+ return -1;
+
+ if (rlimits32.rlim_cur == ~0UL)
+ rlimits->rlim_cur = ~0ULL;
+ else
+ rlimits->rlim_cur = (unsigned long)rlimits32.rlim_cur;
+ if (rlimits32.rlim_max == ~0UL)
+ rlimits->rlim_max = ~0ULL;
+ else
+ rlimits->rlim_max = (unsigned long)rlimits32.rlim_max;
-#include <sysdeps/generic/getrlimit64.c>
+ return 0;
+}
-#undef getrlimit64
-#if defined PIC && defined DO_VERSIONING
-default_symbol_version (__new_getrlimit64, getrlimit64, GLIBC_2.1.3);
-#else
-weak_alias (__new_getrlimit64, getrlimit64);
-#endif
+symbol_version (__new_getrlimit64, getrlimit64, GLIBC_2.1.3);
+
+#endif /* PIC && DO_VERSIONING */
--- libc-2.1/sysdeps/unix/sysv/linux/i386/oldgetrlimit64.c.jj Sun Dec 19 00:06:46 1999
+++ libc-2.1/sysdeps/unix/sysv/linux/i386/oldgetrlimit64.c Fri Jan 21 18:08:34 2000
@@ -16,15 +16,11 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-/* This is a compatibility file. If we don't build the libc with
- versioning don't compile this file. */
-#if defined PIC && DO_VERSIONING
-
#include <errno.h>
#include <sys/resource.h>
#include <sys/types.h>
-extern int __old_getrlimit (enum __rlimit_resource, struct rlimit *);
+extern int __new_getrlimit (enum __rlimit_resource, struct rlimit *);
/* Put the soft and hard limits for RESOURCE in *RLIMITS.
Returns 0 if successful, -1 if not (and sets errno). */
@@ -33,21 +29,23 @@ __old_getrlimit64 (enum __rlimit_resourc
{
struct rlimit rlimits32;
- if (__old_getrlimit (resource, &rlimits32) < 0)
+ if (__new_getrlimit (resource, &rlimits32) < 0)
return -1;
- if (rlimits32.rlim_cur == RLIM_INFINITY >> 1)
- rlimits->rlim_cur = RLIM64_INFINITY >> 1;
+ if (rlimits32.rlim_cur == ~0UL)
+ rlimits->rlim_cur = RLIM64_INFINITY;
else
rlimits->rlim_cur = rlimits32.rlim_cur;
- if (rlimits32.rlim_max == RLIM_INFINITY >> 1)
- rlimits->rlim_max = RLIM64_INFINITY >> 1;
+ if (rlimits32.rlim_max == ~0UL)
+ rlimits->rlim_max = RLIM64_INFINITY;
else
rlimits->rlim_max = rlimits32.rlim_max;
return 0;
}
-symbol_version (__old_getrlimit64, getrlimit64, GLIBC_2.1);
-
+#if defined PIC && DO_VERSIONING
+default_symbol_version (__old_getrlimit64, getrlimit64, GLIBC_2.1);
+#else
+weak_alias (__old_getrlimit64, getrlimit64);
#endif /* PIC && DO_VERSIONING */
--- libc-2.1/sysdeps/unix/sysv/linux/i386/oldsetrlimit64.c.jj Sun Dec 19 00:06:54 1999
+++ libc-2.1/sysdeps/unix/sysv/linux/i386/oldsetrlimit64.c Fri Jan 21 18:30:27 2000
@@ -1,52 +0,0 @@
-/* Copyright (C) 1991, 95, 96, 97, 98, 1999 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
- modify it under the terms of the GNU Library General Public License as
- published by the Free Software Foundation; either version 2 of the
- License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with the GNU C Library; see the file COPYING.LIB. If not,
- write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-/* This is a compatibility file. If we don't build the libc with
- versioning don't compile this file. */
-#if defined PIC && DO_VERSIONING
-
-#include <errno.h>
-#include <sys/resource.h>
-#include <sys/types.h>
-
-extern int __old_setrlimit (enum __rlimit_resource, const struct rlimit *);
-
-/* Set the soft and hard limits for RESOURCE to *RLIMITS.
- Only the super-user can increase hard limits.
- Return 0 if successful, -1 if not (and sets errno). */
-int
-__old_setrlimit64 (enum __rlimit_resource resource,
- const struct rlimit64 *rlimits)
-{
- struct rlimit rlimits32;
-
- if (rlimits->rlim_cur >= RLIM_INFINITY >> 1)
- rlimits32.rlim_cur = RLIM_INFINITY >> 1;
- else
- rlimits32.rlim_cur = rlimits->rlim_cur;
- if (rlimits->rlim_max >= RLIM_INFINITY >> 1)
- rlimits32.rlim_max = RLIM_INFINITY >> 1;
- else
- rlimits32.rlim_max = rlimits->rlim_max;
-
- return __old_setrlimit (resource, &rlimits32);
-}
-
-symbol_version (__old_setrlimit64, setrlimit64, GLIBC_2.1);
-
-#endif /* PIC && DO_VERSIONING */
--- libc-2.1/sysdeps/unix/sysv/linux/i386/setrlimit.c.jj Tue Dec 28 11:29:03 1999
+++ libc-2.1/sysdeps/unix/sysv/linux/i386/setrlimit.c Fri Jan 21 18:25:29 2000
@@ -60,17 +60,14 @@ __new_setrlimit (enum __rlimit_resource
/* We might have to correct the limits values. Since the old values
were signed the new values might be too large. */
rlimits_small.rlim_cur = MIN ((unsigned long int) rlimits->rlim_cur,
- RLIM_INFINITY >> 1);
+ RLIM_INFINITY);
rlimits_small.rlim_max = MIN ((unsigned long int) rlimits->rlim_max,
- RLIM_INFINITY >> 1);
+ RLIM_INFINITY);
/* Use the adjusted values. */
return INLINE_SYSCALL (setrlimit, 2, resource, &rlimits_small);
}
-weak_alias (__new_setrlimit, __setrlimit);
#if defined PIC && DO_VERSIONING
-default_symbol_version (__new_setrlimit, setrlimit, GLIBC_2.1.3);
-#else
-weak_alias (__new_setrlimit, setrlimit);
+symbol_version (__new_setrlimit, setrlimit, GLIBC_2.1.3);
#endif
--- libc-2.1/sysdeps/unix/sysv/linux/i386/setrlimit64.c.jj Sun Dec 19 00:07:14 1999
+++ libc-2.1/sysdeps/unix/sysv/linux/i386/setrlimit64.c Fri Jan 21 18:33:28 2000
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 95, 96, 97, 98, 99, 2000 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
@@ -16,13 +16,38 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#define setrlimit64 __new_setrlimit64
-#include <sysdeps/generic/setrlimit64.c>
-
-#undef setrlimit64
-#if defined PIC && defined DO_VERSIONING
-default_symbol_version (__new_setrlimit64, setrlimit64, GLIBC_2.1.3);
+#include <errno.h>
+#include <sys/resource.h>
+#include <sys/types.h>
+
+extern int __new_setrlimit (enum __rlimit_resource, const struct rlimit *);
+
+/* Set the soft and hard limits for RESOURCE to *RLIMITS.
+ Only the super-user can increase hard limits.
+ Return 0 if successful, -1 if not (and sets errno). */
+int
+__new_setrlimit64 (enum __rlimit_resource resource,
+ const struct rlimit64 *rlimits)
+{
+ struct rlimit rlimits32;
+
+ if (rlimits->rlim_cur >= ~0UL)
+ rlimits32.rlim_cur = ~0UL;
+ else
+ rlimits32.rlim_cur = rlimits->rlim_cur;
+ if (rlimits->rlim_max >= ~0UL)
+ rlimits32.rlim_max = ~0UL;
+ else
+ rlimits32.rlim_max = rlimits->rlim_max;
+
+ return __new_setrlimit (resource, &rlimits32);
+}
+
+#if defined PIC && DO_VERSIONING
+default_symbol_version (__new_setrlimit64, setrlimit64, GLIBC_2.1);
+weak_alias (__new_setrlimit64, __old_setrlimit64);
+symbol_version (__old_setrlimit64, setrlimit64, GLIBC_2.1.3);
#else
weak_alias (__new_setrlimit64, setrlimit64);
-#endif
+#endif /* PIC && DO_VERSIONING */
--- libc-2.1/sysdeps/unix/sysv/linux/i386/syscalls.list.jj Tue Dec 21 11:08:53 1999
+++ libc-2.1/sysdeps/unix/sysv/linux/i386/syscalls.list Fri Jan 21 18:36:47 2000
@@ -2,5 +2,5 @@
modify_ldt EXTRA modify_ldt 3 __modify_ldt modify_ldt
vm86 - vm86 1 __vm86 vm86
-oldgetrlimit EXTRA getrlimit 2 __old_getrlimit getrlimit@GLIBC_2.0
-oldsetrlimit EXTRA setrlimit 2 __old_setrlimit setrlimit@GLIBC_2.0
+oldgetrlimit EXTRA getrlimit 2 __old_getrlimit __getrlimit getrlimit@@GLIBC_2.0
+oldsetrlimit EXTRA setrlimit 2 __old_setrlimit __setrlimit setrlimit@@GLIBC_2.0
--- libc-2.1/sysdeps/unix/sysv/linux/mips/bits/types.h.jj Tue Dec 21 11:08:53 1999
+++ libc-2.1/sysdeps/unix/sysv/linux/mips/bits/types.h Fri Jan 21 18:38:54 2000
@@ -68,8 +68,8 @@ typedef long int __off_t; /* Type of fi
typedef __quad_t __loff_t; /* Type of file sizes and offsets. */
typedef int __pid_t; /* Type of process identifications. */
typedef int __ssize_t; /* Type of a byte count, or error. */
-typedef __u_long __rlim_t; /* Type of resource counts. */
-typedef __u_quad_t __rlim64_t; /* Type of resource counts (LFS). */
+typedef long int __rlim_t; /* Type of resource counts. */
+typedef __quad_t __rlim64_t; /* Type of resource counts (LFS). */
typedef __u_int __id_t; /* General type for ID. */
typedef struct
--- libc-2.1/sysdeps/unix/sysv/linux/sparc/bits/types.h.jj Tue Dec 21 11:08:53 1999
+++ libc-2.1/sysdeps/unix/sysv/linux/sparc/bits/types.h Fri Jan 21 18:41:12 2000
@@ -85,8 +85,8 @@ typedef long long int __ssize_t; /* Type
#else
typedef int __ssize_t; /* Type of a byte count, or error. */
#endif
-typedef __u_long __rlim_t; /* Type of resource counts. */
-typedef __u_quad_t __rlim64_t; /* Type of resource counts (LFS). */
+typedef long int __rlim_t; /* Type of resource counts. */
+typedef __quad_t __rlim64_t; /* Type of resource counts (LFS). */
typedef __u_int __id_t; /* General type for IDs. */
typedef struct
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |