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.
This commit is contained in:
Joseph Myers 2014-09-23 14:12:50 +00:00
parent ea58f20293
commit 68870f1253
11 changed files with 22 additions and 43 deletions

View File

@ -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

View File

@ -1 +0,0 @@
#include <sysdeps/unix/sysv/linux/i386/setrlimit.c>

View File

@ -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);

View File

@ -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

View File

@ -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

View File

@ -1 +0,0 @@
#include <sysdeps/unix/sysv/linux/i386/setrlimit.c>

View File

@ -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

View File

@ -1 +0,0 @@
#include <sysdeps/unix/sysv/linux/i386/setrlimit.c>

View File

@ -1 +0,0 @@
#include <sysdeps/unix/sysv/linux/i386/setrlimit.c>

View File

@ -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

View File

@ -1 +0,0 @@
#include <sysdeps/unix/sysv/linux/i386/setrlimit.c>