]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Consolidate Linux setrlimit and getrlimit implementation
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Tue, 18 Oct 2016 11:41:56 +0000 (09:41 -0200)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Thu, 17 Nov 2016 17:54:22 +0000 (15:54 -0200)
This patch consolidates all Linux setrlimit and getrlimit on the default
sysdeps/unix/sysv/linux/{set,get}rlimit{64}.c.  It contains two exceptions:

  1. mips32 and mips64n32 which requires a versioned symbol for GLIBC 2.19
     and higher due a broken RLIM64_INFINITY constant.
  2. sparc32 does not define a compat symbol for getrlimit64 for old 2GB
     limit. I am not sure if it is required, but a RLIM_INFINITY fix [1]
     change its definition without adding a compat symbol.  This patch does
     not aim to address this possible issue, it follow current symbol
     export.

The default implementation uses prlimit64 for 64 bit rlim_t ({set,get}rlimit64)
and if it fails with ENOSYS it fall back to {get,set}rlimit syscall.  This
code path is only used on kernel older than 2.6.36 (basically now only x86)
and I avoid to user __ASSUME_PRLIMTI64 to simplify the implementation.  Once
x86 moves to be on par with other architectures regarding minimum kernel
supported we can get rid of using old syscalls and default path.

A new type size define is added, __RLIM_T_MATCHES_RLIM64_T, where is set as
default for 64 bits ports.  This allows the default implementation to avoid
{get,set}rlimit building and alias {get,set}rlimit64 to {get,set}rlimit.

Checked on x86_64, i386, armhf, aarch64, and powerpc64le.  I also did a
sanity build plus check-abi on all other supported architectures.

[1] Commit 9c96ff23858b0759e12ad69e3c4599931c90bee8

Adhemerval Zanella  <adhemerval.zanella@linaro.org>
Yury Norov  <ynorov@caviumnetworks.com>

* bits/typesizes.h (__RLIM_T_MATCHES_RLIM64_T): define.
* sysdeps/unix/sysv/linux/alpha/bits/typesizes.h
(__RLIM_T_MATCHES_RLIM64_T): Likewise.
* sysdeps/unix/sysv/linux/generic/bits/typesizes.h
(__RLIM_T_MATCHES_RLIM64_T): Likewise.
* sysdeps/unix/sysv/linux/s390/bits/typesizes.h [__s390x__]
(__RLIM_T_MATCHES_RLIM64_T): Likewise.
* sysdeps/unix/sysv/linux/sparc/bits/typesizes.h
[__arch64__ || __sparcv9] (__RLIM_T_MATCHES_RLIM64_T): Likewise.
* sysdeps/unix/sysv/linux/x86/bits/typesizes.h [__86_64__]
(__RLIM_T_MATCHES_RLIM64_T): Likewise.
* sysdeps/unix/sysv/linux/arm/Makefile [$(subdir) = resource]
(sysdep_routines): Remove oldgetrlimit64.
* sysdeps/unix/sysv/linux/i386/Makefile [$(subdir) = resource]
(sysdep_routines): Likewise.
* sysdeps/unix/sysv/linux/m68k/Makefile [$(subdir) = resource]
(sysdep_routines): Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/Makefile
[$(subdir) = resource] (sysdep_routines): Likewise.
* sysdeps/unix/sysv/linux/s390/s390-32/Makefile
[$(subdir) = resource] (sysdep_routines): Likewise.
* sysdeps/unix/sysv/linux/arm/getrlimit64.c: Remove file.
* sysdeps/unix/sysv/linux/arm/oldgetrlimit64.c: Likewise.
* sysdeps/unix/sysv/linux/hppa/getrlimit64.c: Likewise.
* sysdeps/unix/sysv/linux/i386/getrlimit64.c: Likewise.
* sysdeps/unix/sysv/linux/i386/oldgetrlimit64.c: Likewise.
* sysdeps/unix/sysv/linux/m68k/getrlimit64.c: Likewise.
* sysdeps/unix/sysv/linux/m68k/oldgetrlimit64.c: Likewise.
* sysdeps/unix/sysv/linux/powerpc/getrlimit64.c: Likewise.
* sysdeps/unix/sysv/linux/powerpc/oldgetrlimit64.c: Likewise.
* sysdeps/unix/sysv/linux/s390/s390-32/getrlimit64.c: Likewise.
* sysdeps/unix/sysv/linux/s390/s390-32/oldgetrlimit64.c: Likewise.
* sysdeps/unix/sysv/linux/sh/getrlimit64.c: Likewise.
* sysdeps/unix/sysv/linux/wordsize-64/getrlimit64.c: Likewise.
* sysdeps/unix/sysv/linux/wordsize-64/setrlimit64.c: Likewise.
* sysdeps/sysv/linux/generic/wordsize-32/syscalls.list: Remove
setrlimit and getrlimit.
* sysdeps/unix/sysv/linux/hppa/syscalls.list: Likewise.
* sysdeps/unix/sysv/linux/i386/syscalls.list: Likewise.
* sysdeps/unix/sysv/linux/m68k/m680x0/syscalls.list: Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/syscalls.list: Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/syscalls.list: Likewise.
* sysdeps/unix/sysv/linux/s390/s390-32/syscalls.list: Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc32/syscalls.list: Likewise.
* sysdeps/unix/sysv/linux/syscalls.list: Likewise.
* sysdeps/unix/sysv/linux/wordsize-64/syscalls.list: Likewise.
* sysdeps/unix/sysv/linux/getrlimit.c: New file.
* sysdeps/unix/sysv/linux/sparc/getrlimit64.c: Likewise.
* sysdeps/unix/sysv/linux/setrlimit.c: Likewise.
* sysdeps/unix/sysv/linux/getrlimit64.c (__getrlimit64): Handle
__RLIM_T_MATCHES_RLIM64_T and add alias if defined.
(__old_getrlimit64): Add compatibility symbol.
* sysdeps/unix/sysv/linux/setrlimit64.c (__setrlimit): Likewise.

42 files changed:
ChangeLog
bits/typesizes.h
sysdeps/unix/sysv/linux/alpha/bits/typesizes.h
sysdeps/unix/sysv/linux/arm/Makefile
sysdeps/unix/sysv/linux/arm/getrlimit64.c [deleted file]
sysdeps/unix/sysv/linux/arm/oldgetrlimit.c [deleted file]
sysdeps/unix/sysv/linux/arm/oldgetrlimit64.c [deleted file]
sysdeps/unix/sysv/linux/arm/oldsetrlimit.c [deleted file]
sysdeps/unix/sysv/linux/generic/bits/typesizes.h
sysdeps/unix/sysv/linux/generic/wordsize-32/syscalls.list
sysdeps/unix/sysv/linux/getrlimit.c [new file with mode: 0644]
sysdeps/unix/sysv/linux/getrlimit64.c
sysdeps/unix/sysv/linux/hppa/getrlimit64.c [deleted file]
sysdeps/unix/sysv/linux/hppa/syscalls.list
sysdeps/unix/sysv/linux/i386/Makefile
sysdeps/unix/sysv/linux/i386/oldgetrlimit64.c [deleted file]
sysdeps/unix/sysv/linux/i386/syscalls.list
sysdeps/unix/sysv/linux/m68k/Makefile
sysdeps/unix/sysv/linux/m68k/getrlimit64.c [deleted file]
sysdeps/unix/sysv/linux/m68k/m680x0/syscalls.list [deleted file]
sysdeps/unix/sysv/linux/m68k/oldgetrlimit64.c [deleted file]
sysdeps/unix/sysv/linux/powerpc/getrlimit64.c [deleted file]
sysdeps/unix/sysv/linux/powerpc/oldgetrlimit64.c [deleted file]
sysdeps/unix/sysv/linux/powerpc/powerpc32/Makefile
sysdeps/unix/sysv/linux/powerpc/powerpc32/syscalls.list
sysdeps/unix/sysv/linux/powerpc/powerpc64/syscalls.list [deleted file]
sysdeps/unix/sysv/linux/s390/bits/typesizes.h
sysdeps/unix/sysv/linux/s390/s390-32/Makefile
sysdeps/unix/sysv/linux/s390/s390-32/getrlimit64.c [deleted file]
sysdeps/unix/sysv/linux/s390/s390-32/oldgetrlimit64.c [deleted file]
sysdeps/unix/sysv/linux/s390/s390-32/syscalls.list
sysdeps/unix/sysv/linux/setrlimit.c [new file with mode: 0644]
sysdeps/unix/sysv/linux/setrlimit64.c
sysdeps/unix/sysv/linux/sh/getrlimit64.c [deleted file]
sysdeps/unix/sysv/linux/sparc/bits/typesizes.h
sysdeps/unix/sysv/linux/sparc/getrlimit64.c [moved from sysdeps/unix/sysv/linux/i386/getrlimit64.c with 74% similarity]
sysdeps/unix/sysv/linux/sparc/sparc32/syscalls.list
sysdeps/unix/sysv/linux/syscalls.list
sysdeps/unix/sysv/linux/wordsize-64/getrlimit64.c [deleted file]
sysdeps/unix/sysv/linux/wordsize-64/setrlimit64.c [deleted file]
sysdeps/unix/sysv/linux/wordsize-64/syscalls.list
sysdeps/unix/sysv/linux/x86/bits/typesizes.h

index 721ea68d24fb1a3df0145cfbd9082bbd337487eb..330a63133188ba50257e01bc9c75266f4b85b71c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,62 @@
+2016-11-17  Adhemerval Zanella  <adhemerval.zanella@linaro.org>
+           Yury Norov  <ynorov@caviumnetworks.com>
+
+       * bits/typesizes.h (__RLIM_T_MATCHES_RLIM64_T): define.
+       * sysdeps/unix/sysv/linux/alpha/bits/typesizes.h
+       (__RLIM_T_MATCHES_RLIM64_T): Likewise.
+       * sysdeps/unix/sysv/linux/generic/bits/typesizes.h
+       (__RLIM_T_MATCHES_RLIM64_T): Likewise.
+       * sysdeps/unix/sysv/linux/s390/bits/typesizes.h [__s390x__]
+       (__RLIM_T_MATCHES_RLIM64_T): Likewise.
+       * sysdeps/unix/sysv/linux/sparc/bits/typesizes.h
+       [__arch64__ || __sparcv9] (__RLIM_T_MATCHES_RLIM64_T): Likewise.
+       * sysdeps/unix/sysv/linux/x86/bits/typesizes.h [__86_64__]
+       (__RLIM_T_MATCHES_RLIM64_T): Likewise.
+       * sysdeps/unix/sysv/linux/arm/Makefile [$(subdir) = resource]
+       (sysdep_routines): Remove oldgetrlimit64.
+       * sysdeps/unix/sysv/linux/i386/Makefile [$(subdir) = resource]
+       (sysdep_routines): Likewise.
+       * sysdeps/unix/sysv/linux/m68k/Makefile [$(subdir) = resource]
+       (sysdep_routines): Likewise.
+       * sysdeps/unix/sysv/linux/powerpc/powerpc32/Makefile
+       [$(subdir) = resource] (sysdep_routines): Likewise.
+       * sysdeps/unix/sysv/linux/s390/s390-32/Makefile
+       [$(subdir) = resource] (sysdep_routines): Likewise.
+       * sysdeps/unix/sysv/linux/arm/getrlimit64.c: Remove file.
+       * sysdeps/unix/sysv/linux/arm/oldgetrlimit64.c: Likewise.
+       * sysdeps/unix/sysv/linux/arm/oldgetrlimit.c: Likewise.
+       * sysdeps/unix/sysv/linux/arm/oldsetrlimit.c: Likewise.
+       * sysdeps/unix/sysv/linux/hppa/getrlimit64.c: Likewise.
+       * sysdeps/unix/sysv/linux/i386/getrlimit64.c: Likewise.
+       * sysdeps/unix/sysv/linux/i386/oldgetrlimit64.c: Likewise.
+       * sysdeps/unix/sysv/linux/m68k/getrlimit64.c: Likewise.
+       * sysdeps/unix/sysv/linux/m68k/oldgetrlimit64.c: Likewise.
+       * sysdeps/unix/sysv/linux/powerpc/getrlimit64.c: Likewise.
+       * sysdeps/unix/sysv/linux/powerpc/oldgetrlimit64.c: Likewise.
+       * sysdeps/unix/sysv/linux/s390/s390-32/getrlimit64.c: Likewise.
+       * sysdeps/unix/sysv/linux/s390/s390-32/oldgetrlimit64.c: Likewise.
+       * sysdeps/unix/sysv/linux/sh/getrlimit64.c: Likewise.
+       * sysdeps/unix/sysv/linux/wordsize-64/getrlimit64.c: Likewise.
+       * sysdeps/unix/sysv/linux/wordsize-64/setrlimit64.c: Likewise.
+       * sysdeps/sysv/linux/generic/wordsize-32/syscalls.list: Remove
+       setrlimit and getrlimit.
+       * sysdeps/unix/sysv/linux/hppa/syscalls.list: Likewise.
+       * sysdeps/unix/sysv/linux/i386/syscalls.list: Likewise.
+       * sysdeps/unix/sysv/linux/m68k/m680x0/syscalls.list: Likewise.
+       * sysdeps/unix/sysv/linux/powerpc/powerpc32/syscalls.list: Likewise.
+       * sysdeps/unix/sysv/linux/powerpc/powerpc64/syscalls.list: Likewise.
+       * sysdeps/unix/sysv/linux/s390/s390-32/syscalls.list: Likewise.
+       * sysdeps/unix/sysv/linux/sparc/sparc32/syscalls.list: Likewise.
+       * sysdeps/unix/sysv/linux/syscalls.list: Likewise.
+       * sysdeps/unix/sysv/linux/wordsize-64/syscalls.list: Likewise.
+       * sysdeps/unix/sysv/linux/getrlimit.c: New file.
+       * sysdeps/unix/sysv/linux/sparc/getrlimit64.c: Likewise.
+       * sysdeps/unix/sysv/linux/setrlimit.c: Likewise.
+       * sysdeps/unix/sysv/linux/getrlimit64.c (__getrlimit64): Handle
+       __RLIM_T_MATCHES_RLIM64_T and add alias if defined.
+       (__old_getrlimit64): Add compatibility symbol.
+       * sysdeps/unix/sysv/linux/setrlimit64.c (__setrlimit): Likewise.
+
 2016-11-17  Joseph Myers  <joseph@codesourcery.com>
 
        * scripts/build-many-glibcs.py (Config.build_gcc): Configure with
index 53047b853163bb887fb0be6628d0e40f646a0e54..ff20601046a1ab6f3ab9c7942a127f4ed10aaa4e 100644 (file)
 
 /* Same for ino_t and ino64_t.  */
 # define __INO_T_MATCHES_INO64_T       1
+
+/* And for rlim_t and rlim64_t.  */
+# define __RLIM_T_MATCHES_RLIM64_T     1
+#else
+# define __RLIM_T_MATCHES_RLIM64_T     0
 #endif
 
 /* Number of descriptors that can fit in an `fd_set'.  */
index 3cfd887c39144e72241c921b146ae8c981e10a7c..ce96501bdbecb2fdc33c11170470720cdd06705e 100644 (file)
@@ -66,6 +66,9 @@
    for C type-checking purposes.  */
 #define __OFF_T_MATCHES_OFF64_T        1
 
+/* And for __rlim_t and __rlim64_t.  */
+#define __RLIM_T_MATCHES_RLIM64_T 1
+
 /* Number of descriptors that can fit in an `fd_set'.  */
 #define        __FD_SETSIZE            1024
 
index 270cb73f70e5b87f0372f02824fa488bd08fb35b..b9b8f7172195e245560118fc166f409e78c6fd6c 100644 (file)
@@ -12,10 +12,6 @@ ifeq ($(subdir),signal)
 sysdep_routines += sigrestorer
 endif
 
-ifeq ($(subdir),resource)
-sysdep_routines += oldgetrlimit64
-endif
-
 ifeq ($(subdir),stdlib)
 gen-as-const-headers += ucontext_i.sym
 endif
diff --git a/sysdeps/unix/sysv/linux/arm/getrlimit64.c b/sysdeps/unix/sysv/linux/arm/getrlimit64.c
deleted file mode 100644 (file)
index fef018f..0000000
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/getrlimit64.c>
diff --git a/sysdeps/unix/sysv/linux/arm/oldgetrlimit.c b/sysdeps/unix/sysv/linux/arm/oldgetrlimit.c
deleted file mode 100644 (file)
index 6e25b02..0000000
+++ /dev/null
@@ -1 +0,0 @@
-/* Empty.  */
diff --git a/sysdeps/unix/sysv/linux/arm/oldgetrlimit64.c b/sysdeps/unix/sysv/linux/arm/oldgetrlimit64.c
deleted file mode 100644 (file)
index 4c27e95..0000000
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/oldgetrlimit64.c>
diff --git a/sysdeps/unix/sysv/linux/arm/oldsetrlimit.c b/sysdeps/unix/sysv/linux/arm/oldsetrlimit.c
deleted file mode 100644 (file)
index 6e25b02..0000000
+++ /dev/null
@@ -1 +0,0 @@
-/* Empty.  */
index c31bba2f7c5882ef506e83d54122a18cce0ce359..f7766c788ebad089bdeac5e61dc936e6a3bb5540 100644 (file)
 
 /* Same for ino_t and ino64_t.  */
 # define __INO_T_MATCHES_INO64_T       1
+
+/* And for __rlim_t and __rlim64_t.  */
+# define __RLIM_T_MATCHES_RLIM64_T     1
+#else
+# define __RLIM_T_MATCHES_RLIM64_T     0
 #endif
 
 /* Number of descriptors that can fit in an `fd_set'.  */
index f055c68519a194ffc6439f463380cff6752a6a91..b775008a37c54ae1c6abd231002a6ddc9e69814c 100644 (file)
@@ -1,7 +1,5 @@
 # File name    Caller  Syscall name    # args  Strong name     Weak names
 
 # rlimit APIs
-getrlimit      -       getrlimit       i:ip    __getrlimit     getrlimit
-setrlimit      -       setrlimit       i:ip    __setrlimit     setrlimit
 prlimit64      EXTRA   prlimit64       i:iipp  prlimit64
 fanotify_mark  EXTRA   fanotify_mark   i:iiiiis        fanotify_mark
diff --git a/sysdeps/unix/sysv/linux/getrlimit.c b/sysdeps/unix/sysv/linux/getrlimit.c
new file mode 100644 (file)
index 0000000..bd340fb
--- /dev/null
@@ -0,0 +1,56 @@
+/* Linux getrlimit implementation (32 bits rlim_t).
+   Copyright (C) 2016 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 Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 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
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <errno.h>
+#include <sys/resource.h>
+#include <sys/types.h>
+#include <shlib-compat.h>
+
+#if !__RLIM_T_MATCHES_RLIM64_T
+
+/* The __NR_getrlimit compatibility implementation is required iff
+   __NR_ugetrlimit is also defined (meaning an old broken RLIM_INFINITY
+   definition).  */
+# ifndef __NR_ugetrlimit
+#  define __NR_ugetrlimit __NR_getrlimit
+#  undef SHLIB_COMPAT
+#  define SHLIB_COMPAT(a, b, c) 0
+# endif
+
+int
+__new_getrlimit (enum __rlimit_resource resource, struct rlimit *rlim)
+{
+  return INLINE_SYSCALL_CALL (ugetrlimit, resource, rlim);
+}
+weak_alias (__new_getrlimit, __getrlimit)
+hidden_weak (__getrlimit)
+
+# if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_2)
+/* Back compatible 2Gig limited rlimit.  */
+int
+__old_getrlimit (enum __rlimit_resource resource, struct rlimit *rlim)
+{
+  return INLINE_SYSCALL_CALL (getrlimit, resource, rlim);
+}
+compat_symbol (libc, __old_getrlimit, getrlimit, GLIBC_2_0);
+versioned_symbol (libc, __new_getrlimit, getrlimit, GLIBC_2_2);
+# else
+weak_alias (__new_getrlimit, getrlimit)
+# endif
+
+#endif /* __RLIM_T_MATCHES_RLIM64_T  */
index d055a7f83923aabb696456b3ac3e6d25dbb8a77f..cb3d0080d8965f913b6e3bb0f5b819a0733bbd10 100644 (file)
@@ -1,4 +1,5 @@
-/* Copyright (C) 2010-2016 Free Software Foundation, Inc.
+/* Linux getrlimit64 implementation (64 bits rlim_t).
+   Copyright (C) 2010-2016 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
    <http://www.gnu.org/licenses/>.  */
 
 #include <errno.h>
-#include <sys/resource.h>
 #include <sys/types.h>
-#include <sysdep.h>
-#include <kernel-features.h>
+#include <shlib-compat.h>
+
+/* Add this redirection so the strong_alias for __RLIM_T_MATCHES_RLIM64_T
+   linking getlimit64 to {__}getrlimit does not throw a type error.  */
+#undef getrlimit
+#undef __getrlimit
+#define getrlimit getrlimit_redirect
+#define __getrlimit __getrlimit_redirect
+#include <sys/resource.h>
+#undef getrlimit
+#undef __getrlimit
 
 /* Put the soft and hard limits for RESOURCE in *RLIMITS.
    Returns 0 if successful, -1 if not (and sets errno).  */
 int
 __getrlimit64 (enum __rlimit_resource resource, struct rlimit64 *rlimits)
 {
-#ifdef __ASSUME_PRLIMIT64
-  return INLINE_SYSCALL (prlimit64, 4, 0, resource, NULL, rlimits);
-#else
-# ifdef __NR_prlimit64
-  int res = INLINE_SYSCALL (prlimit64, 4, 0, resource, NULL, rlimits);
+#ifdef __NR_prlimit64
+  int res = INLINE_SYSCALL_CALL (prlimit64, 0, resource, NULL, rlimits);
   if (res == 0 || errno != ENOSYS)
     return res;
+#endif
+
+/* The fallback code only makes sense if the platform supports either
+   __NR_ugetrlimit and/or __NR_getrlimit.  */
+#if defined (__NR_ugetrlimit) || defined (__NR_getrlimit)
+# ifndef __NR_ugetrlimit
+#  define __NR_ugetrlimit __NR_getrlimit
 # endif
+# if __RLIM_T_MATCHES_RLIM64_T
+#  define rlimits32 (*rlimits)
+# else
   struct rlimit rlimits32;
+# endif
 
-  if (__getrlimit (resource, &rlimits32) < 0)
+  if (INLINE_SYSCALL_CALL (ugetrlimit, resource, &rlimits32) < 0)
     return -1;
 
+# if !__RLIM_T_MATCHES_RLIM64_T
   if (rlimits32.rlim_cur == RLIM_INFINITY)
     rlimits->rlim_cur = RLIM64_INFINITY;
   else
@@ -47,12 +65,56 @@ __getrlimit64 (enum __rlimit_resource resource, struct rlimit64 *rlimits)
     rlimits->rlim_max = RLIM64_INFINITY;
   else
     rlimits->rlim_max = rlimits32.rlim_max;
+# endif /* !__RLIM_T_MATCHES_RLIM64_T */
+#endif /* defined (__NR_ugetrlimit) || defined (__NR_getrlimit)  */
 
   return 0;
-#endif
 }
 libc_hidden_def (__getrlimit64)
-#ifndef getrlimit64
+
+#if __RLIM_T_MATCHES_RLIM64_T
+/* If both rlim_t and rlimt64_t are essentially the same type we can use
+   alias both interfaces.  */
+strong_alias (__getrlimit64, __GI_getrlimit)
+strong_alias (__getrlimit64, __GI___getrlimit)
+strong_alias (__getrlimit64, __getrlimit)
+weak_alias (__getrlimit64, getrlimit)
+/* And there is no need for compat symbols.  */
+# undef SHLIB_COMPAT
+# define SHLIB_COMPAT(a, b, c) 0
+#endif
+
+#if SHLIB_COMPAT (libc, GLIBC_2_1, GLIBC_2_2)
+/* Back compatible 2GiB limited rlimit.  */
+extern int __new_getrlimit (enum __rlimit_resource, struct rlimit *);
+
+int
+attribute_compat_text_section
+__old_getrlimit64 (enum __rlimit_resource resource, struct rlimit64 *rlimits)
+{
+# if __RLIM_T_MATCHES_RLIM64_T
+#  define rlimits32 (*rlimits)
+# else
+  struct rlimit rlimits32;
+# endif
+
+  if (__new_getrlimit (resource, &rlimits32) < 0)
+    return -1;
+
+  if (rlimits32.rlim_cur == RLIM_INFINITY)
+    rlimits->rlim_cur = RLIM64_INFINITY >> 1;
+  else
+    rlimits->rlim_cur = rlimits32.rlim_cur;
+  if (rlimits32.rlim_max == RLIM_INFINITY)
+    rlimits->rlim_max = RLIM64_INFINITY >> 1;
+  else
+    rlimits->rlim_max = rlimits32.rlim_max;
+
+  return 0;
+}
+versioned_symbol (libc, __getrlimit64, getrlimit64, GLIBC_2_2);
+compat_symbol (libc, __old_getrlimit64, getrlimit64, GLIBC_2_1);
+#else
 weak_alias (__getrlimit64, getrlimit64)
 libc_hidden_weak (getrlimit64)
 #endif
diff --git a/sysdeps/unix/sysv/linux/hppa/getrlimit64.c b/sysdeps/unix/sysv/linux/hppa/getrlimit64.c
deleted file mode 100644 (file)
index fef018f..0000000
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/getrlimit64.c>
index 1f3dfb01e883d12637cfcd71d1821316862c7fe8..a95c3ddf18b6f33ad6e07634f38feec7d15ecb0a 100644 (file)
@@ -31,8 +31,6 @@ shutdown      -       shutdown        i:ii    __shutdown      shutdown
 socket         -       socket          i:iii   __socket        socket
 socketpair     -       socketpair      i:iiif  __socketpair    socketpair
 
-setrlimit      -       setrlimit       i:ip    __setrlimit     setrlimit
-getrlimit      -       getrlimit       i:ip    __getrlimit     getrlimit
 prlimit64      EXTRA   prlimit64       i:iipp  __prlimit64     prlimit64@@GLIBC_2.17
 fanotify_mark  EXTRA   fanotify_mark   i:iiiiis        __fanotify_mark fanotify_mark@@GLIBC_2.19
 personality    EXTRA   personality     Ei:i    __personality   personality
index 2596cdfbb20e1ed96c2c24effc066c8b9ce18d1f..96097522560a729d5cfe64bda5e837834e3a59ca 100644 (file)
@@ -49,10 +49,6 @@ libpthread-sysdep_routines += libc-do-syscall
 libpthread-shared-only-routines += libc-do-syscall
 endif
 
-ifeq ($(subdir),resource)
-sysdep_routines += oldgetrlimit64
-endif
-
 ifeq ($(subdir),stdlib)
 gen-as-const-headers += ucontext_i.sym
 endif
diff --git a/sysdeps/unix/sysv/linux/i386/oldgetrlimit64.c b/sysdeps/unix/sysv/linux/i386/oldgetrlimit64.c
deleted file mode 100644 (file)
index ad86a07..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-/* Copyright (C) 1991-2016 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 Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 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
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
-
-/* This is a compatibility file.  If we don't build the libc with
-   versioning don't compile this file.  */
-#include <shlib-compat.h>
-#if SHLIB_COMPAT (libc, GLIBC_2_1, GLIBC_2_2)
-
-#include <errno.h>
-#include <sys/resource.h>
-#include <sys/types.h>
-
-extern int __new_getrlimit (enum __rlimit_resource, struct rlimit *);
-extern int __old_getrlimit64 (enum __rlimit_resource resource,
-                             struct rlimit64 *rlimits);
-
-
-/* Put the soft and hard limits for RESOURCE in *RLIMITS.
-   Returns 0 if successful, -1 if not (and sets errno).  */
-int
-attribute_compat_text_section
-__old_getrlimit64 (enum __rlimit_resource resource, struct rlimit64 *rlimits)
-{
-  struct rlimit rlimits32;
-
-  if (__new_getrlimit (resource, &rlimits32) < 0)
-    return -1;
-
-  if (rlimits32.rlim_cur == RLIM_INFINITY)
-    rlimits->rlim_cur = RLIM64_INFINITY >> 1;
-  else
-    rlimits->rlim_cur = rlimits32.rlim_cur;
-  if (rlimits32.rlim_max == RLIM_INFINITY)
-    rlimits->rlim_max = RLIM64_INFINITY >> 1;
-  else
-    rlimits->rlim_max = rlimits32.rlim_max;
-
-  return 0;
-}
-
-compat_symbol (libc, __old_getrlimit64, getrlimit64, GLIBC_2_1);
-
-#endif /* SHLIB_COMPAT */
index 6282ff8e2f322eb63a1d5a9602444ea4b70a982f..145393f7802c854b0c516e6864451d0553bf1e39 100644 (file)
@@ -18,8 +18,6 @@ setfsuid      -       setfsuid32      Ei:i    setfsuid
 modify_ldt     EXTRA   modify_ldt      i:ipi   __modify_ldt    modify_ldt
 vm86old                EXTRA   vm86old         i:p     __vm86old       vm86@GLIBC_2.0
 vm86           -       vm86            i:ip    __vm86          vm86@@GLIBC_2.3.4
-oldgetrlimit   EXTRA   getrlimit       i:ip    __old_getrlimit getrlimit@GLIBC_2.0
-setrlimit      -       setrlimit       i:ip    __setrlimit     setrlimit@GLIBC_2.0 setrlimit@@GLIBC_2.2
 waitpid                -       waitpid         Ci:ipi  __waitpid       waitpid
 
 prlimit64      EXTRA   prlimit64       i:iipp  prlimit64
index 61c355ac2a49d83855d1ef505052df5e29700aa8..5c50ce69275f57839826cb1c34a464b172bc1803 100644 (file)
@@ -18,7 +18,3 @@ sysdep-rtld-routines += m68k-vdso
 sysdep-others += lddlibc4
 install-bin += lddlibc4
 endif
-
-ifeq ($(subdir),resource)
-sysdep_routines += oldgetrlimit64
-endif
diff --git a/sysdeps/unix/sysv/linux/m68k/getrlimit64.c b/sysdeps/unix/sysv/linux/m68k/getrlimit64.c
deleted file mode 100644 (file)
index fef018f..0000000
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/getrlimit64.c>
diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/syscalls.list b/sysdeps/unix/sysv/linux/m68k/m680x0/syscalls.list
deleted file mode 100644 (file)
index b0ad689..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-# File name    Caller  Syscall name    Args    Strong name     Weak names
-
-oldgetrlimit   EXTRA   getrlimit       i:ip    __old_getrlimit getrlimit@GLIBC_2.0
-setrlimit      -       setrlimit       i:ip    __setrlimit     setrlimit@GLIBC_2.0 setrlimit@@GLIBC_2.2
diff --git a/sysdeps/unix/sysv/linux/m68k/oldgetrlimit64.c b/sysdeps/unix/sysv/linux/m68k/oldgetrlimit64.c
deleted file mode 100644 (file)
index 4c27e95..0000000
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/oldgetrlimit64.c>
diff --git a/sysdeps/unix/sysv/linux/powerpc/getrlimit64.c b/sysdeps/unix/sysv/linux/powerpc/getrlimit64.c
deleted file mode 100644 (file)
index fef018f..0000000
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/getrlimit64.c>
diff --git a/sysdeps/unix/sysv/linux/powerpc/oldgetrlimit64.c b/sysdeps/unix/sysv/linux/powerpc/oldgetrlimit64.c
deleted file mode 100644 (file)
index 4c27e95..0000000
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/oldgetrlimit64.c>
index 84324aa7e1e43c50033cbe519c63833128143891..3d6c150582e0d9b45dc1242cce6b255fa6205a55 100644 (file)
@@ -1,6 +1,2 @@
 # See Makeconfig regarding the use of default-abi.
 default-abi := 32
-
-ifeq ($(subdir),resource)
-sysdep_routines += oldgetrlimit64
-endif
index 451d50884bb891552cef84cdd76ee20a57ceefdb..931374776ae4f31bed10d0db41bd38c29164ce9f 100644 (file)
@@ -3,10 +3,6 @@
 chown          -       chown           i:sii   __chown         chown@@GLIBC_2.1
 lchown         -       lchown          i:sii   __lchown        lchown@@GLIBC_2.0 chown@GLIBC_2.0
 
-# System calls with wrappers.
-oldgetrlimit   EXTRA   getrlimit       i:ip    __old_getrlimit getrlimit@GLIBC_2.0
-setrlimit      -       setrlimit       i:ip    __setrlimit     setrlimit@GLIBC_2.0 setrlimit@@GLIBC_2.2
-
 # Due to 64bit alignment there is a dummy second parameter
 readahead      -       readahead       i:iiiii __readahead     readahead
 
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/syscalls.list b/sysdeps/unix/sysv/linux/powerpc/powerpc64/syscalls.list
deleted file mode 100644 (file)
index 6ba6f9b..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-# File name    Caller  Syscall name    # args  Strong name     Weak names
-
-getrlimit      -       ugetrlimit      i:ip    __getrlimit     getrlimit getrlimit64 __getrlimit64
index 7ee0cef9fb1955a6c5d23bd20386552f43c2e89d..62b2418fef62acda5a1fbf9f3766c0bb2ddf2240 100644 (file)
 
 /* Same for ino_t and ino64_t.  */
 # define __INO_T_MATCHES_INO64_T       1
+
+/* And for __rlim_t and __rlim64_t.  */
+# define __RLIM_T_MATCHES_RLIM64_T     1
+#else
+# define __RLIM_T_MATCHES_RLIM64_T     0
 #endif
 
 /* Number of descriptors that can fit in an `fd_set'.  */
index 626a96f04fd916812c902b9440779cae04e061d5..da3b3c76b454ca9dfdca1a8da474ebe4531530aa 100644 (file)
@@ -10,10 +10,6 @@ ifeq ($(subdir),misc)
 sysdep_headers += sys/elf.h
 endif
 
-ifeq ($(subdir),resource)
-sysdep_routines += oldgetrlimit64
-endif
-
 ifeq ($(subdir),elf)
 ifeq (yes,$(build-shared))
 # This is needed to support g++ v2 and v3.
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/getrlimit64.c b/sysdeps/unix/sysv/linux/s390/s390-32/getrlimit64.c
deleted file mode 100644 (file)
index fef018f..0000000
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/getrlimit64.c>
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/oldgetrlimit64.c b/sysdeps/unix/sysv/linux/s390/s390-32/oldgetrlimit64.c
deleted file mode 100644 (file)
index 4c27e95..0000000
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/oldgetrlimit64.c>
index 141b16523d30e101263c540065fd0ff6dbb0a2ef..300b13dd0167b978d59a10546d31b4d0d85be850 100644 (file)
@@ -15,9 +15,6 @@ getgroups     -       getgroups32     i:ip    __getgroups     getgroups
 setfsgid       -       setfsgid32      Ei:i    setfsgid
 setfsuid       -       setfsuid32      Ei:i    setfsuid
 
-oldgetrlimit   EXTRA   getrlimit       i:ip    __old_getrlimit getrlimit@GLIBC_2.0
-setrlimit      -       setrlimit       i:ip    __setrlimit     setrlimit@GLIBC_2.0 setrlimit@@GLIBC_2.2
-
 prlimit64      EXTRA   prlimit64       i:iipp  prlimit64
 fanotify_mark  EXTRA   fanotify_mark   i:iiiiis        fanotify_mark
 personality    EXTRA   personality     Ei:i    __personality   personality
diff --git a/sysdeps/unix/sysv/linux/setrlimit.c b/sysdeps/unix/sysv/linux/setrlimit.c
new file mode 100644 (file)
index 0000000..78a3c33
--- /dev/null
@@ -0,0 +1,64 @@
+/* Linux setrlimit implementation (32 bits off_t).
+   Copyright (C) 2016 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 Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 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
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <errno.h>
+#include <sys/resource.h>
+#include <sys/types.h>
+#include <shlib-compat.h>
+
+#if !__RLIM_T_MATCHES_RLIM64_T
+
+/* The compatibility symbol is meant to match the old __NR_getrlimit syscall
+   (with broken RLIM_INFINITY definition).  It should be provided iff
+   __NR_getrlimit and __NR_ugetrlimit are both defined.  */
+# ifndef __NR_ugetrlimit
+#  undef SHLIB_COMPAT
+#  define SHLIB_COMPAT(a, b, c) 0
+# endif
+
+int
+__setrlimit (enum __rlimit_resource resource, const struct rlimit *rlim)
+{
+# ifdef __NR_prlimit64
+  struct rlimit64 rlim64;
+
+  if (rlim->rlim_cur == RLIM_INFINITY)
+    rlim64.rlim_cur = RLIM64_INFINITY;
+  else
+    rlim64.rlim_cur = rlim->rlim_cur;
+  if (rlim->rlim_max == RLIM_INFINITY)
+    rlim64.rlim_max = RLIM64_INFINITY;
+  else
+    rlim64.rlim_max = rlim->rlim_max;
+
+  int res = INLINE_SYSCALL_CALL (prlimit64, 0, resource, &rlim64, NULL);
+  if (res == 0 || errno != ENOSYS)
+    return res;
+# endif
+  return INLINE_SYSCALL_CALL (setrlimit, resource, rlim);
+}
+
+# if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_2)
+strong_alias (__setrlimit, __setrlimit_1)
+compat_symbol (libc, __setrlimit, setrlimit, GLIBC_2_0);
+versioned_symbol (libc, __setrlimit_1, setrlimit, GLIBC_2_2);
+# else
+weak_alias (__setrlimit, setrlimit)
+# endif
+
+#endif /* __RLIM_T_MATCHES_RLIM64_T  */
index 5f444d2ae725c841e7907db2ea12372b208877fe..8d2f7c6e5304146c59fffc3cda1bf64f5b47f6ed 100644 (file)
@@ -1,4 +1,5 @@
-/* Copyright (C) 2010-2016 Free Software Foundation, Inc.
+/* Linux setrlimit64 implementation (64 bits off_t).
+   Copyright (C) 2010-2016 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
    <http://www.gnu.org/licenses/>.  */
 
 #include <errno.h>
-#include <sys/resource.h>
 #include <sys/types.h>
-#include <sysdep.h>
-#include <kernel-features.h>
+#include <shlib-compat.h>
+
+/* Add this redirection so the strong_alias for __RLIM_T_MATCHES_RLIM64_T
+   linking setlimit64 to {__}setrlimit does not throw a type error.  */
+#undef settrlimit
+#undef __sttrlimit
+#define setrlimit setrlimit_redirect
+#define __setrlimit __setrlimit_redirect
+#include <sys/resource.h>
+#undef setrlimit
+#undef __setrlimit
 
 /* 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
-setrlimit64 (enum __rlimit_resource resource, const struct rlimit64 *rlimits)
+__setrlimit64 (enum __rlimit_resource resource, const struct rlimit64 *rlimits)
 {
-#ifdef __ASSUME_PRLIMIT64
-  return INLINE_SYSCALL (prlimit64, 4, 0, resource, rlimits, NULL);
-#else
-# ifdef __NR_prlimit64
-  int res = INLINE_SYSCALL (prlimit64, 4, 0, resource, rlimits, NULL);
+  int res;
+
+#ifdef __NR_prlimit64
+  res = INLINE_SYSCALL_CALL (prlimit64, 0, resource, rlimits, NULL);
   if (res == 0 || errno != ENOSYS)
     return res;
-# endif
+#endif
+
+/* The fallback code only makes sense if the platform supports
+   __NR_setrlimit.  */
+#ifdef __NR_setrlimit
+# if !__RLIM_T_MATCHES_RLIM64_T
   struct rlimit rlimits32;
 
   if (rlimits->rlim_cur >= RLIM_INFINITY)
@@ -45,7 +58,18 @@ setrlimit64 (enum __rlimit_resource resource, const struct rlimit64 *rlimits)
     rlimits32.rlim_max = RLIM_INFINITY;
   else
     rlimits32.rlim_max = rlimits->rlim_max;
+# else
+#  define rlimits32 (*rlimits)
+# endif
 
-  return __setrlimit (resource, &rlimits32);
+  res = INLINE_SYSCALL_CALL (setrlimit, resource, &rlimits32);
 #endif
+
+  return res;
 }
+weak_alias (__setrlimit64, setrlimit64)
+
+#if __RLIM_T_MATCHES_RLIM64_T
+strong_alias (__setrlimit64, __setrlimit)
+weak_alias (__setrlimit64, setrlimit)
+#endif
diff --git a/sysdeps/unix/sysv/linux/sh/getrlimit64.c b/sysdeps/unix/sysv/linux/sh/getrlimit64.c
deleted file mode 100644 (file)
index fef018f..0000000
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/getrlimit64.c>
index f98dd83f932fad3b3a4e0cb8fe3e0f44bd288433..705c8773b33af2c34b51e12e8ce7a8cf40487898 100644 (file)
 
 /* Same for ino_t and ino64_t.  */
 # define __INO_T_MATCHES_INO64_T       1
+
+/* And for __rlim_t and __rlim64_t.  */
+# define __RLIM_T_MATCHES_RLIM64_T     1
+#else
+# define __RLIM_T_MATCHES_RLIM64_T     0
 #endif
 
 /* Number of descriptors that can fit in an `fd_set'.  */
similarity index 74%
rename from sysdeps/unix/sysv/linux/i386/getrlimit64.c
rename to sysdeps/unix/sysv/linux/sparc/getrlimit64.c
index 7f3d227beba5b97bb35369907627c1d6dcb7c468..3a198521b6c6e6b2987839b6b363c2b009f2c416 100644 (file)
@@ -1,4 +1,5 @@
-/* Copyright (C) 1999-2016 Free Software Foundation, Inc.
+/* Linux getrlimit64 sparc32 implementation (64 bits rlim_t).
+   Copyright (C) 2016 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
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#define getrlimit64 __new_getrlimit64
+#include <shlib-compat.h>
 
-#include "../getrlimit64.c"
+#undef SHLIB_COMPAT
+#define SHLIB_COMPAT(a,b,c) 0
 
-#undef getrlimit64
-#include <shlib-compat.h>
-versioned_symbol (libc, __getrlimit64, getrlimit64, GLIBC_2_2);
-strong_alias (__getrlimit64, __GI_getrlimit64)
+#include <sysdeps/unix/sysv/linux/getrlimit64.c>
index 6240cd3a5266ec6f43af37c520407e7b7054af44..0b6095ffab58148a341b32f7f25b91dc38d8b272 100644 (file)
@@ -4,8 +4,6 @@ chown           -       chown32         i:sii   __chown         chown
 lchown         -       lchown32        i:sii   __lchown        lchown
 fchown         -       fchown32        i:iii   __fchown        fchown
 
-setrlimit      -       setrlimit       2       __setrlimit     setrlimit
-getrlimit      -       getrlimit       2       __getrlimit     getrlimit
 getegid                -       getegid32       Ei:     __getegid       getegid
 geteuid                -       geteuid32       Ei:     __geteuid       geteuid
 getgid         -       getgid32        Ei:     __getgid        getgid
index 7ae2541f8f6a7c6cc25495ea2d76ce79df1a593e..68af897e394d0df4c7f1ca51dfcc377c67540560 100644 (file)
@@ -26,7 +26,6 @@ getpmsg               -       getpmsg         i:ipppp getpmsg
 getppid                -       getppid         Ei:     __getppid       getppid
 getresuid      -       getresuid       i:ppp   getresuid
 getresgid      -       getresgid       i:ppp   getresgid
-getrlimit      -       ugetrlimit      i:ip    __new_getrlimit __getrlimit getrlimit@@GLIBC_2.2
 getsid         -       getsid          i:i     getsid
 init_module    EXTRA   init_module     5       init_module
 inotify_add_watch      EXTRA   inotify_add_watch       i:isi   inotify_add_watch
diff --git a/sysdeps/unix/sysv/linux/wordsize-64/getrlimit64.c b/sysdeps/unix/sysv/linux/wordsize-64/getrlimit64.c
deleted file mode 100644 (file)
index 9feab0e..0000000
+++ /dev/null
@@ -1 +0,0 @@
-/* getrlimit64 is the same as getrlimit. */
diff --git a/sysdeps/unix/sysv/linux/wordsize-64/setrlimit64.c b/sysdeps/unix/sysv/linux/wordsize-64/setrlimit64.c
deleted file mode 100644 (file)
index 8edcff0..0000000
+++ /dev/null
@@ -1 +0,0 @@
-/* setrlimit64 is the same as setrlimit. */
index 99236ba9bfcfb8c6293ccd906dff4203f59a6dce..e71cd7b1569c5fed2fb2b113aced8836582d75ad 100644 (file)
@@ -3,8 +3,6 @@
 fstatfs                -       fstatfs         i:ip    __fstatfs       fstatfs fstatfs64 __fstatfs64
 statfs         -       statfs          i:sp    __statfs        statfs statfs64
 mmap           -       mmap            b:aniiii __mmap         mmap __mmap64 mmap64
-getrlimit      -       getrlimit       i:ip    __getrlimit     getrlimit getrlimit64 __getrlimit64
-setrlimit      -       setrlimit       i:ip    __setrlimit     setrlimit setrlimit64
 readahead      -       readahead       i:iii   __readahead     readahead
 sendfile       -       sendfile        i:iipi  sendfile        sendfile64
 sync_file_range        -       sync_file_range Ci:iiii sync_file_range
index 5817ef3f86151925c7047848f756cfa34a95b884..1fd90d3e85b011a6207e14cc3348b0093e0cfbcc 100644 (file)
 
 /* Same for ino_t and ino64_t.  */
 # define __INO_T_MATCHES_INO64_T       1
+
+/* And for __rlim_t and __rlim64_t.  */
+# define __RLIM_T_MATCHES_RLIM64_T     1
+#else
+# define __RLIM_T_MATCHES_RLIM64_T     0
 #endif
 
 /* Number of descriptors that can fit in an `fd_set'.  */