aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2014-09-23 14:12:50 +0000
committerJoseph Myers <joseph@codesourcery.com>2014-09-23 14:12:50 +0000
commit68870f1253b781960da0f8bf9d8e6fbe6cf2ff3d (patch)
treeb6b991a11d8ab4972b5a8854845fa4b34c6f4014
parentea58f202931fdf15450e54859aaea675efb93588 (diff)
downloadglibc-68870f1253b781960da0f8bf9d8e6fbe6cf2ff3d.zip
glibc-68870f1253b781960da0f8bf9d8e6fbe6cf2ff3d.tar.gz
glibc-68870f1253b781960da0f8bf9d8e6fbe6cf2ff3d.tar.bz2
Move some setrlimit definitions to syscalls.list (bug 14138).
Bug 14138 is followup cleanup after removal of support for old Linux kernel versions: moving syscalls to syscalls.list where the only reason for using C definitions was kernel version conditionals that are no longer present. This patch deals with the case of setrlimit (sysdeps/unix/sysv/linux/i386/setrlimit.c, included by various other architectures). Where needed (where there is also a compat symbol for setrlimit@GLIBC_2.0), new syscalls.list entries are added. Where not needed (where there is no such compat symbol and the minimum symbol version for libc is 2.2 or later), no such entries are added as that in sysdeps/unix/syscalls.list will suffice. Thus arm and sh need no such entries, while m68k and powerpc need entries only in a subdirectory syscalls.list file rather than for all configurations that previously used setrlimit.c. (setrlimit@@GLIBC_2.2 and setrlimit@GLIBC_2.0 are now semantically identical - the new symbol version was about a change of types from signed to unsigned and the former compatibility code for dealing with large unsigned arguments on old kernels is no longer needed or present, having been removed with support for pre-2.4 kernels. However, making the two versions into aliases doesn't work at present: the case of having both default and non-default symbol versions on the same syscalls.list line results in a compat_symbol call in code built for static libc, which doesn't compile. I don't suppose it would be hard to generate SHARED conditionals from make-syscalls.sh to fix this, but in any case this patch doesn't make things any worse, as the functions weren't aliases before the patch either.) Tested for x86, and ran ABI tests for ARM as an example of an architecture where the setrlimit.c file was just removed without adding syscalls.list entries. [BZ #14138] * sysdeps/unix/sysv/linux/arm/setrlimit.c: Remove file. * sysdeps/unix/sysv/linux/i386/setrlimit.c: Likewise. * sysdeps/unix/sysv/linux/m68k/setrlimit.c: Likewise. * sysdeps/unix/sysv/linux/powerpc/setrlimit.c: Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/setrlimit.c: Likewise. * sysdeps/unix/sysv/linux/sh/setrlimit.c: Likewise. * sysdeps/unix/sysv/linux/i386/syscalls.list (setrlimit): Add syscall entry for GLIBC_2.2 symbol version. * sysdeps/unix/sysv/linux/m68k/m680x0/syscalls.list (setrlimit): Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc32/syscalls.list (setrlimit): Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/syscalls.list (setrlimit): Likewise.
-rw-r--r--ChangeLog18
-rw-r--r--sysdeps/unix/sysv/linux/arm/setrlimit.c1
-rw-r--r--sysdeps/unix/sysv/linux/i386/setrlimit.c38
-rw-r--r--sysdeps/unix/sysv/linux/i386/syscalls.list1
-rw-r--r--sysdeps/unix/sysv/linux/m68k/m680x0/syscalls.list1
-rw-r--r--sysdeps/unix/sysv/linux/m68k/setrlimit.c1
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/syscalls.list1
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/setrlimit.c1
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/setrlimit.c1
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/syscalls.list1
-rw-r--r--sysdeps/unix/sysv/linux/sh/setrlimit.c1
11 files changed, 22 insertions, 43 deletions
diff --git a/ChangeLog b/ChangeLog
index 7fa614c..2761d9a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,21 @@
+2014-09-23 Joseph Myers <joseph@codesourcery.com>
+
+ [BZ #14138]
+ * sysdeps/unix/sysv/linux/arm/setrlimit.c: Remove file.
+ * sysdeps/unix/sysv/linux/i386/setrlimit.c: Likewise.
+ * sysdeps/unix/sysv/linux/m68k/setrlimit.c: Likewise.
+ * sysdeps/unix/sysv/linux/powerpc/setrlimit.c: Likewise.
+ * sysdeps/unix/sysv/linux/s390/s390-32/setrlimit.c: Likewise.
+ * sysdeps/unix/sysv/linux/sh/setrlimit.c: Likewise.
+ * sysdeps/unix/sysv/linux/i386/syscalls.list (setrlimit): Add
+ syscall entry for GLIBC_2.2 symbol version.
+ * sysdeps/unix/sysv/linux/m68k/m680x0/syscalls.list (setrlimit):
+ Likewise.
+ * sysdeps/unix/sysv/linux/powerpc/powerpc32/syscalls.list
+ (setrlimit): Likewise.
+ * sysdeps/unix/sysv/linux/s390/s390-32/syscalls.list (setrlimit):
+ Likewise.
+
2014-09-23 Will Newton <will.newton@linaro.org>
* sysdeps/unix/sysv/linux/arm/bits/hwcap.h: Check for
diff --git a/sysdeps/unix/sysv/linux/arm/setrlimit.c b/sysdeps/unix/sysv/linux/arm/setrlimit.c
deleted file mode 100644
index bfaef74..0000000
--- a/sysdeps/unix/sysv/linux/arm/setrlimit.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/setrlimit.c>
diff --git a/sysdeps/unix/sysv/linux/i386/setrlimit.c b/sysdeps/unix/sysv/linux/i386/setrlimit.c
deleted file mode 100644
index 2868d90..0000000
--- a/sysdeps/unix/sysv/linux/i386/setrlimit.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/* Copyright (C) 1999-2014 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/param.h>
-#include <sys/resource.h>
-
-#include <sysdep.h>
-#include <sys/syscall.h>
-#include <shlib-compat.h>
-
-extern int __new_setrlimit (enum __rlimit_resource resource,
- const struct rlimit *rlimits);
-
-/* Consider moving to syscalls.list. */
-
-int
-__new_setrlimit (enum __rlimit_resource resource, const struct rlimit *rlimits)
-{
- return INLINE_SYSCALL (setrlimit, 2, resource, rlimits);
-}
-
-weak_alias (__new_setrlimit, __setrlimit);
-versioned_symbol (libc, __new_setrlimit, setrlimit, GLIBC_2_2);
diff --git a/sysdeps/unix/sysv/linux/i386/syscalls.list b/sysdeps/unix/sysv/linux/i386/syscalls.list
index 149d432..8d94828 100644
--- a/sysdeps/unix/sysv/linux/i386/syscalls.list
+++ b/sysdeps/unix/sysv/linux/i386/syscalls.list
@@ -5,6 +5,7 @@ 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
oldsetrlimit EXTRA setrlimit i:ip __old_setrlimit setrlimit@GLIBC_2.0
+setrlimit - setrlimit i:ip __setrlimit setrlimit@@GLIBC_2.2
waitpid - waitpid Ci:ipi __waitpid waitpid __libc_waitpid
prlimit64 EXTRA prlimit64 i:iipp prlimit64
diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/syscalls.list b/sysdeps/unix/sysv/linux/m68k/m680x0/syscalls.list
index 913f051..6f10536 100644
--- a/sysdeps/unix/sysv/linux/m68k/m680x0/syscalls.list
+++ b/sysdeps/unix/sysv/linux/m68k/m680x0/syscalls.list
@@ -2,3 +2,4 @@
oldgetrlimit EXTRA getrlimit i:ip __old_getrlimit getrlimit@GLIBC_2.0
oldsetrlimit EXTRA setrlimit i:ip __old_setrlimit setrlimit@GLIBC_2.0
+setrlimit - setrlimit i:ip __setrlimit setrlimit@@GLIBC_2.2
diff --git a/sysdeps/unix/sysv/linux/m68k/setrlimit.c b/sysdeps/unix/sysv/linux/m68k/setrlimit.c
deleted file mode 100644
index bfaef74..0000000
--- a/sysdeps/unix/sysv/linux/m68k/setrlimit.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/setrlimit.c>
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/syscalls.list b/sysdeps/unix/sysv/linux/powerpc/powerpc32/syscalls.list
index aaa3557..fb6535a 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/syscalls.list
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/syscalls.list
@@ -3,6 +3,7 @@
# System calls with wrappers.
oldgetrlimit EXTRA getrlimit i:ip __old_getrlimit getrlimit@GLIBC_2.0
oldsetrlimit EXTRA setrlimit i:ip __old_setrlimit setrlimit@GLIBC_2.0
+setrlimit - setrlimit i:ip __setrlimit 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/setrlimit.c b/sysdeps/unix/sysv/linux/powerpc/setrlimit.c
deleted file mode 100644
index bfaef74..0000000
--- a/sysdeps/unix/sysv/linux/powerpc/setrlimit.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/setrlimit.c>
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/setrlimit.c b/sysdeps/unix/sysv/linux/s390/s390-32/setrlimit.c
deleted file mode 100644
index bfaef74..0000000
--- a/sysdeps/unix/sysv/linux/s390/s390-32/setrlimit.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/setrlimit.c>
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/syscalls.list b/sysdeps/unix/sysv/linux/s390/s390-32/syscalls.list
index ce9f210..523bd2c 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/syscalls.list
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/syscalls.list
@@ -2,6 +2,7 @@
oldgetrlimit EXTRA getrlimit i:ip __old_getrlimit getrlimit@GLIBC_2.0
oldsetrlimit EXTRA setrlimit i:ip __old_setrlimit setrlimit@GLIBC_2.0
+setrlimit - setrlimit i:ip __setrlimit setrlimit@@GLIBC_2.2
prlimit64 EXTRA prlimit64 i:iipp prlimit64
fanotify_mark EXTRA fanotify_mark i:iiiiis fanotify_mark
diff --git a/sysdeps/unix/sysv/linux/sh/setrlimit.c b/sysdeps/unix/sysv/linux/sh/setrlimit.c
deleted file mode 100644
index bfaef74..0000000
--- a/sysdeps/unix/sysv/linux/sh/setrlimit.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/setrlimit.c>